View the DQSD CVS repository here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Update of /cvsroot/dqsd/dqsd/searches
In directory usw-pr-cvs1:/tmp/cvs-serv13528/searches

Modified Files:
        multi.xml 
Log Message:
multi.xml - apostrophes (') in the query now don't generate errors

Index: multi.xml
===================================================================
RCS file: /cvsroot/dqsd/dqsd/searches/multi.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** multi.xml   27 Apr 2002 22:51:43 -0000      1.5
--- multi.xml   24 Jul 2002 10:27:51 -0000      1.6
***************
*** 4,14 ****
      Perform multiple searches with a single command line expression.<br/>
      <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></tr>
!       </table>
    </description>
    <category>Search the Web</category>
--- 4,14 ----
      Perform multiple searches with a single command line expression.<br/>
      <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></tr>
!     </table>
    </description>
    <category>Search the Web</category>
***************
*** 16,78 ****
    
    <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
--- 16,78 ----
    
    <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
***************
*** 101,108 ****
            // can be commands either.  The following variable keeps track of this.
            var fLoopBool = 1;
  
            for ( var i = 1; i <= result.length; i++ )
            {
!             var strCommandName = multiIsCommand(result[i - 1]);
              if (strCommandName != false && fLoopBool == 1)
              {
--- 101,109 ----
            // 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)
              {
***************
*** 116,120 ****
  
                // Append the parameter string with this word
!               arrParams.push(result[i - 1]);
              }
            }
--- 117,121 ----
  
                // Append the parameter string with this word
!               arrParams.push(result[i - 1].replace("\x27","\\x27"));
              }
            }
***************
*** 133,137 ****
                if (launchmode != 0)
                {
!                 var Timeoutms = 1500
                  var SearchString = "performsearch('" + arrCmds[j - 1] + "','" + 
arrParams.join(" ") + "');";
                  setTimeout( SearchString, Timeoutms * (j-1) );
--- 134,138 ----
                if (launchmode != 0)
                {
!                 var Timeoutms = 1500;
                  var SearchString = "performsearch('" + arrCmds[j - 1] + "','" + 
arrParams.join(" ") + "');";
                  setTimeout( SearchString, Timeoutms * (j-1) );




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DQSD-CVS mailing list
https://lists.sourceforge.net/lists/listinfo/dqsd-cvs
DQSD CVS repository:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dqsd/

Reply via email to