Skip to content

Commit

Permalink
Parse the filename value to display only the filename and not the ful…
Browse files Browse the repository at this point in the history
…l path. Also the display on screen is simplified with a format filename:linenum
  • Loading branch information
Carlos Quiroz committed Jun 14, 2012
1 parent b723cd2 commit 08afb29
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chrass.js
Expand Up @@ -81,17 +81,18 @@ var pageFindSassInfo = function(element) {
__proto__: null
};
var rules = window.getMatchedCSSRules(data, '')
console.log('-- find matches for element ' + data + ' ------ ');
//console.log('-- find matches for element ' + data + ' ------ ');
for (var j = 0;j<rules.length;j++) {
if (typeof sassValues[rules[j].selectorText] != 'undefined') {
var className = rules[j].selectorText;
sass['file'] = sassValues[className]['filename'];
sass['linenum'] = sassValues[className]['linenum'];
console.log('sass match ' + sassValues[className]['linenum']);
copy[className] = sass;
var fileSynth = sassValues[className]['filename'].replace(/^.*[\\\/]/, '') + ':' + sassValues[className]['linenum'];
console.log('sass match ' + fileSynth);
copy[className] = fileSynth;
}
}
console.log('----------------------------------------------- ');
//console.log('----------------------------------------------- ');
/*for (var i = 0; i < props.length; ++i) {
if (props[i] === "className") {
// This is too limited, cannot assume that the elements in css
Expand Down

0 comments on commit 08afb29

Please sign in to comment.