Brent,

Go ahead and check it in!

----- Original Message -----
From: "Brent Beardsley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 1:07 AM
Subject: [DQSD-Devel] updated multi.xml


> Hi all,
>
> I've updated multi.xml but have not checked it into
> CVS because I'd like some feedback to make sure I
> didn't break the previous functionality.
>
> I changed the regexp to not include commas because I
> was trying some searches that needed included a comma
> and it didn't work (it tried to split on commas).
>
> Also I added the ability to specify multiple searches
> like with different parameters:
>
> multi fm; sf hs /new; gg wood planes
>
> It is disabled by default but if you add
>
> superMultiModeEnabled=true;
>
> in your local prefs it will be enabled.
>
> superMultiModeSepChar=';'; can also be set to whatever
> character  you want to split the string on but
> semicolon is the default.
>
> I've attached a new multi.xml and can check it in if
> nobody has any complaints or feedback.
>
> Brent
>
>
>
>
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com


--------------------------------------------------------------------------------


> <search function="multi">
>   <name>MultiSearch</name>
>   <description>
>     Perform multiple searches with a single command line expression.<br/>
>     <b><i>superMultiModeEnabled</i></b> can be set to true in localprefs.js to
enable super multi mode which allows different sets of
>          searches to be done (ie: multi search1 /firstParam; search2 search3
/secondParam)<br/>
>      <b><i>superMultiModeSepChar</i></b> can be set to a character in
localprefs.js to determine the split character for the super multi mode
>          the default value is ;
>     <div class="helpboxDescLabels">Usage:</div>
>     <table class="helpboxDescTable">
>       <tr><td>multi &lt;<i>search1</i>&gt; [&lt;<i>search2</i>&gt; [...]]
&lt;<i>term</i>&gt;</td></tr>
>     </table>
>     <div class="helpboxDescLabels">Example:</div>
>     <table class="helpboxDescTable">
>       <tr><td>multi av gg wood planes</td><td> - </td><td>Display the search
results for wood planes on altavista and google.</td></tr>
>       <tr><td>multi fm;sf hs /new</td><td> - </td><td>Display the new projects
and files on freshmeat, sourceforge, and hotscripts provided
superMultiModeEnabled is set to true in localprefs.js.</td></tr>
>     </table>
>   </description>
>   <category>Search the Web</category>
>   <contributor>Neel Doshi</contributor>
>
>   <script><![CDATA[
>
>     // This function is almost identical to the shortcut function in
search.html
>     function multiIsCommand(t)
>     {
>       // look for matching commands first
>       var search = null;
>       var term = null;
>       var result = t.match(/^([a-zA-Z]+)\b/)
>       if (result)
>       {
>         if (aliases[result[1]])
>         {
>           search = aliases[result[1]];
>           term = t.slice(result[1].length);
>         }
>       }
>
>       // then look for longest matching punctuation prefix
>       if (!search)
>       {
>         result = t.match(/^([\s~`!@#$%\^&\*()\-=\+{}\[\];:'<>,\.\/\?]+)/);
>         if (result)
>         {
>           for (var subs = result[1].length; subs>0; subs--)
>           {
>             search = aliases[result[1].slice(0, subs)];
>             if (search)
>             {
>               term = t.slice(subs);
>               break;
>             }
>           }
>         }
>       }
>
>       // then look for longest matching punctuation suffix
>       if (!search)
>       {
>         result = t.match(/([\s~`!@#$%\^&\*()\-=\+{}\[\];:'<>,\.\/\?]+)$/);
>         if (result)
>         {
>           for (var subs = result[1].length; subs>0; subs--)
>           {
>             search = aliases[result[1].slice(-subs)];
>             if (search)
>             {
>               term = t.slice(0, -subs);
>               break;
>             }
>           }
>         }
>       }
>
>       // no match, no dice
>       if (!search)
>         return false;
>
>       // return the proper search term for the asking procedure
>       return search;
>     }
>
>  // the multi function actually performs the multiple searches given
>  // the input parameters.  if the user's reuseBrowserWindowMode parameter
>  // is set to 1, multi will not work.  Also, if the user's launchmode
>  // is not set to zero, multi will pause between searches
>  // to allow multi to work with browsers other than IE.
>     function multi(q)
>     {
>       if ( reuseBrowserWindowMode == 1 )
>       {
>         alert("Multisearch requires the reuseBrowserWindowMode parameter to be
set to zero or two.  Otherwise, all the searches will be spawned in the same
window.");
>         return false;
>       }
>       if ( nullArgs("multi", q) )
>         return false;
>
>       var multiCmdSets = new Array();
>       var mySuperMultiModeEnabled =  (typeof superMultiModeEnabled !=
"undefined" && superMultiModeEnabled != "");
>       var mySuperSepChar = (typeof superMultiModeSepChar != "undefined" &&
superMultiModeSepChar != "") ? superMultiModeSepChar : ";";
>       if (mySuperMultiModeEnabled == true)
>       {
> var myCmds = q.split(mySuperSepChar);
>         for (var i=0; i < myCmds.length; i++)
> {
>    var oneCmd = myCmds[i];
>    multiCmdSets[i] = oneCmd;
>         }
>       } else {
>         multiCmdSets.push(q);
>       }
>
>       for (var m=0; m < multiCmdSets.length; m++)
>       {
>         if (result = (multiCmdSets[m]).split( /[\s]+/ ) )
>         {
>
>           var arrCmds = new Array(0);
>           var arrParams = new Array(0);
>
>           // Loop through the arguments to filter out the commands.
>           // if an argument is not a command, then no future arguments
>           // can be commands either.  The following variable keeps track of
this.
>           var fLoopBool = 1;
>           var strCommandName;
>
>           for ( var i = 1; i <= result.length; i++ )
>           {
>             strCommandName = multiIsCommand(result[i - 1]);
>             if (strCommandName != false && fLoopBool == 1)
>             {
>               // Append the command list with this command
>               arrCmds.push(strCommandName);
>             }
>             else
>             {
>               // Set the fLoopBool to zero since no more commands should be
found
>               fLoopBool = 0;
>
>               // Append the parameter string with this word
>               arrParams.push(result[i - 1].replace("\x27","\\x27"));
>             }
>           }
>           // Loop through the command list and perform the search
>           if (arrCmds.length == 0)
>           {
>             alert("Multisearch needs at least one search type parameter.");
>             return false;
>           }
>           else
>           {
>             // Perform each of the searches
>             for ( var j = 1; j <= arrCmds.length; j++ )
>             {
>               // if the user's launchmode is anything but zero, pause between
searches.
>               if (launchmode != 0)
>               {
>                 var Timeoutms = 1500;
>                 var SearchString = "performsearch('" + arrCmds[j - 1] + "','"
+ arrParams.join(" ") + "');";
>                 setTimeout( SearchString, Timeoutms * (j-1) );
>               }
>               else
>                 performsearch(arrCmds[j - 1], arrParams.join(" "));
>             }
>           }
>         }
>       }
>     }
>   ]]></script>
>
>   <copyright>
> Copyright (c) 2002 David Bau
> Distributed under the terms of the
> GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
>   </copyright>
> </search>
>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel

Reply via email to