Do not ignore our handlebars plugins in eslint

This commit is contained in:
Pavel Djundik 2016-05-12 16:07:15 +03:00
parent bbf7b8086f
commit 876ce4bc6e
6 changed files with 68 additions and 59 deletions

View File

@ -1,3 +1,7 @@
# built by tools
client/js/libs.min.js
client/js/libs/**/*.js
client/js/lounge.templates.js
# third party
client/js/libs/jquery/*.js
client/js/libs/*.js

View File

@ -2,7 +2,7 @@ var diff;
Handlebars.registerHelper(
"diff", function(a, opt) {
if (a != diff) {
if (a !== diff) {
diff = a;
return opt.fn(this);
} else {

View File

@ -2,7 +2,7 @@ Handlebars.registerHelper(
"equal", function(a, b, opt) {
a = a.toString();
b = b.toString();
if (a == b) {
if (a === b) {
return opt.fn(this);
} else {
return opt.inverse(this);

View File

@ -9,7 +9,7 @@ Handlebars.registerHelper(
);
function uri(text) {
return URI.withinString(text, function(url, start, end, source) {
return window.URI.withinString(text, function(url) {
if (url.indexOf("javascript:") === 0) {
return url;
}
@ -60,7 +60,7 @@ var styles = [
var escaped = encodeURI(style[1]).replace("%", "\\x");
return {
name: style[0],
style: style[2] != null ? style[2] : "irc-" + style[0],
style: style[2] ? style[2] : "irc-" + style[0],
key: style[1],
keyregex: new RegExp(escaped + "(.*?)(" + escaped + "|$)")
};
@ -73,7 +73,9 @@ function colors(line) {
// regexs are cruel to parse this thing
// already done?
if (!styleCheck_Re.test(line)) return line;
if (!styleCheck_Re.test(line)) {
return line;
}
// split up by the irc style break character ^O
if (line.indexOf(styleBreak) >= 0) {
@ -106,7 +108,10 @@ function colors(line) {
// Matching styles (italics/bold/underline)
// if only colours were this easy...
styles.forEach(function(style) {
if (result.indexOf(style.key) < 0) return;
if (result.indexOf(style.key) < 0) {
return;
}
result = result.replace(style.keyregex, function(match, text) {
return styleTemplate({
"style": style.style,

View File

@ -1,5 +1,5 @@
Handlebars.registerHelper(
"stringcolor", function(str) {
return stringcolor(str);
return window.stringcolor(str);
}
);

View File

@ -1,5 +1,5 @@
Handlebars.registerHelper(
"users", function(count) {
return count + " " + (count == 1 ? "user" : "users");
return count + " " + (count === 1 ? "user" : "users");
}
);