[Pkg-mozext-commits] [firexpath] 07/51: Issue 3 Make sure white spaces are displayed in text nodes.
David Prévot
taffit at moszumanska.debian.org
Sun Mar 22 15:08:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firexpath.
commit 87fffa3c43870af51b925a6b70ca0fb8364b96c2
Author: pierre.tholence at gmail.com <pierre.tholence at gmail.com@dfa30af4-1965-11df-8728-136f2c2ca76e>
Date: Sun Aug 8 16:20:55 2010 +0000
Issue 3 Make sure white spaces are displayed in text nodes.
git-svn-id: http://firepath.googlecode.com/svn/trunk@10 dfa30af4-1965-11df-8728-136f2c2ca76e
---
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