X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.page%2Fmediawiki.page.watch.ajax.js;h=d252f0e48088de4665535565345506fba47fc746;hb=ee734d0d3c7533bd9a690dbd71f5151da55c32ad;hp=15e9aba73d545cfe88aa767cdedde08e47fa0cb8;hpb=348a0bead146d133b3773e1b34bc30e524b6c1bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js b/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js index 15e9aba73d..a3197da367 100644 --- a/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js +++ b/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js @@ -6,7 +6,7 @@ */ ( function ( mw, $ ) { // The name of the page to watch or unwatch - var title = mw.config.get( 'wgRelevantPageName', mw.config.get( 'wgPageName' ) ); + var title = mw.config.get( 'wgRelevantPageName' ); /** * Update the link text, link href attribute and (if applicable) @@ -84,12 +84,12 @@ actionPaths = mw.config.get( 'wgActionPaths' ); for ( key in actionPaths ) { if ( actionPaths.hasOwnProperty( key ) ) { - parts = actionPaths[key].split( '$1' ); + parts = actionPaths[ key ].split( '$1' ); for ( i = 0; i < parts.length; i++ ) { - parts[i] = $.escapeRE( parts[i] ); + parts[ i ] = mw.RegExp.escape( parts[ i ] ); } m = new RegExp( parts.join( '(.+)' ) ).exec( url ); - if ( m && m[1] ) { + if ( m && m[ 1 ] ) { return key; } @@ -116,7 +116,7 @@ var action, api, $link; // Start preloading the notification module (normally loaded by mw.notify()) - mw.loader.load( ['mediawiki.notification'], null, true ); + mw.loader.load( 'mediawiki.notification' ); action = mwUriGetAction( this.href ); @@ -138,7 +138,7 @@ api = new mw.Api(); - api[action]( title ) + api[ action ]( title ) .done( function ( watchResponse ) { var otherAction = action === 'watch' ? 'unwatch' : 'watch'; @@ -170,7 +170,10 @@ msg = mw.message( 'watcherrortext', link ); // Report to user about the error - mw.notify( msg, { tag: 'watch-self' } ); + mw.notify( msg, { + tag: 'watch-self', + type: 'error' + } ); } ); } ); } );