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-serv5385/searches

Modified Files:
        curr.xml 
Log Message:
Fixed decimal handling bug found by Brent Beardsley; now 1.23 usd>cad works.

Index: curr.xml
===================================================================
RCS file: /cvsroot/dqsd/dqsd/searches/curr.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** curr.xml    27 Apr 2002 22:51:43 -0000      1.7
--- curr.xml    24 Jul 2002 07:47:35 -0000      1.8
***************
*** 4,14 ****
      Convert from one currency to another using the Universal Currency Converter.<br/>
      <div class="helpboxDescLabels">Usage:</div>
!       <table class="helpboxDescTable">
!               <tr><td>curr /from:&lt;<i>curr1</i>&gt; /to:&lt;<i>curr2</i>&gt; 
&lt;<i>amount</i>&gt;</td></tr>
!       </table>
      <div class="helpboxDescLabels">Example:</div>
      <table class="helpboxDescTable">
!               <tr><td>curr /from:usd /to:gbp 100</td></tr>
!       </table>
    </description>
    <category>Reference</category>
--- 4,14 ----
      Convert from one currency to another using the Universal Currency Converter.<br/>
      <div class="helpboxDescLabels">Usage:</div>
!   <table class="helpboxDescTable">
!   <tr><td>curr /from:&lt;<i>curr1</i>&gt; /to:&lt;<i>curr2</i>&gt; 
&lt;<i>amount</i>&gt;</td></tr>
!    </table>
      <div class="helpboxDescLabels">Example:</div>
      <table class="helpboxDescTable">
!   <tr><td>curr /from:usd /to:gbp 100</td></tr>
!   </table>
    </description>
    <category>Reference</category>
***************
*** 25,97 ****
    
    <script><![CDATA[
!       currency_regex = /(\d+)(\s*)([A-Za-z]{3})\s*([<>]|to)\s*([A-Za-z]{3})/i; 
!       
!       // the auto-detection routine used for special handling of strings entered 
into the
!       // toolbar that look like currency conversions.
!       function autodetect_currency(q)
!       {
!         // detect strings that look like ABC<CBA or ABC>CBA upper or lower case
!         var res = q.match(currency_regex);
!         if (res) 
!       {
!           curr2(q);
!           return true;
!         }
!       }
    
!       function curr2(q)
      {
!         if( nullArgs("curr", q) )
!               return false;
        else
!         {
!         // detect strings that look like ABC<CBA or ABC>CBA upper or lower case
!             var res = q.match(currency_regex);
!             if (res) 
!         {
!           if (res[4] == '<') 
!           {
!                 document.currf.From.value=res[5].toUpperCase();
!                 document.currf.To.value=res[3].toUpperCase();
!               }
!           else
!           {
!                 document.currf.From.value=res[3].toUpperCase();
!                 document.currf.To.value=res[5].toUpperCase();
!               }
!           document.currf.Amount.value=res[1];
!               submitForm(currf);
!         }
        }
      }
    
!       function curr(q)
!       {
!               if ( nullArgs("curr", q) )
!                       return false;
!   
!               else
!               {
!                       var func_name = "curr";
!                       var switch_list = new Array("from", "to");
!                       var args = parseArgs(q, switch_list);
    
!                       // check if the required switches are set
!                       for (var j = 0; j < switch_list.length; j++)
!                       {
!                               if ( typeof args.switch_val[ switch_list[j] ] == 
"undefined" || args.switch_val[ switch_list[j] ] == "" )
!                               {
!                                       alert(func_name + ":  /" + switch_list[j] + " 
switch must be entered.  Type '" + func_name + " ?' to see instructions");
!                                       return false;
!                               }
!                       }
    
!                       currf.Amount.value = args.q;
!                       currf.From.value = args.switch_val["from"].toUpperCase();
!                       currf.To.value = args.switch_val["to"].toUpperCase();
!                       submitForm(currf);
!                       return true;
!               }
      }
    ]]></script>
  </search>
--- 25,92 ----
    
    <script><![CDATA[
!   currency_regex = 
/^\s*(\.(\d+)|(\d+(\.\d*)?))(\s*)([A-Za-z]{3})\s*([<>]|to)\s*([A-Za-z]{3})\s*$/i; 
    
!   // the auto-detection routine used for special handling of strings entered into the
!   // toolbar that look like currency conversions.
!   function autodetect_currency(q)
!   {
!     // detect strings that look like ABC<CBA or ABC>CBA upper or lower case
!     var res = q.match(currency_regex);
!     if (res) 
      {
!       curr2(q);
!       return true;
!     }
!   }
!   
!   function curr2(q)
!   {
!     if( nullArgs("curr", q) )
!       return false;
! 
!     // detect strings that look like ABC<CBA or ABC>CBA upper or lower case
!     var res = q.match(currency_regex);
!     if (res) 
!     {
!       if (res[7] == '<') 
!       {
!         document.currf.From.value=res[8].toUpperCase();
!         document.currf.To.value=res[6].toUpperCase();
!       }
        else
!       {
!         document.currf.From.value=res[6].toUpperCase();
!         document.currf.To.value=res[8].toUpperCase();
        }
+       document.currf.Amount.value=res[1];
+       submitForm(currf);
      }
+   }
    
!   function curr(q)
!   {
!     if ( nullArgs("curr", q) )
!       return false;
    
!     var func_name = "curr";
!     var switch_list = new Array("from", "to");
!     var args = parseArgs(q, switch_list);
    
!     // check if the required switches are set
!     for (var j = 0; j < switch_list.length; j++)
!     {
!       if (typeof args.switch_val[switch_list[j]] == "undefined" || 
args.switch_val[switch_list[j]] == "")
!       {
!         alert(func_name + ":  /" + switch_list[j] + " switch must be entered.  Type 
'" + func_name + " ?' to see instructions");
!         return false;
!       }
      }
+   
+     currf.Amount.value = args.q;
+     currf.From.value = args.switch_val["from"].toUpperCase();
+     currf.To.value = args.switch_val["to"].toUpperCase();
+     submitForm(currf);
+     return true;
+   }
    ]]></script>
  </search>




-------------------------------------------------------
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