1(function($) { 2 3 Drupal.behaviors.usersAccount = { 4 attach: function(context) { 5 6 // Po kliknuti na niektory z odkazov v paneli prihlasit alebo registrovat 7 // sa spusti detekcia prihlasenia. Aby sme zabranili tomu, ze detekcia bude prebiehat sucasne vo viacerych oknach, 8 // nastavime kazdemu oknu unikatny token a do cookies zapiseme jeho hodnotu. Detektor nasledne zisti, 9 // ci v prave otvorenom okne ma prebiehat ping na server prostrednictvom metody AJAX. 10 // Okno vykona dalsi ping iba v pripade, ze jeho meno je nastavene v cookie, 11 // alebo ak v cookie je ine meno, avsak jeho posledny ping prebehol davnejsie ako je span (okno bolo medzicasom zavrete). 12 // Pri kazdom pingu aktualizuje cas v cookie. 13 14 $('#visitor-login-or-register a').click(function() { 15 var uaOrSpan = 12000; 16 var uaOrToken = new Date().getTime(); // token musi byt cislo, vid nizsie 17 var uaOrInterval = window.setInterval(function() { 18 var uaOrMemoryToken = parseInt( $.cookieStorage('get', 'uaOrToken').join('') ); 19 var uaOrMemoryTime = parseInt( $.cookieStorage('get', 'uaOrTime').join('') ); 20 var uaOrTime = new Date().getTime(); // mikrosekundy 21 var uaOrTest = true; // uaOrMemoryToken == uaOrToken || isNaN(uaOrMemoryTime) || uaOrMemoryTime <= uaOrTime - (uaOrSpan*2); 22 if (uaOrTest) { 23 $.cookieStorage('insert', 'uaOrToken', uaOrToken); 24 $.cookieStorage('insert', 'uaOrTime', uaOrTime); 25 $.post(Drupal.settings.users_account.detectLoginPath, {}, function(response) { 26 if (response.status == true) { // uzivatel je prihlaseny 27 window.clearInterval( uaOrInterval ); 28 $('#visitor-login-or-register .panel-wrapper').hide(); 29 $('#visitor-login-or-register .response-wrapper').fadeIn(); 30 $('#visitor-login-or-register').each(function() { 31 var uaOrShow = $(this).attr('data-show'); 32 if (uaOrShow !== undefined && uaOrShow != '') { 33 $('' + uaOrShow).fadeIn(); 34 }; 35 }); 36 var uaOrWinZebra = 0; 37 var uaOrWinTitle = document.title; 38 var uaOrWinInterval = window.setInterval(function() { 39 document.title = uaOrWinZebra % 2 == 0 ? Drupal.t('Continue here') : uaOrWinTitle; 40 uaOrWinZebra++; 41 }, 1300); 42 } 43 }); 44 } 45 }, uaOrSpan); 46 }); 47 48 } 49 }; 50 51})(jQuery);
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.