r1519 - branches/bxe_2_0/mozile

[email protected] Mon, 2 Oct 2006 17:22:35 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Mon Oct  2 17:22:35 2006
New Revision: 1519

Modified:
   branches/bxe_2_0/mozile/mozWrappers.js
Log:
remember nice element name

Modified: branches/bxe_2_0/mozile/mozWrappers.js
==============================================================================
--- branches/bxe_2_0/mozile/mozWrappers.js	(original)
+++ branches/bxe_2_0/mozile/mozWrappers.js	Mon Oct  2 17:22:35 2006
@@ -246,6 +246,7 @@
  */
 MozClipboard.prototype.setData = function(data, dataFlavor)
 {
+	this._clipboardRootName = null;
 	if (typeof data == "string") {
 		data = document.createTextNode(data);
 		this._clipboard = data;
@@ -254,9 +255,17 @@
 	//copy the selection to the internal clipboard
 		if (data.nodeType == 11) { //DOCUMENT_FRAGEMENT
 			this._clipboard = data;
-			this._clipboardText = data.saveXML()
+			this._clipboardText = data.saveXML();
+			
 		} else {
 			this._clipboard = data.cloneContents();
+			try {
+			var _rootElement = data.startContainer.childNodes.item(data.startOffset);
+			
+				this._clipboardRootName = _rootElement.XMLNode.vdom.bxeName;
+			} catch (e) {
+					
+			}
 			var removeAttr = bxe_config.options['removeAttributeOnCopy'];
 			if (removeAttr) {
 				var res = this._clipboard.ownerDocument.evaluate(".//@"+removeAttr, this._clipboard.firstChild , null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs