MediaWiki:Gadget-bluealertdismiss.js

( function( $, mw ) { $alert = '  '; $alert += ' '; $alert += '  '; $alert += ' You have new talk page messages. '; $alert += ' '; $(document).ready(function { $( '.usermessage' ).hide; var newMsgRevisionId = mw.config.get( 'wgUserNewMsgRevisionId' ); if ( newMsgRevisionId ) { var userName = mw.config.get( 'wgUserName' ); var talkLink = '/wiki/User_talk:' + userName + '?redirect=no'; $( '#pt-mytalk' ).css( {'position': 'relative'} ); $( '#pt-mytalk' ).append( $alert ); var alertWdith = $( '#mw-echo-alert' ).outerWidth; var newLeft = 0 - ( alertWdith / 2 ) - 5; $( '#mw-echo-alert' ).css( { 'left': newLeft } ); $( '#mw-echo-close-box' ).click( function( e ) {			$( '#mw-echo-alert' ).hide;			$( '#mw-echo-blue-pokey' ).hide;			e.preventDefault;			e.stopPropagation;		} ); $( '#mw-echo-alert' ).click( function( e ) {			location.href = talkLink;			e.preventDefault;		} ); $( '#mw-echo-alert' ).hover( function {			$( '#mw-echo-alert' ).css( { 'background-color': '#3172da' } );			$( '#mw-echo-blue-pokey img' ).attr( 'src', '//upload.wikimedia.org/wikipedia/commons/9/9e/BluePokeyNorthHover.png' );		},		function {			$( '#mw-echo-alert' ).css( { 'background-color': '#517ABB' } );			$( '#mw-echo-blue-pokey img' ).attr( 'src', '//upload.wikimedia.org/wikipedia/commons/a/ae/BluePokeyNorth.png' );		} ); } } ); } )( jQuery, mediaWiki );