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

Update of /cvsroot/dqsd/dqsd/searches
In directory sc8-pr-cvs1:/tmp/cvs-serv29897/searches

Modified Files:
        alarm.xml 
Log Message:
alarm : bugs fixed / "minutes from now" option

Index: alarm.xml
===================================================================
RCS file: /cvsroot/dqsd/dqsd/searches/alarm.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** alarm.xml   14 Dec 2002 05:47:16 -0000      1.9
--- alarm.xml   13 Jun 2003 21:49:07 -0000      1.10
***************
*** 15,18 ****
--- 15,19 ----
    <category>Functions</category>
    <contributor>Monty Scroggins</contributor>
+   <contributor>Ben Williams ([EMAIL PROTECTED])</contributor>
    
    <script><![CDATA[
***************
*** 29,42 ****
          return false;
          
!       if( t.match(/^cancel *$/i) ) 
        {
          clearInterval(alNum);
!         setSearchWindowText("Alarm Canceled..");
          setTimeout("document.deff.q.value='';",1000);
        }
!       else if( parsedLine = t.match(/(\d\d\:\d\d)\s*(.*)/) ) 
        {
!         if( parsedLine[1] != null && parsedLine[1].length != 0) 
!           alarmTime = parsedLine[1];
            
          parsedMsg = parsedLine[2];
--- 30,51 ----
          return false;
          
!       if( t.match(/^cancel.*$/i) ) 
        {
          clearInterval(alNum);
!         setSearchWindowText("Alarm Canceled.");
          setTimeout("document.deff.q.value='';",1000);
        }
!       else if( parsedLine = t.match(/(\d\d\:\d\d)\s+(.*)/) ) 
        {
!               if( parsedLine[1] != null && parsedLine[1].length != 0) { 
!                 if(parsedTime = parsedLine[1].match(/(\d\d):(\d\d)/)) {
!                       alarmTimeHours = parsedTime[1];
!                       alarmTimeMins = parsedTime[2];
! 
!                       if(alarmTimeHours > 23) alarmTimeHours = 23;
!                       if(alarmTimeMins > 59) alarmTimeMins = 59;
!                       alarmTime = alarmTimeHours+":"+alarmTimeMins;
!                 }
!               }
            
          parsedMsg = parsedLine[2];
***************
*** 47,56 ****
            
          alarmOn();
!         setSearchWindowText("Alarm Set..");
!         setTimeout("document.deff.q.value='';",1000);
        }
        else 
!       {
!         window.alert("Bad Timestamp Entered. Should be HH:MM in Military Time");
          return;
        }
--- 56,85 ----
            
          alarmOn();
!               setSearchWindowText("Alarm Set for "+alarmTime+".");
!               setTimeout("document.deff.q.value='';",1000);
        }
+         else if( parsedLine = t.match(/^(\d+)\s+(.*)$/) )
+         {
+         if( parsedLine[1] != null && parsedLine[1].length != 0) {
+                 var dt = new Date();
+                 minutesToAdd = parsedLine[1];
+                 alarmTimeMs = Date.parse(dt.toString()) + (minutesToAdd * 60000);
+                 alarmTimeDate = dt.setTime(alarmTimeMs);
+                 alarmTime = IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes());
+               }
+               
+         parsedMsg = parsedLine[2];
+         alarmMsg =  'Alarm: ' + alarmTime + '\n\nAlarm has Expired';
+           
+         if(parsedMsg != null && parsedMsg.length != 0 )
+           alarmMsg = 'Alarm: ' + alarmTime + '\n\n' + parsedMsg;
+           
+         alarmOn();
+               setSearchWindowText("Alarm Set for "+alarmTime+".");
+         setTimeout("document.deff.q.value='';",1000);
+         }
        else 
!         {
!               window.alert("Sorry, the timestamp you entered for the alarm could not 
be read.\n\nThe format should be HH:MM in 24-hour time, or the number of minutes from 
now for the alarm to go off.");
          return;
        }




-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
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