2018-11-16 15:16:25 +00:00
|
|
|
( function ( M ) {
|
2017-07-12 15:12:40 +00:00
|
|
|
|
2018-11-30 23:26:22 +00:00
|
|
|
var Watchstar = M.require( 'mobile.startup' ).Watchstar,
|
2018-11-21 19:12:41 +00:00
|
|
|
user = mw.user;
|
2017-07-12 15:12:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggle the watch status of a known page
|
|
|
|
* @method
|
|
|
|
* @param {Page} page
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
function init( page ) {
|
|
|
|
var $container = $( '#ca-watch' );
|
|
|
|
if ( !page.inNamespace( 'special' ) ) {
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Watchstar( {
|
|
|
|
api: new mw.Api(),
|
|
|
|
el: $container,
|
|
|
|
isWatched: page.isWatched(),
|
|
|
|
page: page,
|
|
|
|
funnel: 'page',
|
|
|
|
isAnon: user.isAnon()
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
init( M.getCurrentPage() );
|
|
|
|
|
2018-11-16 15:16:25 +00:00
|
|
|
}( mw.mobileFrontend ) );
|