Skip to content

Commit

Permalink
Merge branch 'paazmaya-244-eslint-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
ironikart committed Nov 18, 2018
2 parents 58b833e + bd54a39 commit 0be3ec3
Show file tree
Hide file tree
Showing 25 changed files with 1,876 additions and 1,877 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"env": {
"browser": true,
"node": true
"node": false
},
"extends": "eslint:recommended",
"rules": {
Expand All @@ -17,7 +17,13 @@
"error",
"always"
],
"no-console": 0,
"no-undef": 0,
"no-unused-vars": [
"error", {
"args": "none"
}
],
"no-redeclare": 0
}
}
}
180 changes: 90 additions & 90 deletions Auditor/HTMLCSAuditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ _global.HTMLCSAuditor = new function()
}//end if

return false;
}
};

return label;
};
Expand Down Expand Up @@ -213,7 +213,7 @@ _global.HTMLCSAuditor = new function()
closeIcon.setAttribute('title', _global.HTMLCS.getTranslation("auditor_close"));
closeIcon.onmousedown = function() {
self.close.call(self);
}
};

header.appendChild(closeIcon);

Expand Down Expand Up @@ -511,7 +511,7 @@ _global.HTMLCSAuditor = new function()
useStandardSelect.onchange = function() {
_standard = this.options[this.selectedIndex].value;
self.run(_standard, _sources, _options);
}
};
}

var issueCountDiv = _doc.createElement('div');
Expand All @@ -531,7 +531,7 @@ _global.HTMLCSAuditor = new function()
error: _doc.getElementById(_prefix + 'include-error').checked,
warning: _doc.getElementById(_prefix + 'include-warning').checked,
notice: _doc.getElementById(_prefix + 'include-notice').checked
}
};

var wrapper = _doc.getElementById(_prefix + 'wrapper');
var newWrapper = self.build(_standard, _messages, _options);
Expand Down Expand Up @@ -560,7 +560,7 @@ _global.HTMLCSAuditor = new function()
error: true,
warning: true,
notice: false
}
};

if ((levels.error === 0) && (levels.warning === 0)) {
_options.show.notice = true;
Expand Down Expand Up @@ -671,20 +671,20 @@ _global.HTMLCSAuditor = new function()
var typeClass = '';

switch (message.type) {
case HTMLCS.ERROR:
typeText = 'Error';
case HTMLCS.ERROR:
typeText = 'Error';
break;

case HTMLCS.WARNING:
typeText = 'Warning';
case HTMLCS.WARNING:
typeText = 'Warning';
break;

case HTMLCS.NOTICE:
typeText = 'Notice';
case HTMLCS.NOTICE:
typeText = 'Notice';
break;

default:
// Not defined.
default:
// Not defined.
break;
}//end switch

Expand Down Expand Up @@ -732,7 +732,7 @@ _global.HTMLCSAuditor = new function()

var oldSummary = _doc.querySelectorAll('.HTMLCS-summary')[0];
oldSummary.style.display = 'none';
}
};

return msg;
};
Expand All @@ -750,7 +750,7 @@ _global.HTMLCSAuditor = new function()
if (_options.showIssueCallback) {
_options.showIssueCallback.call(this, id);
}
}
};

var buildMessageDetail = function(id, message, standard) {
if (standard === undefined) {
Expand All @@ -760,20 +760,20 @@ _global.HTMLCSAuditor = new function()
var typeText = '';

switch (message.type) {
case HTMLCS.ERROR:
typeText = 'Error';
case HTMLCS.ERROR:
typeText = 'Error';
break;

case HTMLCS.WARNING:
typeText = 'Warning';
case HTMLCS.WARNING:
typeText = 'Warning';
break;

case HTMLCS.NOTICE:
typeText = 'Notice';
case HTMLCS.NOTICE:
typeText = 'Notice';
break;

default:
// Not defined.
default:
// Not defined.
break;
}//end switch

Expand Down Expand Up @@ -1019,7 +1019,7 @@ _global.HTMLCSAuditor = new function()

var issueList = _doc.querySelectorAll('.HTMLCS-issue-list')[0];
issueList.style.marginLeft = ((_page - 1) * -300) + 'px';
}
};

next.onclick = function() {
if (_page < totalPages) {
Expand All @@ -1038,10 +1038,10 @@ _global.HTMLCSAuditor = new function()

var issueList = _doc.querySelectorAll('.HTMLCS-issue-list')[0];
issueList.style.marginLeft = ((_page - 1) * -300) + 'px';
}
};

return navDiv;
}
};

var pointToIssueElement = function(issue) {
var msg = _messages[Number(issue)];
Expand Down Expand Up @@ -1107,7 +1107,7 @@ _global.HTMLCSAuditor = new function()
script.onreadystatechange = null;
script.onload();
}
}
};

script.src = src;

Expand All @@ -1120,7 +1120,7 @@ _global.HTMLCSAuditor = new function()

this.setOption = function(name, value) {
_options[name] = value;
}
};

