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

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

Modified Files:
        search.htm 
Log Message:
add function registerKeypressHook to support auto-complete

Index: search.htm
===================================================================
RCS file: /cvsroot/dqsd/dqsd/search.htm,v
retrieving revision 1.165
retrieving revision 1.166
diff -C2 -d -r1.165 -r1.166
*** search.htm  2 Dec 2002 22:54:42 -0000       1.165
--- search.htm  19 Dec 2002 01:54:46 -0000      1.166
***************
*** 153,156 ****
--- 153,165 ----
  <script type='text/jscript'>
  
+ // register key press hooks so addons, etc can handle keypresses
+ function registerKeypressHook( keypressHook )
+ {
+   if ( typeof keypressHooks == 'undefined' )
+     keypressHooks = new Array();
+     
+   keypressHooks.push( keypressHook );
+ }
+ 
  // def() called when the user hits "enter" in the textbox
  function def()
***************
*** 411,414 ****
--- 420,424 ----
    searchPrefix = ''; // reset the search command history search
  
+   var retval = false;
    switch(window.event.keyCode)
    {
***************
*** 493,501 ****
  
      default:
!       return true;
    }
  
!   // If we get here, we've come through a 'break' in the switch - so the key's been 
handled
!   return false;
  }
  
--- 503,521 ----
  
      default:
!       retval = true;
    }
  
!   if (retval == true && typeof keypressHooks != 'undefined') {
!     // process keypress hooks
!     for ( var i = 0; i < keypressHooks.length; i++ ) {
!       if (keypressHooks[i]( window.event ) == true) {
!         // keypress hook returns true if it handled the keypress
!         retval = false;
!         break;
!       }
!     }
!   }
! 
!   return retval;
  }
  




-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.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