[Pkg-mozext-commits] [firexpath] 15/51: fixed a bug with the css selector generation code
David Prévot
taffit at moszumanska.debian.org
Sun Mar 22 15:08:51 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 eec49df9fdecf8b9b0084b39415b6f94f823aad4
Author: pierre.tholence at gmail.com <pierre.tholence at gmail.com@dfa30af4-1965-11df-8728-136f2c2ca76e>
Date: Sun Sep 19 14:06:53 2010 +0000
fixed a bug with the css selector generation code
git-svn-id: http://firepath.googlecode.com/svn/trunk@18 dfa30af4-1965-11df-8728-136f2c2ca76e
---
content/FirePathPanel.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/content/FirePathPanel.js b/content/FirePathPanel.js
index 986e527..3a41df4 100644
--- a/content/FirePathPanel.js
+++ b/content/FirePathPanel.js
@@ -1049,6 +1049,9 @@ FBL.getXPathFromNode = function(node, context) {
return result;
}
+const firepathClass = /\s*firepath-matching-node\s*/g;
+const multipleSpace = /\s+/g;
+
FBL.getCssSelectorFromNode = function (node, context) {
var result = '',
node,
@@ -1061,9 +1064,9 @@ FBL.getCssSelectorFromNode = function (node, context) {
if(node.id) {
str = '#' + node.id;
stop = true;
- } else if(node.className) {
- str = '.' + node.className.trim()
- .replace(/\s+/g, '').split(' ').join('.');
+ } else if(node.className && node.className.replace(firepathClass, '')) {
+ str = '.' + node.className.replace(firepathClass, ' ').trim()
+ .replace(multipleSpace, ' ').split(' ').join('.');
stop = true;
} else {
str = node.localName.toLowerCase();
--
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