mediawiki-extensions-Echo/modules/alert/ext.echo.alert.js
kaldari 383a81811d Adding new talk page message alert for logged in users
Includes new ext.echo.alert module and new preference

Change-Id: I7a4e78b033aa5e1ea18d1bfa2b6b0187930a6611
2013-05-14 10:39:49 -07:00

10 lines
416 B
JavaScript

( function( $, mw ) {
'use strict';
if ( mw.config.get( 'wgUserNewMsgRevisionId' ) && !mw.config.get( 'echoNewMsgAlertDisplayed' ) ) {
var alertMessage = mw.html.escape( mw.msg( 'colon-separator' ) + mw.msg( 'echo-new-messages' ) );
$( '#pt-mytalk a' ).append( alertMessage );
$( '#pt-mytalk a' ).addClass( 'mw-echo-alert' );
mw.config.set( 'echoNewMsgAlertDisplayed', true );
}
} )( jQuery, mediaWiki );