diff options
Diffstat (limited to 'resources/mediawiki.page/mediawiki.page.watch.ajax.js')
-rw-r--r-- | resources/mediawiki.page/mediawiki.page.watch.ajax.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/resources/mediawiki.page/mediawiki.page.watch.ajax.js b/resources/mediawiki.page/mediawiki.page.watch.ajax.js index a7e059c4..f945fa9d 100644 --- a/resources/mediawiki.page/mediawiki.page.watch.ajax.js +++ b/resources/mediawiki.page/mediawiki.page.watch.ajax.js @@ -24,13 +24,14 @@ otherAction = action === 'watch' ? 'unwatch' : 'watch'; accesskeyTip = $link.attr( 'title' ).match( mw.util.tooltipAccessKeyRegexp ); $li = $link.closest( 'li' ); + /** * Trigger a 'watchpage' event for this List item. * Announce the otherAction value as the first param. * Used to monitor the state of watch link. * TODO: Revise when system wide hooks are implemented */ - if( state === undefined ) { + if ( state === undefined ) { $li.trigger( 'watchpage.mw', otherAction ); } @@ -96,7 +97,7 @@ // Expose local methods mw.page.watch = { - 'updateWatchLink': updateWatchLink + updateWatchLink: updateWatchLink }; $( document ).ready( function () { @@ -134,7 +135,9 @@ otherAction = action === 'watch' ? 'unwatch' : 'watch'; $li = $link.closest( 'li' ); - mw.notify( $.parseHTML( watchResponse.message ), { tag: 'watch-self' } ); + mw.notify( $.parseHTML( watchResponse.message ), { + tag: 'watch-self' + } ); // Set link to opposite updateWatchLink( $link, otherAction ); @@ -144,7 +147,7 @@ if ( watchResponse.watched !== undefined ) { $( '#wpWatchthis' ).prop( 'checked', true ); } else { - $( '#wpWatchthis' ).removeProp( 'checked' ); + $( '#wpWatchthis' ).prop( 'checked', false ); } }, // Error @@ -162,14 +165,14 @@ title: cleanTitle }, cleanTitle ); - msg = mw.messsage( 'watcherrortext', link ); + msg = mw.message( 'watcherrortext', link ); // Report to user about the error mw.notify( msg, { tag: 'watch-self' } ); } ); - }); - }); + } ); + } ); }( mediaWiki, jQuery ) ); |