1mw.session = { 2 checkPause: false, 3 checkPauseExplicitly: false, 4 check: function (callback) { 5 if (!mw.session.checkPause) { 6 mw.session.checkPause = true; 7 if (mw.session.checkPauseExplicitly) { 8 return false; 9 } 10 $.post(mw.settings.api_url + "is_logged", function (data) { 11 if (data === null) { 12 return; 13 } 14 if (data !== false) { 15 if (typeof callback === 'function') { 16 callback.call(undefined, true); 17 } 18 19 } 20 else { 21 if (typeof callback === 'function') { 22 callback.call(undefined, false) 23 } 24 25 } 26 mw.session.checkPause = false; 27 }); 28 } 29 }, 30 logRequest: function () { 31 var modal = mw.dialog({ 32 html: "<h3 style='margin:0;'>" + mw.msg.session_expired + ".</h3> <p style='margin:0;'>" + mw.msg.login_to_continue + ".</p> <br> <div id='session_popup_login'></div>", 33 id: "session_modal", 34 name: "session_modal", 35 overlay: true, 36 width: 400, 37 height: 300, 38 template: 'mw_modal_basic', 39 callback: function () { 40 mw.load_module("users/login", '#session_popup_login', false, {template: 'popup'}); 41 } 42 }); 43 }, 44 checkInit: function () { 45 if (self !== top) { 46 return false; 47 } 48 setInterval(function () { 49 mw.session.check(function (is_logged) { 50 if (is_logged) { 51 var m = mw.dialog.get("#session_modal"); 52 if (m) { 53 m.remove(); 54 } 55 } 56 else { 57 mw.session.logRequest(); 58 } 59 }); 60 }, 300000); // 5 minutes 61 } 62} 63$(document).ready(function () { 64 65 mw.$(document).on("ajaxSend",function () { 66 67 mw.session.checkPause = true; 68 }).bind("ajaxComplete", function () { 69 mw.session.checkPause = false; 70 }); 71});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.