this.getIssue = function(issueNumber)
{
Expand All @@ -1138,16 +1138,16 @@ _global.HTMLCSAuditor = new function()

for (var i = 0; i < messages.length; i++) {
switch (messages[i].type) {
case HTMLCS.ERROR:
counts.error++;
case HTMLCS.ERROR:
counts.error++;
break;

case HTMLCS.WARNING:
counts.warning++;
case HTMLCS.WARNING:
counts.warning++;
break;

case HTMLCS.NOTICE:
counts.notice++;
case HTMLCS.NOTICE:
counts.notice++;
break;
}//end switch
}//end for
Expand All @@ -1169,28 +1169,28 @@ _global.HTMLCSAuditor = new function()
// Filter only the wanted error types.
var ignore = false;
switch (messages[i].type) {
case HTMLCS.ERROR:
if (_options.show.error === false) {
ignore = true;
} else {
errors++;
}
case HTMLCS.ERROR:
if (_options.show.error === false) {
ignore = true;
} else {
errors++;
}
break;

case HTMLCS.WARNING:
if (_options.show.warning === false) {
ignore = true;
} else {
warnings++;
}
case HTMLCS.WARNING:
if (_options.show.warning === false) {
ignore = true;
} else {
warnings++;
}
break;

case HTMLCS.NOTICE:
if (_options.show.notice === false) {
ignore = true;
} else {
notices++;
}
case HTMLCS.NOTICE:
if (_options.show.notice === false) {
ignore = true;
} else {
notices++;
}
break;
}//end switch

Expand Down Expand Up @@ -1322,7 +1322,7 @@ _global.HTMLCSAuditor = new function()
cssLink.href = _options.path + prefix + '.css';
head.appendChild(cssLink);
}
}
};

this.getStandardList = function() {
var pattern = /^HTMLCS_[^_]+$/;
Expand Down Expand Up @@ -1380,7 +1380,7 @@ _global.HTMLCSAuditor = new function()
var _doc = this.getParentElement();
if (_doc.ownerDocument) {
_doc = _doc.ownerDocument;
};
}

return _doc;
};
Expand Down Expand Up @@ -1434,7 +1434,7 @@ _global.HTMLCSAuditor = new function()

if (document.querySelectorAll('frameset').length === 0) {
source.push(document);
};
}

if (_top.frames.length > 0) {
for (var i = 0; i < _top.frames.length; i++) {
Expand Down Expand Up @@ -1608,7 +1608,7 @@ _global.HTMLCSAuditor = new function()
_doc.documentElement.querySelector('.HTMLCS-settings').appendChild(msgElementSource);

var msg = 'HTML_CodeSniffer has been updated to version ' + response.newVersion + '.';
msg += ' <a href="http://squizlabs.github.io/HTML_CodeSniffer/patches/' + response.newVersion + '">View the changelog</a>'
msg += ' <a href="http://squizlabs.github.io/HTML_CodeSniffer/patches/' + response.newVersion + '">View the changelog</a>';

msgElementSource.innerHTML = msg;
}//end if
Expand Down Expand Up @@ -2027,35 +2027,35 @@ _global.HTMLCSAuditor = new function()
var left = 0;
var bounceHeight = 20;
switch (direction) {
case 'up':
bounceHeight = (-bounceHeight);
top = rect.y2;
if ((rect.x2 - rect.x1) < 250) {
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
} else {
left = rect.x1;
}
case 'up':
bounceHeight = (-bounceHeight);
top = rect.y2;
if ((rect.x2 - rect.x1) < 250) {
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
} else {
left = rect.x1;
}
break;

case 'down':
default:
top = (rect.y1 - this.pointerDim.height);
if ((rect.x2 - rect.x1) < 250) {
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
} else {
left = rect.x1;
}
case 'down':
default:
top = (rect.y1 - this.pointerDim.height);
if ((rect.x2 - rect.x1) < 250) {
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
} else {
left = rect.x1;
}
break;

case 'left':
left = rect.x2;
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
case 'left':
left = rect.x2;
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
break;

case 'right':
bounceHeight = (-bounceHeight);
left = (rect.x1 - this.pointerDim.width);
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
case 'right':
bounceHeight = (-bounceHeight);
left = (rect.x1 - this.pointerDim.width);
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
break;

}//end switch
Expand Down Expand Up @@ -2111,18 +2111,18 @@ _global.HTMLCSAuditor = new function()
var maxBounce = 5;

switch (direction) {
case 'up':
currentDirection = direction + '-op';
initalPosOffset = dist;
case 'down':
style = 'top';
case 'up':
currentDirection = direction + '-op';
initalPosOffset = dist;
case 'down':
style = 'top';
break;

case 'left':
currentDirection = direction + '-op';
initalPosOffset = dist;
case 'right':
style = 'left';
case 'left':
currentDirection = direction + '-op';
initalPosOffset = dist;
case 'right':
style = 'left';
break;
}

Expand Down Expand Up @@ -2184,6 +2184,6 @@ _global.HTMLCSAuditor = new function()
}
}

}
};

};

0 comments on commit 0be3ec3

Please sign in to comment.