MediaWiki:Gadget-morebits.js: Difference between revisions

Content deleted Content added
Repo at e2e8fad: Fix handling of circular redirect page load; Handle alternate capitalizations regardless of namespace; Morebits.namespaceRegex for matching all namespace capitalizations and aliases, use in morebits and modules
Repo at f9aea90: Update watchlist expiry handling for expiry return after T268834
Line 2,586:
}
 
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}
Line 3,083:
};
 
/**
/* * @returns {boolean|string} - Watched status of the page. */Boolean
* unless it's being watched temporarily, in which case returns the
* expiry string.
*/
this.getWatched = function () {
return ctx.watched;
Line 3,428 ⟶ 3,432:
action = typeof action !== 'undefined' ? action : 'edit'; // IE doesn't support default parameters
 
// If a watchlist expiry is set, alwayswe loadmust protectionalways statusload tothe avoidpage
// to avoid overwriting indefinite protection; see [[phab:T270057]] and [[phab:T268834]]
if (ctx.watchlistExpiry) {
return false;
Line 3,535 ⟶ 3,539:
 
ctx.contentModel = page.contentmodel;
ctx.watched = page.watchlistexpiry || page.watched;
 
// extract protection info, to alert admins when they are about to edit a protected page
Line 3,900 ⟶ 3,904:
 
token = response.tokens.csrftoken;
pageTitlevar page = response.pages[0].title;
pageTitle = page.title;
ctx.watched = responsepage.pages[0]watchlistexpiry || page.watched;
}
 
Line 3,917 ⟶ 3,922:
}
 
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}
Line 4,046 ⟶ 4,051:
 
token = response.tokens.csrftoken;
pageTitlevar page = response.pages[0].title;
pageTitle = page.title;
ctx.watched = responsepage.pages[0]watchlistexpiry || page.watched;
}
 
Line 4,062 ⟶ 4,068:
}
 
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}
Line 4,110 ⟶ 4,116:
 
token = response.tokens.csrftoken;
pageTitlevar page = response.pages[0].title;
pageTitle = page.title;
ctx.watched = responsepage.pages[0]watchlistexpiry || page.watched;
}
 
Line 4,126 ⟶ 4,133:
}
 
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}
Line 4,174 ⟶ 4,181:
 
var token = response.tokens.csrftoken;
var pageTitlepage = response.pages[0].title;
var pageTitle = page.title;
ctx.watched = responsepage.pages[0]watchlistexpiry || page.watched;
 
// Fetch existing protection levels
Line 4,260 ⟶ 4,268:
}
 
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}
Line 4,287 ⟶ 4,295:
 
token = response.tokens.csrftoken;
pageTitlevar page = response.pages[0].title;
pageTitle = page.title;
// ctx.watched = response.pages[0].watched; // Doesn't support watchlist expiry [[phab:T263336]]
// ctx.watched = page.watchlistexpiry || page.watched;
}
 
Line 4,304 ⟶ 4,314:
 
/* Doesn't support watchlist expiry [[phab:T263336]]
if (ctx.watchlistExpiry && !ctx.watched !== true) {
query.watchlistexpiry = ctx.watchlistExpiry;
}