Merge "Drop zh-tw message "saveprefs""
[lhc/web/wiklou.git] / resources / src / mediawiki.page / mediawiki.page.watch.ajax.js
index 50f280a..a3197da 100644 (file)
                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] = mw.RegExp.escape( 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;
                                }
 
                        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 );
 
 
                        api = new mw.Api();
 
-                       api[action]( title )
+                       api[ action ]( title )
                                .done( function ( watchResponse ) {
                                        var otherAction = action === 'watch' ? 'unwatch' : 'watch';
 
                                        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'
+                                       } );
                                } );
                } );
        } );