MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
Amorymeltzer (talk | contribs) Repo at 5174cbe: Add Morebits.status.status; Accept nochange option |
Amorymeltzer (talk | contribs) Repo at 97b8143: Minor jsdoc fixes and cleanup |
||
Line 52:
/** Hardcodes whether the user is a sysop, used a lot.
*
* @type {boolean}
*/
Line 1,584 ⟶ 1,583:
/* **************** Morebits.date **************** */
/**
* Create a date object with enhanced processing capabilities, a la
* {@link https://momentjs.com/|moment.js}. MediaWiki timestamp format is also
* acceptable, in addition to everything that JS Date() accepts.
*
Line 1,763 ⟶ 1,762:
/**
*
* Replacement syntax is a subset of that in moment.js:
*
Line 1,926 ⟶ 1,925:
/* **************** Morebits.wiki **************** */
/**
* Various objects for wiki editing and API access, including
* {@link Morebits.wiki.api} and {@link Morebits.wiki.page}.
*
* @namespace Morebits.wiki
Line 2,248 ⟶ 2,247:
};
var morebitsWikiApiUserAgent = 'morebits.js ([[w:WT:TW]])';▼
/**
*
* Note that doing so will set the useragent for every `Morebits.wiki.api`
* process performed thereafter.
*
* @see {@link https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2014-November/000075.html}
Line 2,256 ⟶ 2,257:
*
* @memberof Morebits.wiki.api
* @param {string} [ua=morebits.js ([[w:WT:TW]])] - User agent. The default▼
* value of `morebits.js ([[w:WT:TW]])` will be appended to any provided
* value.
▲var morebitsWikiApiUserAgent = 'morebits.js ([[w:WT:TW]])';
▲ * @param {string} [ua] - User agent.
*/
Morebits.wiki.api.setApiUserAgent = function(ua) {
Line 2,274 ⟶ 2,269:
/**
* Change/revision tag applied to Morebits actions when no other tags are specified.
*
*
* @constant
Line 2,849 ⟶ 2,844:
* - `false`|`'no'`|`'nochange'`: watchlist status of the page will not be changed.
* - `'default'`|`'preferences'`: watchlist status of the page will
* - `'unwatch'`: explicitly unwatch the page
* - {string|number}: watch page until the specified time (relative or absolute datestring)
Line 3,271 ⟶ 3,266:
* using {@link Morebits.wiki.api} is probably preferable.
*
* Will first check if the page is queued via
* {@link Morebits.wiki.page~fnProcessTriageList|fnProcessTriageList}.
*
* No error handling since we don't actually care about the errors.
Line 3,474 ⟶ 3,469:
/**
* When functions can't use
* {@link Morebits.wiki.page~fnCanUseMwUserToken|fnCanUseMwUserToken}
* or require checking protection or watched status, maintain the query
* in one place. Used for {@link Morebits.wiki.page#deletePage|delete},
* {@link Morebits.wiki.page#undeletePage|undelete},
Line 3,823 ⟶ 3,818:
/**
* Common checks for action methods. Used for move, undelete, delete,
* protect, stabilize.
*
* @param {string} action - The action being checked.
Line 4,983 ⟶ 4,978:
* @memberof Morebits.status
* @param {string} text - Before colon
* @param {string}
* @returns {Morebits.status} - `status`-type (blue)
*/
Line 4,992 ⟶ 4,987:
* @memberof Morebits.status
* @param {string} text - Before colon
* @param {string}
* @returns {Morebits.status} - `info`-type (green)
*/
Line 5,001 ⟶ 4,996:
* @memberof Morebits.status
* @param {string} text - Before colon
* @param {string}
* @returns {Morebits.status} - `warn`-type (red)
*/
Line 5,010 ⟶ 5,005:
* @memberof Morebits.status
* @param {string} text - Before colon
* @param {string}
* @returns {Morebits.status} - `error`-type (bold red)
*/
Line 5,149 ⟶ 5,144:
* `run(worker, postFinish)`: Runs the callback `worker` for each page in the
* list. The callback must call `workerSuccess` when succeeding, or
* `workerFailure` when failing. If using {@link Morebits.wiki.api} or
* {@link Morebits.wiki.page}, this is easily done by passing these two
* functions as parameters to the methods on those objects: for instance,
* `page.save(batchOp.workerSuccess, batchOp.workerFailure)`. Make sure the
* methods are called directly if special success/failure cases arise. If you
|