Merge "jsduck: Load OOjs and OOjs UI in eg-iframe.html"
[lhc/web/wiklou.git] / resources / src / mediawiki.messagePoster / mediawiki.messagePoster.MessagePoster.js
1 /*global OO*/
2 ( function ( mw ) {
3 /**
4 * This is the abstract base class for MessagePoster implementations.
5 *
6 * @abstract
7 * @class
8 *
9 * @constructor
10 * @param {mw.Title} title Title to post to
11 */
12 mw.messagePoster.MessagePoster = function MwMessagePoster() {};
13
14 OO.initClass( mw.messagePoster.MessagePoster );
15
16 /**
17 * Post a message (with subject and body) to a talk page.
18 *
19 * @abstract
20 * @param {string} subject Subject/topic title; plaintext only (no wikitext or HTML)
21 * @param {string} body Body, as wikitext. Signature code will automatically be added
22 * by MessagePosters that require one, unless the message already contains the string
23 * ~~~.
24 * @return {jQuery.Promise} Promise completing when the post succeeds or fails.
25 * For failure, will be rejected with three arguments:
26 *
27 * - primaryError - Primary error code. For a mw.Api failure,
28 * this should be 'api-fail'.
29 * - secondaryError - Secondary error code. For a mw.Api failure,
30 * this, should be mw.Api's code, e.g. 'http', 'ok-but-empty', or the error passed through
31 * from the server.
32 * - details - Further details about the error
33 *
34 * @localdoc
35 * The base class currently does nothing, but could be used for shared analytics or
36 * something.
37 */
38 mw.messagePoster.MessagePoster.prototype.post = function () {};
39 }( mediaWiki ) );