[Pkg-mozext-commits] [firexpath] 06/18: Issue 3 Make sure white spaces are displayed in text nodes.

David Prévot taffit at moszumanska.debian.org
Sat Mar 26 19:35:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag FirePath-0.9.5
in repository firexpath.

commit 3c407a66453c1700991b156659338f6687386c28
Author: pierre.tholence <pierre.tholence at gmail.com>
Date:   Sun Aug 8 16:20:55 2010 +0000

    Issue 3 Make sure white spaces are displayed in text nodes.
---
 content/XPathPanel.js | 47 +++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/content/XPathPanel.js b/content/XPathPanel.js
index 294babd..1702a23 100644
--- a/content/XPathPanel.js
+++ b/content/XPathPanel.js
@@ -722,21 +722,6 @@ Firebug.XPathPanel.Document = domplate(FirebugReps.Document,
 		)
 });
 
-FirebugReps.Element.filterFireXPathClass = function(attrs) {
-	for (var i=0; i<attrs.length; i++) {
-		var attr = attrs[i];
-		if(attr.localName == "class" && attr.nodeValue == "firexpath-matching-node") {
-			attrs.splice(i, 1);
-			break;
-		}
-	}
-	return attrs;
-}
-
-FirebugReps.Element.filterFireXPathClassValue = function(value) {
-	return value.replace(" firexpath-matching-node", "");
-},
-
 Firebug.XPathPanel.Element = domplate(FirebugReps.Element,
 {
 	tag:
@@ -758,10 +743,25 @@ Firebug.XPathPanel.Element = domplate(FirebugReps.Element,
 					">"
 				)
 			 )
-		)
+		),
+	filterFireXPathClassValue: 
+		function(value) {
+			return value.replace(" firexpath-matching-node", "");
+		},
+	filterFireXPathClass:
+		function(attrs) {
+			for (var i=0; i<attrs.length; i++) {
+				var attr = attrs[i];
+				if(attr.localName == "class" && attr.nodeValue == "firexpath-matching-node") {
+					attrs.splice(i, 1);
+					break;
+				}
+			}
+			return attrs;
+		}
 });
 
-Firebug.XPathPanel.TextElement = domplate(FirebugReps.Element,
+Firebug.XPathPanel.TextElement = domplate(Firebug.XPathPanel.Element,
 {
 	tag:
 		DIV({"class": "nodeBox textNodeBox repIgnore", _repObject: "$object"},
@@ -771,16 +771,19 @@ Firebug.XPathPanel.TextElement = domplate(FirebugReps.Element,
 					SPAN({"class": "nodeTag"}, "$object|getTagName"),
 					FOR("attr", "$object|attrIterator|filterFireXPathClass", Firebug.XPathPanel.Attr.tag),
 					SPAN({"class": "nodeBracket insertBefore"}, ">"),
-					SPAN({"class": "nodeText", _repObject: "$object.firstChild"}, "$object.firstChild.nodeValue"),
+					SPAN({"class": "nodeText", _repObject: "$object.firstChild"}, "$object.firstChild.nodeValue|unescapeWhitespace"),
 					"</",
 					SPAN({"class": "nodeTag"}, "$object|getTagName"),
 					">"
 				)
 			)
-		)
+		),
+	unescapeWhitespace: function(value) {
+		return value.replace(/ /gm, '\u00a0');
+	}
 });
 
-Firebug.XPathPanel.EmptyElement = domplate(FirebugReps.Element,
+Firebug.XPathPanel.EmptyElement = domplate(Firebug.XPathPanel.Element,
 {
 	tag:
 		DIV({"class": "nodeBox emptyNodeBox repIgnore", _repObject: "$object"},
@@ -795,11 +798,11 @@ Firebug.XPathPanel.EmptyElement = domplate(FirebugReps.Element,
 		)
 });
 
-Firebug.XPathPanel.TextNode = domplate(FirebugReps.Element,
+Firebug.XPathPanel.TextNode = domplate(Firebug.XPathPanel.TextElement,
 {
 	tag:
 		DIV({"class": "nodeBox", _repObject: "$object"},
-			SPAN({"class": "nodeText"}, "$object.nodeValue")
+			SPAN({"class": "nodeText"}, "$object.nodeValue|unescapeWhitespace")
 		)
 });
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firexpath.git



More information about the Pkg-mozext-commits mailing list