r1440 - trunk/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Jan  3 17:40:18 2006
New Revision: 1440

Modified:
   trunk/js/bxeConfig.js
   trunk/js/bxeFunctions.js
   trunk/js/widget.js
Log:
added new option
    
        <element name="a" ns="http://www.w3.org/1999/xhtml" blockLevelOnly="true"/>


Modified: trunk/js/bxeConfig.js
==============================================================================
--- trunk/js/bxeConfig.js	(original)
+++ trunk/js/bxeConfig.js	Tue Jan  3 17:40:18 2006
@@ -76,7 +76,7 @@
 		bxe_config.scriptfiles.push("plugins/" + ps[i] + ".js");
 	}
 	
-	var dSIC = bxe_config.doc.evaluate("/config/context[@type='dontShow']/element", bxe_config.doc, null, 0, null); 
+	var dSIC = bxe_config.doc.evaluate("/config/context[@type='dontShow']/element[not (@blockLevelOnly and @blockLevelOnly ='true')]", bxe_config.doc, null, 0, null); 
 	
 	bxe_config.dontShowInContext = new Array();
 	node = dSIC.iterateNext();
@@ -85,6 +85,17 @@
 		node = dSIC.iterateNext();
 	}
 	
+	var dSIC = bxe_config.doc.evaluate("/config/context[@type='dontShow']/element[@blockLevelOnly and @blockLevelOnly ='true']", bxe_config.doc, null, 0, null); 
+	
+	bxe_config.dontShowInContextBlock = new Array();
+	node = dSIC.iterateNext();
+	while (node) {
+		bxe_config.dontShowInContextBlock[node.getAttribute("ns")+":"+node.getAttribute("name")] = true;
+		node = dSIC.iterateNext();
+	}
+	
+	
+	
 	var dSIC = bxe_config.doc.evaluate("/config/context[@type='dontShow']/attribute", bxe_config.doc, null, 0, null); 
 	
 	bxe_config.dontShowInAttributeDialog = new Array();

Modified: trunk/js/bxeFunctions.js
==============================================================================
--- trunk/js/bxeFunctions.js	(original)
+++ trunk/js/bxeFunctions.js	Tue Jan  3 17:40:18 2006
@@ -1290,7 +1290,8 @@
 					var thisNamespaceURI = thisNode.namespaceURI;
 					
 					for (i = 0; i < ac.length; i++) {
-						if (!bxe_config.dontShowInContext[ac[i].namespaceURI + ":" +ac[i].localName] && ac[i].nodeType != 3 && ac[i].vdom.canHaveChildren)  {
+						var _name = ac[i].namespaceURI + ":" +ac[i].localName;
+						if (!bxe_config.dontShowInContext[_name]  && !bxe_config.dontShowInContextBlock[_name] && ac[i].nodeType != 3 && ac[i].vdom.canHaveChildren)  {
 							menuitem = bxe_format_list.appendItem(ac[i].nodeName, ac[i].localName + "=" + ac[i].namespaceURI);
 							if (ac[i].localName == thisLocalName &&  ac[i].namespaceURI == thisNamespaceURI) {
 								menuitem.selected=true;

Modified: trunk/js/widget.js
==============================================================================
--- trunk/js/widget.js	(original)
+++ trunk/js/widget.js	Tue Jan  3 17:40:18 2006
@@ -679,7 +679,8 @@
 	this.Popup.initTitle("Choose Subelement of " + node.localName);
 	ac.sort(bxe_nodeSort);
 	for (i = 0; i < ac.length; i++) {
-				if (!bxe_config.dontShowInContext[ac[i].namespaceURI + ":" +ac[i].localName] && ac[i].nodeType != 3 && ac[i].vdom.canHaveChildren ) {
+				var _name = ac[i].namespaceURI + ":" +ac[i].localName;
+				if (!bxe_config.dontShowInContext[_name] && ac[i].nodeType != 3 && ac[i].vdom.canHaveChildren ) {
 					var menui =this.Popup.addMenuItem( ac[i].nodeName, function(e) { 
 						var widget = e.currentTarget.Widget;
 						eDOMEventCall("appendChildNode",document,{"appendToNode": widget.AppendToNode, "localName":widget.InsertLocalName,"namespaceURI":widget.InsertNamespaceURI});
@@ -782,9 +783,14 @@
 	
 	ac.sort(nodeSort);
 	
+	var _display = node.XMLNode._node.getCStyle("display");
 	for (i = 0; i < ac.length; i++) {
-		if (!bxe_config.dontShowInContext[ac[i].namespaceURI + ":" +ac[i].localName] && ac[i].nodeType != 3 ) {
-				if (i == 0 || ac[i].vdom != ac[i-1].vdom) {
+		var _name = ac[i].namespaceURI + ":" +ac[i].localName;
+		if (!bxe_config.dontShowInContext[_name]  && ac[i].nodeType != 3 ) {
+			if (_display == "block" && bxe_config.dontShowInContextBlock[_name]) {
+				continue;
+			}
+			if (i == 0 || ac[i].vdom != ac[i-1].vdom) {
 				var menui = this.addMenuItem("Append " + ac[i].nodeName, function(e) { 
 					var widget = e.currentTarget.Widget;
 					eDOMEventCall("appendNode",document,{"appendToNode": widget.AppendToNode, "localName":widget.InsertLocalName,"namespaceURI":widget.InsertNamespaceURI})
@@ -794,7 +800,8 @@
 				menui.InsertNamespaceURI = ac[i].namespaceURI;
 				menui.AppendToNode = node.XMLNode;
 				}
-		}
+			}
+		
 		}
 }
 
-- 
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.