r1612 - branches/bxe_2_0/js

[email protected] Tue, 7 Nov 2006 18:03:45 +0100 (CET)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Nov  7 18:03:44 2006
New Revision: 1612

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/js/bxeXMLNode.js
   branches/bxe_2_0/js/widget.js
Log:
make undo/snapshots stuff more sensible

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Tue Nov  7 18:03:44 2006
@@ -127,11 +127,13 @@
 
 
 function bxe_history_snapshot() {
+
 	var xmlstr = bxe_getXmlDocument();
 	if (!xmlstr) { return false;}
 	bxe_snapshots_position++;
 	bxe_snapshots_last = bxe_snapshots_position;
 	bxe_snapshots[bxe_snapshots_position] = xmlstr;
+	
 	var i = bxe_snapshots_last + 1;
 	while (bxe_snapshots[i]) {
 		bxe_snapshots[i] = null;
@@ -145,6 +147,7 @@
 		}
 		bxe_snapshots = _temp;
 	}
+	
 	return (xmlstr);
 }
 
@@ -700,7 +703,6 @@
 			var widget = e.currentTarget.Widget;
 			var delNode = widget.MenuPopup.MainNode;
 			//delNode.unlink();
-			bxe_history_snapshot();
 			
 			var par = delNode.parentNode
 			try {
@@ -726,7 +728,6 @@
 			var widget = e.currentTarget.Widget;
 			var delNode = widget.MenuPopup.MainNode;
 			
-			bxe_history_snapshot();
 			
 			var par = delNode.parentNode;
 			try {
@@ -915,8 +916,6 @@
 
 function bxe_appendNode(e) {
 	var aNode = e.additionalInfo.appendToNode;
-	bxe_history_snapshot();
-	
 	if (e.additionalInfo.node) {
 		var newNode = e.additionalInfo.node;
 		if (newNode.nodeType == 11) {
@@ -957,7 +956,6 @@
 
 function bxe_appendChildNode(e) {
 		var aNode = e.additionalInfo.appendToNode;
-		bxe_history_snapshot();
 		var newNode = bxe_createXMLNode(e.additionalInfo.namespaceURI,e.additionalInfo.localName) ;
 		if (e.additionalInfo.atStart && aNode.firstChild) {
 			var _child = aNode.firstChild._node;

Modified: branches/bxe_2_0/js/bxeXMLNode.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLNode.js	(original)
+++ branches/bxe_2_0/js/bxeXMLNode.js	Tue Nov  7 18:03:44 2006
@@ -335,6 +335,7 @@
 				}
 				if (!_hasMust) {
 					bxe_context_menu.buildElementChooserPopup(this,ac);
+					
 				} else {
 					ret = this;
 					

Modified: branches/bxe_2_0/js/widget.js
==============================================================================
--- branches/bxe_2_0/js/widget.js	(original)
+++ branches/bxe_2_0/js/widget.js	Tue Nov  7 18:03:44 2006
@@ -767,7 +767,9 @@
 				if (ac[i].nodeType != 3 && !(ac[i].vdom.bxeDontshow) &&  !bxe_config.dontShowInContext[ac[i].namespaceURI + ":" +ac[i].localName] &&  ac[i].vdom.canHaveChildren ) {
 					var menui =this.Popup.addMenuItem( ac[i].vdom.bxeName, function(e) { 
 						var widget = e.currentTarget.Widget;
-						eDOMEventCall("appendChildNode",document,{"appendToNode": widget.AppendToNode, "localName":widget.InsertLocalName,"namespaceURI":widget.InsertNamespaceURI});
+						bxe_snapshots_position--;
+						bxe_snapshots_last = bxe_snapshots_position;
+						eDOMEventCall("appendChildNode",document,{ "appendToNode": widget.AppendToNode, "localName":widget.InsertLocalName,"namespaceURI":widget.InsertNamespaceURI});
 					});
 					menui.InsertLocalName = ac[i].localName;
 					menui.InsertNamespaceURI = ac[i].namespaceURI;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs