MediaWiki:Gadget-morebits.js: Difference between revisions

Content deleted Content added
Repo at 4a07910: Add dark mode compatibility to Twinkle (#2023)
Repo at 257e210: Remove IE 11 compatibility code (#1900)
Line 2,126:
level = isNaN(level) ? 2 : level;
 
var header = '='.repeat(level);
var header = Array(level + 1).join('='); // String.prototype.repeat not supported in IE 11
var text = this.getUTCMonthName() + ' ' + this.getUTCFullYear();
 
Line 3,757:
* @returns {boolean}
*/
var fnCanUseMwUserToken = function(action = 'edit') {
action = typeof action !== 'undefined' ? action : 'edit'; // IE doesn't support default parameters
 
// If a watchlist expiry is set, we must always load the page
// to avoid overwriting indefinite protection. Of course, not
Line 5,743 ⟶ 5,741:
this.failureCallbackMap = new Map();
this.deferreds = new Map();
this.allDeferreds = []; // Hack: IE doesn't support Map.prototype.values
this.context = context || window;
 
Line 5,762 ⟶ 5,759:
var deferred = $.Deferred();
this.deferreds.set(func, deferred);
this.allDeferreds.push(deferred);
};
 
Line 5,793 ⟶ 5,789:
});
});
return $.when.apply(null, [...this.allDeferredsdeferreds.values()]); // resolved when everything is done!
};