PageSourceSearch

https://dbsnet.dbs.si/HibisEb/jakarta.faces.resource/js/sessionTimer.js.xhtml?ln=sentinel-layout&v=0864003

js dbs.si collected 2026-10-01 13:15:10 UTC 4,535 bytes, 148 lines download raw bytes

1var loaded = new Date();
2var focused=null;
3
4function genCookie() {
5    loaded = Date();
6    loaded = Date.parse(loaded) / 1000;
7    try {
8        document.cookie = "TIMER_LD=" + loaded + "; secure; path=/";
9    } catch (err){
10    } 
11}
12
13function genCookieExp(dolzSeje) {
14    loaded = Date();
15    loaded = Date.parse(loaded) / 1000;
16    try {
17        document.cookie = "TIMER_LD=" + loaded + "; max-age=" + dolzSeje + "; secure; path=/";
18    } catch (err){
19    } 
20}
21
22genCookie();
23
24function getCookieData(c_name) {
25    var c_value = document.cookie;
26    var c_start = c_value.indexOf(" " + c_name + "=");
27    if (c_start == -1) {
28        c_start = c_value.indexOf(c_name + "=");
29    }
30    if (c_start == -1) {
31        c_value = null;
32    } else {
33        c_start = c_value.indexOf("=", c_start) + 1;
34        var c_end = c_value.indexOf(";", c_start);
35        if (c_end == -1) {
36            c_end = c_value.length;
37        }
38        c_value = unescape(c_value.substring(c_start, c_end));
39    }
40    return c_value;
41}
42
43function CountDown(dolzinaSeje, opozoriloOPoteku, newPage) {
44    var now = new Date();
45    now = Date.parse(now) / 1000;
46    var start = getCookieData('TIMER_LD');
47    var x_old;
48    var url;
49    
50    
51
52    if (newPage == 1) {
53        loaded = Date();
54        loaded = Date.parse(loaded) / 1000;
55        start = loaded;
56        newPage = 0;
57    } else { 
58        x_old = parseInt(document.getElementById('clock').innerText);
59    }
60    
61    if (isNaN(parseInt(start))) {
62        start = loaded;
63    }
64    
65    if (now - start > dolzinaSeje + 60 && opozoriloOPoteku == -1) {
66        genCookie();
67        start = loaded;
68    }
69        
70    var counts = dolzinaSeje;
71    delta = now - start;
72    var x = parseInt(counts - delta, 10);
73
74    if (delta < 0 || delta > dolzinaSeje + 5 || !isNaN(x_old) && (x_old - x) > 5) {
75        x = parseInt(document.getElementById('clock').innerText);
76        if (isNaN(x)) {
77            x = dolzinaSeje;
78        }
79        x--;
80        
81        if (document.getElementById('clockerr')) {
82            var st = parseInt(document.getElementById('clockerr').innerText);
83            if (isNaN(st)) {
84                st = 0;
85            }
86            document.getElementById('clockerr').innerHTML = ++st;
87        }
88    }
89    
90    if (document.getElementById('clock')) {
91        document.getElementById('clock').innerHTML = x;
92    }
93
94    if (document.getElementById('podSeja')) {
95       
96        if(jQuery('#podSeja').css('display') !== 'none'){
97            if(focused===null){
98                focused = document.activeElement; //save old focus
99            }
100            jQuery('#frm_notification\\:cbPodaljsajSejo').focus();
101         }
102        if (opozoriloOPoteku > 0 && (parseInt(x) - 2) <= opozoriloOPoteku && x !== null && x !== undefined) {
103            if (document.getElementById('podSejaSek')) {
104                if ((parseInt(x) - 2) >= 0) {
105                    document.getElementById('podSejaSek').innerHTML = (parseInt(x) - 2);
106                } else {
107                    document.getElementById('podSejaSek').innerHTML = 0;
108                }
109            }
110            PF('bar').show();              
111        } else {
112            document.getElementById('podSeja').style.display = 'none';
113        }
114    }
115
116    if (parseInt(x) > 0) {
117        timerID = setTimeout("CountDown("+dolzinaSeje+","+opozoriloOPoteku+",0)", 1000);
118    } else {
119
120        if (window.location.href.indexOf("/login/") == -1) {
121            url = "login/redirectLogout.xhtml?redirectUrl=/login/expired-redirect.xhtml&";
122        } else {
123            url = "redirectLogout.xhtml?redirectUrl=/login/expired-redirect.xhtml&";
124        }
125            
126        if (window.location.href.indexOf("/login/") == -1 && window.location.href.indexOf("/authorize?") == -1) {
127            location.href = url + "timeOut=1";
128        } else {
129            location.href = url + "loginTimeOut=1";
130        }
131    }    
132}
133    
134    
135function setFocusOnFieldAfterDialog() {
136    var inputs = document.getElementsByTagName("input");
137    for (i = 0 ; i < inputs.length ; i++) {
138        elementname = inputs[i].getAttribute("name");
139        if(elementname !== null && elementname !== undefined) {
140            if(elementname !== null && elementname.indexOf("ebaGesloInput") > 0){
141                document.getElementsByName(elementname)[0].focus();
142                return;
143            }
144      }
145    }
146}
147
148

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.