1document.addEventListener("DOMContentLoaded", function() { 2 f_getPosition = function (e, t) { 3 4 t = t.toLowerCase(); 5 6 return $(e).offset()[t]; 7 } 8 9 function walkTheDOM (node, func) { 10 func(node); 11 node = node.firstChild; 12 while (node) { 13 walkTheDOM(node, func); 14 node = node.nextSibling; 15 } 16 } 17 18 document.addEventListener('click', function(e) { 19 var $tCal = $('#tcal'); 20 if ($tCal.length && $tCal.is(':visible') && !$(e.target).closest('.popover-body', '#tcal').length) { 21 f_tcalHideAll(); 22 } 23 }) 24 25 function getElementsByClassName (className) { 26 var results = []; 27 walkTheDOM(document.body, function (node) { 28 var a, c = node.className, i; 29 if (c && typeof c == 'string') { 30 a = c.split(' '); 31 for (i=0; i<a.length; i++) { 32 if (a[i] === className) { 33 results.push(node); 34 break; 35 } 36 } 37 } 38 }); 39 return results; 40 } 41 42 function getLang() { 43 if (window.$ite !== undefined && window.$ite.hasParam('lang')) { 44 return window.$ite.getParam('lang'); 45 } 46 return window._s3Lang.code !== undefined ? window._s3Lang.code : 'ru'; 47 } 48 49 var i, j, id, e, inputs; 50 51 /* Simple calendars */ 52 for (i=0, inputs=getElementsByClassName('init-calendar-lp-content'); i<inputs.length; ++i) 53 new tcal({ 54 'controlname':inputs[i].id, 55 'place': inputs[i].parentNode, 56 'lang': getLang() 57 }); 58 59 /* Calendar intervals */ 60 for(i=0, inputs=getElementsByClassName('init-calendar-interval-lp-content'); i<inputs.length; ++i){ 61 id = inputs[i].id; 62 for(j=0; j<2; ++j){ 63 e = f_getElement(id + '['+j+']'); 64 new tcal({ 65 'controlname':e.id, 66 'place':e.parentNode, 67 'lang': getLang(), 68 'intervalpair':[ 69 id + '[0]', 70 id + '[1]' 71 ], 72 'intervalupdatecont' : id 73 }); 74 } 75 } 76});
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.