mw.Api: Replace deprecated token names by 'csrf'
[lhc/web/wiklou.git] / resources / src / mediawiki / api.js
index 3bc0ad3..b4ff40a 100644 (file)
@@ -52,7 +52,7 @@
        promises[ defaultOptions.ajax.url ] = {};
        $.each( mw.user.tokens.get(), function ( key, value ) {
                // This requires #getToken to use the same key as user.tokens.
-               // Format: token-type + "Token" (eg. editToken, patrolToken, watchToken).
+               // Format: token-type + "Token" (eg. csrfToken, patrolToken, watchToken).
                promises[ defaultOptions.ajax.url ][ key ] = $.Deferred()
                        .resolve( value )
                        .promise( { abort: function () {} } );
                 * If we have a cached token try using that, and if it fails, blank out the
                 * cached token and start over. For example to change an user option you could do:
                 *
-                *     new mw.Api().postWithToken( 'options', {
+                *     new mw.Api().postWithToken( 'csrf', {
                 *         action: 'options',
                 *         optionname: 'gender',
                 *         optionvalue: 'female'