r1570 - in branches/bxe_2_0: js mozile

[email protected] Tue, 24 Oct 2006 16:40:38 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Oct 24 16:40:36 2006
New Revision: 1570

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/mozile/mozilekb.js
Log:
fix further ctrl+x issues


Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Tue Oct 24 16:40:36 2006
@@ -2111,6 +2111,10 @@
 		bxe_catch_alert(e);
 	}
 }
+String.prototype.strip = function() {
+    var stripspace = /^\s*((\S+\s*\S+)*)\s*$/;
+    return stripspace.exec(this)[1];
+};
 
 String.prototype.convertToXML = function() {
 	var BX_parser = new DOMParser();

Modified: branches/bxe_2_0/mozile/mozilekb.js
==============================================================================
--- branches/bxe_2_0/mozile/mozilekb.js	(original)
+++ branches/bxe_2_0/mozile/mozilekb.js	Tue Oct 24 16:40:36 2006
@@ -153,7 +153,7 @@
 			return false;
 		}*/
 	}
-	else if(String.fromCharCode(event.charCode).toLowerCase() == "c")
+	else if(String.fromCharCode(event.charCode) == "c")
 	{
 		//don't handle it, if we're in a textarea
 		if (event.target.localName == "TEXTAREA") {
@@ -166,6 +166,13 @@
 			return false;
 		}*/
 	}
+	
+	else if(String.fromCharCode(event.charCode) == "C")
+	{
+	  var sel = window.getSelection();
+	  sel.collapse(document.body.firstChild, 0);
+	  return true;
+	}
 	else if(String.fromCharCode(event.charCode).toLowerCase() == "s")
 	{
 		eDOMEventCall("DocumentSave",document);
@@ -632,7 +639,7 @@
 		}
 		else if (!sel.isCollapsed && sel.anchorNode.nodeType == 3 && sel.anchorOffset == 0) {
 			
-			if (sel.anchorNode == sel.focusNode && sel.focusOffset == sel.anchorNode.length) {
+			if (sel.anchorNode == sel.focusNode && sel.focusOffset == sel.anchorNode.nodeValue.strip().length) {
 				
 				var xmlnode = bxe_getXMLNodeByHTMLNode(sel.anchorNode);
 				//xmlnode.parentNode.appendChild(xmlnode.ownerDocument.createTextNode(" "));
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs