-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some cleanup based on jshint #799
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
{ | ||
"browser": true, | ||
"devel": true, | ||
"curly": true, | ||
"funcscope": true, | ||
"noempty": true, | ||
"indent": true, | ||
"nonbsp": true, | ||
"strict": true, | ||
"undef": true, | ||
"unused": true, | ||
"globals": { | ||
"angular": false, | ||
"weeChat": false, | ||
"emojione": false, | ||
"MathJax": false, | ||
"renderMathInElement": false, | ||
"Zlib": false, | ||
"_": false, | ||
"Notification": false, | ||
"Favico": false | ||
"Favico": false, | ||
"Windows": false, | ||
"setElectronBadge": false | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,9 @@ weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) { | |
} | ||
} | ||
// recurse | ||
if (node === undefined || node === null) return; | ||
if (node === undefined || node === null) { | ||
return; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmpf I find that style cumbersome if the then-block fits on one line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's more cumbersome. But it's easier to maintain, and easier to stick to one style and follow it. Less chance of introducing bugs later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a strong preference, I just find it unnecessarily verbose and hard to read. But it assumes that everyone knows what they're doing so maybe it's best to not do it. Would |
||
node = node.firstChild; | ||
while (node) { | ||
var nextNode = null; | ||
|
@@ -200,8 +202,12 @@ weechat.filter('latexmath', function() { | |
|
||
weechat.filter('prefixlimit', function() { | ||
return function(input, chars) { | ||
if (isNaN(chars)) return input; | ||
if (chars <= 0) return ''; | ||
if (isNaN(chars)) { | ||
return input; | ||
} | ||
if (chars <= 0) { | ||
return ''; | ||
} | ||
if (input && input.length > chars) { | ||
input = input.substring(0, chars); | ||
return input + '+'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should fix that instead of removing it, I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but that doesn't have to be a part of this PR. And that code wouldn't be able to run anyway so I'm not changing anything really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true but at least we now know that there's an issue here :)