MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
Amorymeltzer (talk | contribs) Repo at 3825f474: Update statusElement on successful lookupCreation; status: add extra class on actionCompleted message (#1343); fnApplyWatchlistExpiry to decide whether/when to apply a watchlistexpiry; Expand setWatchlist handling of expiry, default to infinity for watch/preferences; Allow adding/subtracting weeks as 7 days; taskManager: enable failure handling and setting context |
Amorymeltzer (talk | contribs) Repo at 582dbd50: Revert "Fixes after renaming of {{Rfd}} and Module:RfD"; fix typos |
||
Line 63:
* Converts an IPv6 address to the canonical form stored and used by MediaWiki.
* JavaScript translation of the {@link https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/8eb6ac3e84ea3312d391ca96c12c49e3ad0753bb/includes/utils/IP.php#131|`IP::sanitizeIP()`}
* function from the IPUtils library.
* normalized, and expanded to 8 words.
*
Line 77:
* Determines whether the current page is a redirect or soft redirect. Fails
* to detect soft redirects on edit, history, etc. pages. Will attempt to
* detect
*
* @returns {boolean}
*/
Morebits.isPageRedirect = function() {
return !!(mw.config.get('wgIsRedirect') || document.getElementById('softredirect') || $('.box-
};
Line 137:
if (namespaces.indexOf(number) !== -1) {
// Namespaces are completely agnostic as to case,
// and a regex string is more useful/
// so we accept any casing for any letter.
aliases.push(name.split('').map(function(char) {
Line 301:
Morebits.quickForm.element.prototype.compute = function QuickFormElementCompute(data, in_id) {
var node;
var
var label;
var id = (in_id ? in_id + '_' : '') + 'node_' + this.id;
Line 362:
}
}
break;
case 'option':
Line 560:
}
break;
case 'dyninput':
Line 695:
case 'submit':
node = document.createElement('span');
if (data.label) {
}
if (data.disabled) {
}
break;
case 'button':
node = document.createElement('span');
if (data.label) {
}
if (data.disabled) {
}
if (data.event) {
}
break;
Line 750:
subnode.value = data.value;
}
break;
default:
Line 756:
}
if (!
}
if (data.tooltip) {
Line 764:
if (data.extra) {
}
if (data.style) {
}
if (data.className) {
data.className;
}
return [ node,
};
Line 1,148:
* Converts an IPv6 address to the canonical form stored and used by MediaWiki.
* JavaScript translation of the {@link https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/8eb6ac3e84ea3312d391ca96c12c49e3ad0753bb/includes/utils/IP.php#131|`IP::sanitizeIP()`}
* function from the IPUtils library.
* normalized, and expanded to 8 words.
*
Line 1,213:
/**
* Check that an IP range is within the CIDR limits. Most likely to be useful
* in conjunction with `wgRelevantUserName`. CIDR limits are
* for IPv4 and /32 for IPv6.
*
Line 2,644:
* previous `load()` callbacks to recover from edit conflicts! In this
* case, callers must make the same edit to the new pageText and
*
* `setMaxConflictRetries(0)`.
*
Line 2,714:
}
// Set bot edit attribute. If this
if (ctx.botEdit) {
query.bot = true;
Line 3,104:
* 1. If there are no revisions among the first 50 that are
* non-redirects, or if there are less 50 revisions and all are
* redirects, the original creation is
* 2. Revisions that the user is not privileged to access
* (revdeled/suppressed) will be treated as non-redirects.
Line 3,922:
--Morebits.wiki.numberOfActionsLeft; // allow for normal completion if retry succeeds
// wait for sometime for client to regain
sleep(2000).then(function() {
ctx.saveApi.post(); // give it another go!
Line 4,775:
*/
removeLink: function(link_target) {
//
if (link_target.indexOf(':') === 0) {
link_target = link_target.slice(1);
Line 4,837:
unbinder.unbind('<!--', '-->');
// Check free image usages, for example as template arguments, might have the File: prefix excluded, but must be
// Will only eat the image name and the
var free_image_re = new RegExp('(\\|\\s*(?:[\\w\\s]+\\=)?\\s*(?:' + Morebits.namespaceRegex(6) + ':\\s*)?' + image_re_string + ')', 'mg');
unbinder.content = unbinder.content.replace(free_image_re, '<!-- ' + reason + '$1 -->');
Line 5,487:
/**
* To be called by worker before it terminates
*
* @param {(Morebits.wiki.page|Morebits.wiki.api|string)} arg -
|