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