r1314 - branches/bxe_2_0/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Wed May 25 12:05:19 2005
New Revision: 1314

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/js/bxeNodeElements.js
Log:
New "Clean" option

http://bugs.bitflux.ch/cgi-bin/bugzilla/show_bug.cgi?id=758


Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Wed May 25 12:05:19 2005
@@ -691,10 +691,18 @@
 		var par = delNode.parentNode
 		delNode.unlink();
 		bxe_Transform(false,false,par);
-		//_par.removeChild(delNode);
-//		_upNode.updateXMLNode();
+	},"Deletes the Element and all its children");
+	
+	popup.addMenuItem("Clean ", function (e) {
+		var widget = e.currentTarget.Widget;
+		var delNode = widget.MenuPopup.MainNode;
 		
-	});
+		bxe_history_snapshot();
+		
+		var par = delNode.parentNode;
+		delNode._node.removeElementOnly();
+		bxe_Transform(false,false,par);
+	}, "Removes the Element, but not its children");
 
 	if (node.previousSibling) {
 		popup.addMenuItem("Move up", function (e) {

Modified: branches/bxe_2_0/js/bxeNodeElements.js
==============================================================================
--- branches/bxe_2_0/js/bxeNodeElements.js	(original)
+++ branches/bxe_2_0/js/bxeNodeElements.js	Wed May 25 12:05:19 2005
@@ -203,6 +203,16 @@
 	
 }
 
+Element.prototype.removeElementOnly = function () {
+	var _child = this.firstChild
+	while (_child) {
+		var _oldChild = _child;
+		_child = _child.nextSibling;
+		this.parentNode.insertBefore(_oldChild,this);
+	}
+	this.parentNode.removeChild(this);
+}
+
 /**
  * Removes all children of an Element
  */ 
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.