rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: Stonesteel on October 07, 2013, 02:01:52 AM

Title: Changing The Default Search Option
Post by: Stonesteel on October 07, 2013, 02:01:52 AM
Greetings!

I just wanted to ask, what value should I change in these codes so that the default search is File(s) only not Both, because the default option selected in the template is Both.

Code: [Select]
function searchQuery() {
frm = document.searchForm;
if(frm.query.value.length < 3) {
alert(lv_searchAlert);
} else {
frm.recursive.checked ? recursive ="&recursive" : recursive ="";
for(x=0; x<frm.choice.length; x++) {
if(frm.choice[x].checked ==1) {
if(frm.choice[x].value =="file") {
searchMode ="?files-filter=";
filter="&folders-filter=%5C";
} else if(frm.choice[x].value =="folder") {
searchMode ="?folders-filter=";
filter="&files-filter=%5C";
} else {
searchMode ="?filter=";
filter="";
}
}
}
for(c=0; c<frm.root.length; c++) {
if(frm.root[c].checked ==1) {
frm.root[c].value =="current" ? searchFrom ="http://"+serverHost+serverFolder : searchFrom ="http://"+serverHost;
}
}
document.location.href = searchFrom+searchMode+"*"+frm.query.value+"*"+recursive+filter;
}
}
Title: Re: Changing The Default Search Option
Post by: Mars on October 07, 2013, 02:14:21 PM
It's not in the default template???? 

version of hfs and what is the template used?
Title: Re: Changing The Default Search Option
Post by: Stonesteel on October 08, 2013, 01:22:18 AM
Hi Mars, I got it from the default template/rawr_default/code/rawr_main.js


it's inside the javascript..


I am currently using HFS 282, with the latest template 0.1.3.  ;D
Title: Re: Changing The Default Search Option
Post by: Stonesteel on October 11, 2013, 10:33:51 AM
Any update here?  ;D
Title: Re: Changing The Default Search Option
Post by: rejetto on October 15, 2013, 06:45:01 AM
the "default" it's not in the code you posted.
you posted the javascript, while it's actually in the html.
Title: Re: Changing The Default Search Option
Post by: Stonesteel on October 15, 2013, 02:26:40 PM
Hello rejetto, but I found the code inside the rawr_main javascript, well then what should I change in the code so that the default search will be in the File(s) option not in Both?
Title: Re: Changing The Default Search Option
Post by: rejetto on October 19, 2013, 05:10:02 AM
i cannot search it myself, sorry