forked from PoulStaugaard/giewiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdvancedSearch.xml
24 lines (24 loc) · 1.18 KB
/
AdvancedSearch.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" ?><tiddlers><tiddler tags="excludeLists excludeSearch" title="AdvancedSearch" viewtemplate="ViewOnlyTemplate"><pre><script>
var pn = location.pathname;
if (!pn.endsWith('/')) {
var pns = pn.split('/');
pns.pop();
pn = pns.join('/');
}
window.forms.AdvancedSearch = { updateaccess: true, path: pn };
var b = http.listIndex();
if (b.tiddlers === undefined)
return "No text index found - you may need to visit BuildIndex.";
var sb = [];
for (var n = 0; n < b.tiddlers.length; n++) {
sb.push('|' + b.tiddlers[n] + '|<<input ' + b.tiddlers[n] + ' text 50>>|');
}
var lsbtn = '| |';
if (location.pathname.indexOf('/',1) > 0) {
lsbtn = '|<<input path text 33>> <<submitButton true "Search area" "Search entire site" config.macros.search.searchSite(window.forms.AdvancedSearch,0,true)>>|';
//window.forms.AdvancedSearch.path = location.pathname;
}
sb.push('|<<submitButton true "Search site" "Search entire site" config.macros.search.searchSite(window.forms.AdvancedSearch,0,false)>>' + lsbtn);
return sb.join('\n');
</script>
</pre></tiddler></tiddlers>