-
Notifications
You must be signed in to change notification settings - Fork 319
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 JSHint fixes #458
Some JSHint fixes #458
Changes from 1 commit
ba7c0c0
dfb3dfc
207e147
2e9779d
a9668ad
59a68a0
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 |
---|---|---|
|
@@ -145,7 +145,7 @@ exports.home = function (aReq, aRes) { | |
pageMetadata(options, ['Flagged Scripts', 'Moderation']); | ||
} | ||
} | ||
}; | ||
} | ||
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. +1 here |
||
function render() { aRes.render('pages/scriptListPage', options); } | ||
function asyncComplete() { preRender(); render(); } | ||
async.parallel(tasks, asyncComplete); | ||
|
@@ -217,7 +217,7 @@ exports.register = function (aReq, aRes) { | |
var githubStrategy = _.findWhere(options.strategies, { strat: 'github' }); | ||
if (githubStrategy) | ||
githubStrategy.selected = true; | ||
}; | ||
} | ||
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. +1 here |
||
function render() { aRes.render('pages/loginPage', options); } | ||
function asyncComplete() { preRender(); render(); } | ||
async.parallel(tasks, asyncComplete); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ exports.list = function (aReq, aRes, aNext) { | |
|
||
// Script | ||
var script = options.script = modelParser.parseScript(scriptData); | ||
options.isOwner = authedUser && authedUser._id == script._authorId; | ||
options.isOwner = authedUser && authedUser._id === script._authorId; | ||
|
||
// Category | ||
var category = {}; | ||
|
@@ -167,7 +167,7 @@ exports.view = function (aReq, aRes, aNext) { | |
|
||
// Script | ||
var script = options.script = modelParser.parseScript(aScriptData); | ||
options.isOwner = authedUser && authedUser._id == script._authorId; | ||
options.isOwner = authedUser && authedUser._id === script._authorId; | ||
|
||
// Category | ||
var category = {}; | ||
|
@@ -185,8 +185,8 @@ exports.view = function (aReq, aRes, aNext) { | |
// Discussion | ||
var discussion = options.discussion = modelParser.parseDiscussion(aDiscussionData); | ||
modelParser.parseIssue(discussion); | ||
options.canClose = authedUser && (authedUser._id == script._authorId || authedUser._id == discussion._authorId); | ||
options.canOpen = authedUser && authedUser._id == script._authorId; | ||
options.canClose = authedUser && (authedUser._id === script._authorId || authedUser._id === discussion._authorId); | ||
options.canOpen = authedUser && authedUser._id === script._authorId; | ||
|
||
// commentListQuery | ||
var commentListQuery = Comment.find(); | ||
|
@@ -255,7 +255,7 @@ exports.open = function (aReq, aRes, aNext) { | |
function preRender() { | ||
// Page metadata | ||
pageMetadata(options, ['New Issue', script.name]); | ||
}; | ||
} | ||
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. +1 here |
||
function render() { aRes.render('pages/scriptNewIssuePage', options); } | ||
function asyncComplete() { preRender(); render(); } | ||
|
||
|
@@ -273,7 +273,7 @@ exports.open = function (aReq, aRes, aNext) { | |
|
||
// Script | ||
var script = options.script = modelParser.parseScript(aScriptData); | ||
options.isOwner = authedUser && authedUser._id == script._authorId; | ||
options.isOwner = authedUser && authedUser._id === script._authorId; | ||
|
||
// Category | ||
var category = {}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,6 @@ exports.getSource = function (aReq, aCallback) { | |
|
||
exports.sendScript = function (aReq, aRes, aNext) { | ||
var accept = aReq.headers.accept; | ||
var installName = null; | ||
|
||
if (0 !== aReq.url.indexOf('/libs/') && accept === 'text/x-userscript-meta') { | ||
return exports.sendMeta(aReq, aRes, aNext); | ||
|
@@ -234,7 +233,6 @@ exports.getMeta = function (aChunks, aCallback) { | |
// get the user script header. | ||
var str = ''; | ||
var i = 0; | ||
var len = aChunks.length; | ||
var header = null; | ||
|
||
for (; i < aChunks.length; ++i) { | ||
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. Just as a FYI I see an incomplete optimization from someone here which is why JSHint plucked line 237 out. |
||
|
@@ -270,7 +268,7 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) { | |
if (!scriptName) { return aCallback(null); } | ||
|
||
if (!isLibrary && aMeta.oujs && aMeta.oujs.author | ||
&& aMeta.oujs.author != aUser.name && aMeta.oujs.collaborator) { | ||
&& aMeta.oujs.author !== aUser.name && aMeta.oujs.collaborator) { | ||
collaborators = aMeta.oujs.collaborator; | ||
if ((typeof collaborators === 'string' | ||
&& collaborators === aUser.name) | ||
|
@@ -329,8 +327,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) { | |
} else { | ||
// Script already exists. | ||
if (!aScript.isLib) { | ||
if (collaborators && (aScript.meta.oujs && aScript.meta.oujs.author != aMeta.oujs.author | ||
|| (aScript.meta.oujs && JSON.stringify(aScript.meta.oujs.collaborator) != | ||
if (collaborators && (aScript.meta.oujs && aScript.meta.oujs.author !== aMeta.oujs.author | ||
|| (aScript.meta.oujs && JSON.stringify(aScript.meta.oujs.collaborator) !== | ||
JSON.stringify(aMeta.oujs.collaborator)))) { | ||
return aCallback(null); | ||
} | ||
|
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.
+1 here