Skip to content

Commit

Permalink
Put fixes suggested by JSLint
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Quiroz committed Jul 3, 2012
1 parent 0b59c9d commit 15af36b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
7 changes: 5 additions & 2 deletions chrass.js
@@ -1,6 +1,9 @@
//
// © Copyright 2012 Carlos Quiroz. All rights reserved.
// All trademarks and service marks are the properties of their respective owners.

"use strict";

//
// This script is called when the devtools are opened
// We first try to detect if the inspected page contains a css file
Expand Down Expand Up @@ -84,8 +87,8 @@ var pageFindSassInfo = function(element) {
if (typeof sassValues[rules[j].selectorText] !== 'undefined') {
var className = rules[j].selectorText;
// use only the file name, not the full path
var fileName = sassValues[className]['filename'].replace(/^.*[\\\/]/, '');
var linenum = sassValues[className]['linenum'];
var fileName = sassValues[className].filename.replace(/^.*[\\\/]/, '');
var linenum = sassValues[className].linenum;
// Get the debug info in the form of filename:linenum
var sassDebug = fileName + ':' + linenum;
copy[className] = sassDebug;
Expand Down
16 changes: 5 additions & 11 deletions sasscontent.js
@@ -1,6 +1,9 @@
// © Copyright 2012 Carlos Quiroz. All rights reserved.
// All trademarks and service marks are the properties of their respective owners.
//

"use strict";

function getSassDebugInfo() {
var sassDefinitions = {};
var allSheets = document.styleSheets;
Expand All @@ -22,14 +25,6 @@ function getSassDebugInfo() {
}
}
}
console.log(sassDefinitions);
var count = 0;
for (var k in sassDefinitions) {
if (sassDefinitions.hasOwnProperty(k)) {
++count;
}
}
console.log(count);
}
}
return sassDefinitions;
Expand All @@ -38,11 +33,10 @@ function getSassDebugInfo() {
// This is a trick needed to register the listener only once
// otherwise we end up with multiple registrations if the developer tools
// are open and closed many times
if (typeof listener == 'undefined') {
if (typeof sassListener == 'undefined') {
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
sendResponse(getSassDebugInfo());
});
}

var listener = true;

var sassListener = true;

0 comments on commit 15af36b

Please sign in to comment.