Skip to content
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

simplify IIFEs #2074

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/twinklearv.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -980,6 +980,6 @@ Twinkle.arv.processAN3 = function(params) {
};

Twinkle.addInitCallback(Twinkle.arv, 'arv');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklebatchdelete.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -690,6 +690,6 @@ Twinkle.batchdelete.callbacks = {
};

Twinkle.addInitCallback(Twinkle.batchdelete, 'batchdelete');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklebatchprotect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -333,6 +333,6 @@ Twinkle.batchprotect.callbacks = {
};

Twinkle.addInitCallback(Twinkle.batchprotect, 'batchprotect');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklebatchundelete.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -204,6 +204,6 @@ Twinkle.batchundelete.callbacks = {
};

Twinkle.addInitCallback(Twinkle.batchundelete, 'batchundelete');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleblock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

let api = new mw.Api(), relevantUserName, blockedUserName;
const menuFormattedNamespaces = $.extend({}, mw.config.get('wgFormattedNamespaces'));
Expand Down Expand Up @@ -2039,6 +2039,6 @@ Twinkle.block.callback.main = function twinkleblockcallbackMain(pageobj) {
};

Twinkle.addInitCallback(Twinkle.block, 'block');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleconfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -1727,6 +1727,6 @@ Twinkle.config.saveSuccess = function twinkleconfigSaveSuccess(pageobj) {
};

Twinkle.addInitCallback(Twinkle.config.init);
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkledeprod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -184,6 +184,6 @@ var callback_commit = function(event) {
};

Twinkle.addInitCallback(Twinkle.deprod, 'deprod');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklediff.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -75,6 +75,6 @@ Twinkle.diff.callbacks = {
};

Twinkle.addInitCallback(Twinkle.diff, 'diff');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleimage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -355,6 +355,6 @@ Twinkle.image.callbacks = {
};

Twinkle.addInitCallback(Twinkle.image, 'image');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleprod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -472,6 +472,6 @@ Twinkle.prod.callback.evaluate = function twinkleprodCallbackEvaluate(e) {
};

Twinkle.addInitCallback(Twinkle.prod, 'prod');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleprotect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -1653,6 +1653,6 @@ Twinkle.protect.callbacks = {
};

Twinkle.addInitCallback(Twinkle.protect, 'protect');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklerollback.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -847,6 +847,6 @@ Twinkle.rollback.formatSummary = function(builtInString, userName, customString)
};

Twinkle.addInitCallback(Twinkle.rollback, 'rollback');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleshared.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -229,6 +229,6 @@ Twinkle.shared.callback.evaluate = function twinklesharedCallbackEvaluate(e) {
};

Twinkle.addInitCallback(Twinkle.shared, 'shared');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklespeedy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -1985,6 +1985,6 @@ Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUse
};

Twinkle.addInitCallback(Twinkle.speedy, 'speedy');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkletag.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -2184,5 +2184,5 @@ Twinkle.tag.callback.evaluate = function twinkletagCallbackEvaluate(e) {
};

Twinkle.addInitCallback(Twinkle.tag, 'tag');
}(jQuery));
}());
// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkletalkback.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -411,6 +411,6 @@ Twinkle.talkback.callbacks = {
}
};
Twinkle.addInitCallback(Twinkle.talkback, 'talkback');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinkleunlink.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -294,6 +294,6 @@ Twinkle.unlink.callbacks = {
};

Twinkle.addInitCallback(Twinkle.unlink, 'unlink');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklewarn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -2054,6 +2054,6 @@ Twinkle.warn.callback.evaluate = function twinklewarnCallbackEvaluate(e) {
};

Twinkle.addInitCallback(Twinkle.warn, 'warn');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklewelcome.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -748,6 +748,6 @@ Twinkle.welcome.callback.evaluate = function twinklewelcomeCallbackEvaluate(e) {
};

Twinkle.addInitCallback(Twinkle.welcome, 'welcome');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions modules/twinklexfd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <nowiki>

(function($) {
(function() {

/*
****************************************
Expand Down Expand Up @@ -2243,6 +2243,6 @@ Twinkle.xfd.callback.evaluate = function(e) {
};

Twinkle.addInitCallback(Twinkle.xfd, 'xfd');
}(jQuery));
}());

// </nowiki>
4 changes: 2 additions & 2 deletions morebits.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @namespace Morebits
*/

(function (window, document, $) { // Wrap entire file with anonymous function
(function() {

/** @lends Morebits */
const Morebits = {};
Expand Down Expand Up @@ -6075,7 +6075,7 @@ Morebits.simpleWindow.setButtonsEnabled = function(enabled) {
$('.morebits-dialog-buttons button').prop('disabled', !enabled);
};

}(window, document, jQuery)); // End wrap with anonymous function
}());

/**
* If this script is being executed outside a ResourceLoader context, we add some
Expand Down
4 changes: 2 additions & 2 deletions twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* global Morebits */

(function (window, document, $) { // Wrap with anonymous function
(function() {

// Check if account is experienced enough to use Twinkle
if (!Morebits.userIsInGroup('autoconfirmed') && !Morebits.userIsInGroup('confirmed')) {
Expand Down Expand Up @@ -484,6 +484,6 @@ Twinkle.generateBatchPageLinks = function (checkbox) {
$checkbox.next().prepend([link, ' ']);
};

}(window, document, jQuery)); // End wrap with anonymous function
}());

// </nowiki>
Loading