MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
MusikAnimal (talk | contribs) Repo at b92c23d: load RL modules required for previews |
MusikAnimal (talk | contribs) Repo at 49207b0: Revert "morebits.date: Don't import methods that collide with PageTriage (T268513)" (#1619); fix handling of hard errors (#1651) |
||
Line 2,139:
// Allow native Date.prototype methods to be used on Morebits.date objects
Object.getOwnPropertyNames(Date.prototype).forEach(function(func) {
};▼
▲ Morebits.date.prototype[func] = function() {
▲ return this._d[func].apply(this._d, Array.prototype.slice.call(arguments));
▲ }
});
Line 4,065 ⟶ 4,062:
// hard error, give up
} else {
var response = ctx.saveApi.getResponse();
var errorData = response.error || // bc error format
response.errors[0].data; // html/wikitext/plaintext error format
switch (errorCode) {
Line 4,074:
case 'abusefilter-disallowed':
ctx.statusElement.error('The edit was disallowed by the edit filter: "' +
break;
case 'abusefilter-warning':
ctx.statusElement.error([ 'A warning was returned by the edit filter: "',
// We should provide the user with a way to automatically retry the action if they so choose -
// I can't see how to do this without creating a UI dependency on Morebits.wiki.page though -- TTO
Line 4,085:
case 'spamblacklist':
// If multiple items are blacklisted, we only return the first
var spam =
ctx.statusElement.error('Could not save the page because the URL ' + spam + ' is on the spam blacklist');
break;
|