MediaWiki:Gadget-bottomalert.js

( function( $, mw ) { $alert = ' '; $alert += '  '; $alert += ' You have new messages. (view changes) '; $alert += ' '; $(document).ready(function { $( '.usermessage' ).hide; // just in case var newMsgRevisionId = mw.config.get( 'wgUserNewMsgRevisionId' ); if ( newMsgRevisionId ) { var userName = mw.config.get( 'wgUserName' ); var talkLink = '/wiki/User_talk:' + userName + '?redirect=no'; var diffLink = '/w/index.php?title=User_talk:' + userName + '&oldid=' + newMsgRevisionId + '&diff=cur'; $( 'body' ).append( $alert ); // Add more padding at the bottom of the page $( 'div#footer' ).css( 'padding-bottom', '40px' ); $( '#mw-panel' ).css( 'padding-bottom', '40px' ); $( '#mw-echo-close-box' ).click( function( e ) {			$( '#mw-echo-sliding-alert' ).hide;			e.preventDefault;		} ); $( 'a#mw-echo-talk-link' ).attr( 'href', talkLink ); $( 'a#mw-echo-talk-diff-link' ).attr( 'href', diffLink ); // Show the alert $( '#mw-echo-sliding-alert' ).delay( 1000 ).animate( {'bottom': '+=39px' }, 'fast' ); } } ); } )( jQuery, mediaWiki );