r1547 - branches/bxe_2_0/plugins

[email protected] Wed, 18 Oct 2006 13:53:42 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Wed Oct 18 13:53:41 2006
New Revision: 1547

Modified:
   branches/bxe_2_0/plugins/ClipboardPasteDialog.js
Log:
make dropdown via keyboard accessible

Modified: branches/bxe_2_0/plugins/ClipboardPasteDialog.js
==============================================================================
--- branches/bxe_2_0/plugins/ClipboardPasteDialog.js	(original)
+++ branches/bxe_2_0/plugins/ClipboardPasteDialog.js	Wed Oct 18 13:53:41 2006
@@ -68,8 +68,10 @@
 		if(!event.charCode)
 			return false;
 		
-		if(String.fromCharCode(event.charCode).toLowerCase() == "b")
-		{
+		var _char = String.fromCharCode(event.charCode); 
+		if (_char == "v") {
+			
+		} else if(_char == "b") {
 			event.stopPropagation();
 			event.returnValue = false;
 			event.preventDefault();
@@ -78,6 +80,22 @@
 			document.getElementById("__submit").click();
 			
 			return false;
+		} else {
+			var _e = document.getElementById("ModalBoxForm").element;
+			var _o = _e.options;
+			var _l = _o.length;
+			for (var i = 0; i < _l; i++) {
+				if (_o[i].text.substring(0,1).toLowerCase() == _char) {
+					_o[i].selected = true;
+					_e.selectedIndex = 2;
+					event.stopPropagation();
+					event.returnValue = false;
+					event.preventDefault();
+					
+					return false;
+				}
+			}
+			
 		}
 	}
 }
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs