r1504 - trunk/mozile

[email protected] Thu, 7 Sep 2006 15:49:52 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Sep  7 15:49:51 2006
New Revision: 1504

Modified:
   trunk/mozile/mozWrappers.js
Log:
fix copy of images

Modified: trunk/mozile/mozWrappers.js
==============================================================================
--- trunk/mozile/mozWrappers.js	(original)
+++ trunk/mozile/mozWrappers.js	Thu Sep  7 15:49:51 2006
@@ -252,9 +252,30 @@
 		this._clipboardText = data.data;
 	} else {
 	//copy the selection to the internal clipboard
-		this._clipboard = data.cloneContents();
+		var _c = data.cloneContents();
+		
+			var walker = document.createTreeWalker(
+			_c, NodeFilter.SHOW_ELEMENT,
+			null, 
+			true);
+		var node = _c;
+		
+		do {
+			var nextnode =   walker.nextNode()
+			if (node.nodeType == 1 && node.hasAttribute("_edom_internal_node")) {
+				if (node.localName == "img" && node.parentNode.localName == "span" && node.parentNode.getAttribute("class") == "img") {
+					var _parent = node.parentNode;
+					_parent.parentNode.insertBefore(node,_parent);
+					_parent.parentNode.removeChild(_parent);
+				} else {
+					node.parentNode.removeChild(node);
+				}
+			}
+			node =   nextnode;
+		} while(node)
+		this._clipboard = _c
 	//to allow easier comparing of system and internal clipboard, store the plaintext in this variable
-		this._clipboardText = data.toString();
+		this._clipboardText = _c.toString();
 	}
 	//if nativeSupport, add the content to the system clipboard
 	if (this.nativeSupport) {
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs