1( function() { 2 'use strict'; 3 4 const MAX_DWELL = 86400; 5 6 function send( token ) { 7 let dwellSeconds = 0; 8 if ( window.performance && performance.now ) { 9 dwellSeconds = Math.round( performance.now() / 1000 ); 10 } 11 if ( dwellSeconds > MAX_DWELL ) { 12 dwellSeconds = MAX_DWELL; 13 } 14 15 const body = new FormData(); 16 body.append( 'action', 'llar_login_cache_check' ); 17 body.append( 'token', token ); 18 body.append( 'dwell', String( dwellSeconds ) ); 19 20 fetch( llarLoginCacheCheck.ajaxUrl, { 21 method: 'POST', 22 credentials: 'same-origin', 23 body: body 24 } ).catch( function() {} ); 25 } 26 27 function init() { 28 const probe = document.getElementById( 'llar-token' ); 29 if ( ! probe ) { 30 return; 31 } 32 const token = probe.getAttribute( 'data-llar-token' ); 33 const form = document.getElementById( 'loginform' ); 34 if ( ! token || ! form ) { 35 return; 36 } 37 38 let sent = false; 39 const fire = function() { 40 if ( sent ) { 41 return; 42 } 43 sent = true; 44 send( token ); 45 }; 46 47 const active = document.activeElement; 48 if ( active && form.contains( active ) ) { 49 fire(); 50 return; 51 } 52 form.addEventListener( 'focusin', fire, { once: true } ); 53 } 54 55 if ( document.readyState === 'loading' ) { 56 document.addEventListener( 'DOMContentLoaded', function() { init(); } ); 57 } else { 58 init(); 59 } 60} )();
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.