jenkins-bot has submitted this change and it was merged.
Change subject: Make JSHint pass
......................................................................
Make JSHint pass
Change-Id: Ib0830a765a331458084fc58d3cbaf3aaa4791ef3
---
M js/bookcreator.js
M js/check_load_from_localstorage.js
M js/collection.js
M js/suggest.js
4 files changed, 31 insertions(+), 24 deletions(-)
Approvals:
Arlolra: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/bookcreator.js b/js/bookcreator.js
index e0002e0..c8ede4d 100644
--- a/js/bookcreator.js
+++ b/js/bookcreator.js
@@ -49,7 +49,7 @@
'rsargs[]': args
}, function(result) {
var oldid = null;
- if (args.length == 3) {
+ if (args.length === 3) {
oldid = args[2];
}
refreshBookCreatorBox(hint, oldid);
@@ -97,7 +97,8 @@
if (!title){
return;
}
- link.attr('title', ''); // disable default browser tooltip
+ // Disable default browser tooltip
+ link.attr('title', '');
show_soon_timeout = setTimeout(function() {
get_data_xhr = $.post(script_url, {
'action': 'ajax',
@@ -105,12 +106,14 @@
'rsargs[]': [title]
}, function(result) {
visible = true;
- var img = $('<img />').attr({src: result.img,
alt: ''});
+ var img = $('<img>').attr({src: result.img,
alt: ''});
addremove_link
.text('\u00a0' + result.text)
.prepend(img)
.unbind('click')
- .click(function(e) {
addremove_article(result.action, result.title); });
+ .click(function() {
+
addremove_article(result.action, result.title);
+ });
popup_div
.css({left: mouse_pos.x + 2 + 'px',
top:
mouse_pos.y + 2 + 'px'})
@@ -166,22 +169,23 @@
setInterval(check_popup_hide, 300);
createDiv();
var prefix = mw.config.get('wgArticlePath').replace(/\$1/, '');
- $("#bodyContent " +
- "a[href^='" + prefix + "']" + // URL starts with prefix of
wgArticlePath
- ":not(a[href~='index.php'])" + // URL doesn't contain index.php
(simplification!)
- "[title!='']" + // title attribute is not empty
- "[rel!=nofollow]" +
- ":not(.external)" +
- ":not(.internal)" +
- ":not(.sortheader)" +
- ":not([accesskey])" +
- ":not(.nopopup)"
- ).each(function(i, link) {
+ $('#bodyContent ' +
+ 'a[href^="' + prefix + '"]' + // URL starts with prefix of
wgArticlePath
+ ':not(a[href~="index.php"])' + // URL doesn't contain index.php
(simplification!)
+ '[title!=""]' + // title attribute is not empty
+ '[rel!=nofollow]' +
+ ':not(.external)' +
+ ':not(.internal)' +
+ ':not(.sortheader)' +
+ ':not([accesskey])' +
+ ':not(.nopopup)'
+ ).each(function () {
if (this.onmousedown) {
return;
}
var $this = $(this);
- if (!$this.attr('title') || $this.attr('title').indexOf(':') !=
-1) { // title doesn't contain ":" (simplification!)
+ // title doesn't contain ":" (simplification!)
+ if (!$this.attr('title') || $this.attr('title').indexOf(':')
!== -1) {
return;
}
if ($this.parents('.nopopups').length) {
diff --git a/js/check_load_from_localstorage.js
b/js/check_load_from_localstorage.js
index c8c7b68..3822af3 100644
--- a/js/check_load_from_localstorage.js
+++ b/js/check_load_from_localstorage.js
@@ -1,3 +1,4 @@
+/*global confirm, collection_dialogtxt */
(function($) {
var script_url = mw.util.wikiScript();
@@ -21,7 +22,7 @@
'rs': 'wfAjaxPostCollection',
'rsargs[]': [JSON.stringify(c)]
}, function(result) {
- window.location.href =
result.redirect_url;
+ location.href = result.redirect_url;
}, 'json');
}
}
diff --git a/js/collection.js b/js/collection.js
index a2c7804..a81c557 100644
--- a/js/collection.js
+++ b/js/collection.js
@@ -19,6 +19,7 @@
* http://www.gnu.org/copyleft/gpl.html
*/
+/*global confirm, prompt, collection_id, writer, wfCollectionSave */
(function($) {
/******************************************************************************/
@@ -32,7 +33,7 @@
* @return String text of elment with ID id
*/
function gettext(sel, param/*=null*/) {
- var txt = jQuery(sel).html();
+ var txt = $(sel).html();
if (param) {
txt = txt.replace(/%PARAM%/g, param);
}
@@ -64,7 +65,7 @@
'rs': 'wfAjaxGetMWServeStatus',
'rsargs[]': [collection_id, writer]
}, function(result) {
- if (result.state == 'progress' ) {
+ if (result.state === 'progress' ) {
if ( result.status.progress ) {
$('#renderingProgress').html(
mw.language.convertNumber(
result.status.progress ) );
@@ -189,7 +190,7 @@
function make_sortable() {
$('#collectionList').sortable({
axis: 'y',
- update: function(evt, ui) {
+ update: function() {
set_sorting($('#collectionList').sortable('serialize'));
}
});
@@ -220,8 +221,8 @@
make_sortable();
$('#coll-orderbox
li.collection-partner.coll-more_info.collapsed').css(
'list-style' , 'url("' + collapseicon + '")');
- $('#coll-orderbox').on('click',
- 'li.collection-partner.coll-more_info
a.coll-partnerlink', function (e) {
+ $('#coll-orderbox').on('click',
+ 'li.collection-partner.coll-more_info
a.coll-partnerlink', function (event) {
event.preventDefault();
event.stopPropagation();
var p = $(this).parents('li.collection-partner');
@@ -245,7 +246,7 @@
$('#subtitleInput').change(set_titles);
$( '[id^="coll-input-setting-"]' ).change(set_titles);
}
- if (typeof collection_rendering != 'undefined') {
+ if (typeof collection_rendering !== 'undefined') {
getMWServeStatus();
}
});
diff --git a/js/suggest.js b/js/suggest.js
index 4571f33..67a480e 100644
--- a/js/suggest.js
+++ b/js/suggest.js
@@ -1,3 +1,4 @@
+/*global wfCollectionSave */
(function($) {
var script_url = mw.util.wikiScript();
@@ -18,7 +19,7 @@
'rsargs[]': args
}, function(result) {
wfCollectionSave(result.collection);
- if (func == 'undo') {
+ if (func === 'undo') {
set_status(false);
} else {
set_status(result.last_action);
--
To view, visit https://gerrit.wikimedia.org/r/197365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0830a765a331458084fc58d3cbaf3aaa4791ef3
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits