Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $( function() {
- var timeout = 10*1000; //*1000;
- if ( location.search.match(/(?:\?|&)(ve)?action=(edit|submit)/ ) ) {
- mw.loader.load( ['mediawiki.notify', 'mediawiki.api'] );
- var notifyFunc = function() {
- var $msg = $( '<div>Your session is about to expire</div><br>' )
- .append( $( '<br><a href="#">Renew session</a>' )
- .click( function(e) {
- var api = new mw.Api;api.get( { action: 'query' } );
- e.preventDefault();
- window.setTimeout( notifyFunc, timeout);
- } )
- );
- mw.notify( $msg, { 'autohide': false } );
- }
- window.setTimeout( notifyFunc, timeout );
- }
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement