Skip to content

Commit

Permalink
Removed debug log, fixed indent
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Jul 11, 2016
1 parent f5a707f commit ae03b12
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 64 deletions.
1 change: 0 additions & 1 deletion lenses/content_script.js
@@ -1,2 +1 @@
console.log('content script loaded')
document.body.style.backgroundColor="red";
4 changes: 1 addition & 3 deletions lenses/lens_achromatomaly.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#achromatomaly)";
document.body.style.webkitFilter = "url(#achromatomaly)";
document.body.style.webkitFilter = "url(#achromatomaly)";
4 changes: 1 addition & 3 deletions lenses/lens_achromatopsia.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#achromatopsia)";
document.body.style.webkitFilter = "url(#achromatopsia)";
document.body.style.webkitFilter = "url(#achromatopsia)";
1 change: 0 additions & 1 deletion lenses/lens_blue.js
@@ -1,2 +1 @@
console.log('content script loaded')
document.body.style.backgroundColor="blue";
4 changes: 1 addition & 3 deletions lenses/lens_deuteranomaly.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#deuteranomaly)";
document.body.style.webkitFilter = "url(#deuteranomaly)";
document.body.style.webkitFilter = "url(#deuteranomaly)";
4 changes: 1 addition & 3 deletions lenses/lens_deuteranopia.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#deuteranopia)";
document.body.style.webkitFilter = "url(#deuteranopia)";
document.body.style.webkitFilter = "url(#deuteranopia)";
4 changes: 1 addition & 3 deletions lenses/lens_empty.js
@@ -1,4 +1,2 @@
console.log('content script loaded')

document.body.style.filter = "";
document.body.style.webkitFilter = "";
document.body.style.webkitFilter = "";
2 changes: 0 additions & 2 deletions lenses/lens_fullblindness.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

delete document.body.style.filter;
delete document.body.style.webkitFilter;

Expand Down
2 changes: 0 additions & 2 deletions lenses/lens_partialblindness.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

document.body.style.filter = "blur(3px)";
document.body.style.webkitFilter = "blur(3px)";

Expand Down
2 changes: 0 additions & 2 deletions lenses/lens_partialblindness_medium.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

document.body.style.filter = "blur(2px)";
document.body.style.webkitFilter = "blur(2px)";

Expand Down
2 changes: 0 additions & 2 deletions lenses/lens_partialblindness_mild.js
@@ -1,4 +1,2 @@
console.log('content script loaded')

document.body.style.filter = "blur(1px)";
document.body.style.webkitFilter = "blur(1px)";
2 changes: 0 additions & 2 deletions lenses/lens_partialblindness_serious.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

document.body.style.filter = "blur(10px)";
document.body.style.webkitFilter = "blur(10px)";

Expand Down
4 changes: 1 addition & 3 deletions lenses/lens_protanomaly.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#protanomaly)";
document.body.style.webkitFilter = "url(#protanomaly)";
document.body.style.webkitFilter = "url(#protanomaly)";
2 changes: 0 additions & 2 deletions lenses/lens_protanopia.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand Down
1 change: 0 additions & 1 deletion lenses/lens_red.js
@@ -1,2 +1 @@
console.log('content script loaded')
document.body.style.backgroundColor="red";
4 changes: 1 addition & 3 deletions lenses/lens_tritanomaly.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#tritanomaly)";
document.body.style.webkitFilter = "url(#tritanomaly)";
document.body.style.webkitFilter = "url(#tritanomaly)";
4 changes: 1 addition & 3 deletions lenses/lens_tritanopia.js
@@ -1,5 +1,3 @@
console.log('content script loaded')

var iDiv = document.createElement('div');
iDiv.id = 'colorFilters';
iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" baseProfile="full"> ' +
Expand All @@ -10,4 +8,4 @@ iDiv.innerHTML = '<svg id="colorFilterSVG" version="1.1" xmlns="http://www.w3.or

document.body.appendChild(iDiv);
document.body.style.filter = "url(#tritanopia)";
document.body.style.webkitFilter = "url(#tritanopia)";
document.body.style.webkitFilter = "url(#tritanopia)";
10 changes: 5 additions & 5 deletions main.html
@@ -1,8 +1,8 @@
<!doctype html>
<html>
<head>
<script src="main.js"></script>
</head>
<body>
</body>
<head>
<script src="main.js"></script>
</head>
<body>
</body>
</html>
33 changes: 15 additions & 18 deletions main.js
Expand Up @@ -8,40 +8,37 @@ function log(...s) {
function createPanel() {
chrome.devtools.panels.create('ChromeLens', '', 'panel.html', function(panel) {
var _window;
log('Panel loaded', Date.now())
var backgroundPageConnection = chrome.runtime.connect();
backgroundPageConnection.onMessage.addListener(function (message) {
// Handle responses from the background page, if any
switch (message.type) {
case 'AXS_SHOW_RESULTS': {
const { idToWarningsMap } = message.data;
if (_window) {
_window.showAxsResults(idToWarningsMap);
}
break;
const { idToWarningsMap } = message.data;
if (_window) {
_window.showAxsResults(idToWarningsMap);
}
break;
}
case 'HIGHLIGHT_REPORT': {
const { warningId } = message.data;
if (_window) {
_window.highlightReportLine(warningId);
}
break;
const { warningId } = message.data;
if (_window) {
_window.highlightReportLine(warningId);
}
break;
}
case 'UNHIGHLIGHT_REPORT': {
const { warningId } = message.data;
if (_window) {
_window.unhighlightReportLine(warningId);
}
break;
const { warningId } = message.data;
if (_window) {
_window.unhighlightReportLine(warningId);
}
break;
}
}
});
panel.onShown.addListener(function(window) {
_window = window;
log('panel open')
});
panel.onHidden.addListener(function() {
log('panel hide')
});
})
}
Expand Down
2 changes: 0 additions & 2 deletions panel.js
Expand Up @@ -155,7 +155,6 @@ const addEventListeners = () => {
const { options, selectedIndex } = lensSelector;
const { value } = options[selectedIndex];
const lens = lensType[value.toUpperCase()];
log(lens);
return lens;
}
const setSelectedLens = () => lensEnabledCheckbox.checked ?
Expand Down Expand Up @@ -186,7 +185,6 @@ const addEventListeners = () => {
const pngTabPathButton = document.getElementById('pngTabPath');

traceTabPathButton.onclick = function() {
log('clicked')
chrome.runtime.sendMessage({
type: messageType.TRACE_TAB_PATH,
data: {
Expand Down

0 comments on commit ae03b12

Please sign in to comment.