Author Topic: Changing The Default Search Option  (Read 2016 times)

0 Members and 1 Guest are viewing this topic.

Offline Stonesteel

  • Experienced poster
  • ***
  • Posts: 31
    • View Profile
Changing The Default Search Option
« 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;
}
}
"No Matter How Gifted You Are, Alone Cannot Change The World."

Offline Mars

  • Operator
  • Insane poster
  • *****
  • Posts: 1819
    • View Profile
Re: Changing The Default Search Option
« Reply #1 on: October 07, 2013, 02:14:21 PM »
It's not in the default template???? 

version of hfs and what is the template used?
FRENCH MEMBER : Si vous comprenez la langue française,  n'hésitez pas à l'utiliser pour une meilleure aide de ma part

Offline Stonesteel

  • Experienced poster
  • ***
  • Posts: 31
    • View Profile
Re: Changing The Default Search Option
« Reply #2 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
"No Matter How Gifted You Are, Alone Cannot Change The World."

Offline Stonesteel

  • Experienced poster
  • ***
  • Posts: 31
    • View Profile
Re: Changing The Default Search Option
« Reply #3 on: October 11, 2013, 10:33:51 AM »
Any update here?  ;D
"No Matter How Gifted You Are, Alone Cannot Change The World."

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12851
    • View Profile
Re: Changing The Default Search Option
« Reply #4 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.

Offline Stonesteel

  • Experienced poster
  • ***
  • Posts: 31
    • View Profile
Re: Changing The Default Search Option
« Reply #5 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?
"No Matter How Gifted You Are, Alone Cannot Change The World."

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12851
    • View Profile
Re: Changing The Default Search Option
« Reply #6 on: October 19, 2013, 05:10:02 AM »
i cannot search it myself, sorry