User:MarkAHershberger/common.js

//This is the Session Expiration Notification Timer $( function {   var timeout = 10*1000;    mw.loader.load( ['mediawiki.notification', 'mediawiki.api'] );    var notifyFunc = function {        var notifyObj;        var $msg = $( '   --- Attention ---  It has been a while since this page communicated with the server. If you have not yet saved, you should CLICK HERE to extend your session before attempting to save your work. ' )           .append( $( ' [ -- CLOSE -- ]' ) .click( function(e) {                         var api = new mw.Api;                         api.get( { action: 'query' } );                         e.preventDefault;                         notifyObj.close;                         window.setTimeout( notifyFunc, timeout);                     } ) );       notifyObj = mw.notification.notify( $msg, { 'autoHide': false } );    };    if ( location.search.match(/(?:\?|&)(ve)?action=(edit|submit)/ ) ) {         window.setTimeout( notifyFunc, timeout );    }    $( '#ca-ve-edit a' ).click( function  {  window.setTimeout( notifyFunc, timeout ); } ); } );