MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
Repo at 001f236: simplify IIFEs (#2074); apply autofixes 3 (#2079); apply autofixes 2 (#2069) |
Repo at e7d4c6c: fix some no-jquery/no-extend autofixes (#2088); create capitalized aliases for classes (#2086); fix linter error no-sequences (#2083); fix linter error jsdoc/no-undefined-types (#2082); fix linter error no-jquery/variable-pattern (#2081) |
||
Line 759:
data.inputs.forEach((subdata) => {
const cell = new Morebits.quickForm.element(Object.assign(subdata || {}, { type: '_dyninput_cell' }));
node.appendChild(cell.render());
});
Line 935:
*
* @memberof Morebits.quickForm.element
* @requires
* @param {HTMLElement} node - The HTML element beside which a tooltip is to be generated.
* @param {Object} data - Tooltip-related configuration data.
Line 1,638:
* @namespace Morebits.select2
* @memberof Morebits
* @requires
*/
Morebits.select2 = {
Line 1,702:
return;
}
let $target = $(ev.target).closest('.select2-container');
if (!$target.length) {
return;
}
$target = $target.prev();
$target.select2('open');
const search = $target.data('select2').dropdown.$search ||
$target.data('select2').selection.$search;
// Use DOM .focus() to work around a jQuery 3.6.0 regression (https://github.com/select2/select2/issues/5993)
search[0].focus();
Line 1,972:
// Probably can't be used for Julian->Gregorian changeovers, etc.
if (unitNorm === 'Week') {
unitNorm = 'Date'
num *= 7; }
this['set' + unitNorm](this['get' + unitNorm]() + num);
Line 2,348 ⟶ 2,349:
* @param {Object} callerAjaxParameters - Do not specify a parameter unless you really
* really want to give jQuery some extra parameters.
* @return {
*/
post: function(callerAjaxParameters) {
Line 5,148 ⟶ 5,149:
* @param {string} logText - Doesn't include leading `#` or `*`.
* @param {string} summaryText - Edit summary.
* @return {
*/
this.log = function(logText, summaryText) {
Line 5,424 ⟶ 5,425:
const thisCb = this;
if (event.shiftKey && lastCheckbox !== null) {
const $cbs = $(jQuerySelector, jQueryContext); // can't cache them, obviously, if we want to support
let index = -1, lastIndex = -1, i;
for (i = 0; i < $cbs.length; i++) {
if ($cbs[i] === thisCb) {
index = i;
if (lastIndex > -1) {
Line 5,433 ⟶ 5,434:
}
}
if ($cbs[i] === lastCheckbox) {
lastIndex = i;
if (index > -1) {
Line 5,454 ⟶ 5,455:
for (i = start; i <= finish; i++) {
if ($cbs[i].checked !== endState) {
$cbs[i].click();
}
}
Line 5,765 ⟶ 5,766:
* @memberof Morebits
* @class
* @requires
* @param {number} width
* @param {number} height - The maximum allowable height for the content area.
Line 6,078 ⟶ 6,079:
$('.morebits-dialog-buttons button').prop('disabled', !enabled);
};
// Create capital letter aliases for all Morebits @classes (functions that work with the `new` keyword), to follow the coding convention that classes should start with an uppercase letter. This will let us start fixing ESLint `new-cap` errors in other files.
Morebits.BatchOperation = Morebits.batchOperation;
Morebits.Date = Morebits.date;
Morebits.QuickForm = Morebits.quickForm;
Morebits.QuickForm.Element = Morebits.quickForm.element;
Morebits.SimpleWindow = Morebits.simpleWindow;
Morebits.Status = Morebits.status;
Morebits.TaskManager = Morebits.taskManager;
Morebits.Unbinder = Morebits.unbinder;
Morebits.UserspaceLogger = Morebits.userspaceLogger;
Morebits.wiki.Api = Morebits.wiki.api;
Morebits.wiki.Page = Morebits.wiki.page;
Morebits.wiki.Preview = Morebits.wiki.preview;
Morebits.wikitext.Page = Morebits.wikitext.page;
}());
|