1function contactus_validate(element) 2{ 3 var inputs = element.getElementsByClassName("contactus-fields"), 4 errorMessages = element.getElementsByClassName("contactus-error-message"); 5 for ( var i = errorMessages.length; i > 0; i-- ) { 6 errorMessages[ i - 1].parentNode.removeChild( errorMessages[ i - 1] ); 7 } 8 var flag = true; 9 for (var i = 0; i < inputs.length; i++) { 10 if ((inputs[i].hasAttribute("required")) && (inputs[i].required == true) && (inputs[i].value.length == 0 || (inputs[i].type == "checkbox" && inputs[i].checked == false) || (inputs[i].type == "select" && inputs[i].selectedIndex == 0)) && (inputs[i].parentNode.style.display !== "none")) { 11 parent = inputs[i].parentNode; 12 parent.insertAdjacentHTML( "beforeend", "<div class='contactus-error-message'>" + 13 type_field + 14 "</div>" ); 15 flag = false; 16 } 17 } 18 return flag; 19} 20function joomly_analytics(mod_id){ 21 if (contactus_params[mod_id].yandex_metrika_id) 22 { 23 if (typeof Ya == "undefined"){ 24 ym(contactus_params[mod_id].yandex_metrika_id, 'reachGoal', contactus_params[mod_id].yandex_metrika_goal); 25 } else if (typeof Ya.Metrika !== "undefined"){ 26 var yaCounter= new Ya.Metrika(contactus_params[mod_id].yandex_metrika_id); 27 yaCounter.reachGoal(contactus_params[mod_id].yandex_metrika_goal); 28 } else if (typeof Ya.Metrika2 !== "undefined"){ 29 var yaCounter= new Ya.Metrika2(contactus_params[mod_id].yandex_metrika_id); 30 yaCounter.reachGoal(contactus_params[mod_id].yandex_metrika_goal); 31 } 32 } 33 if (contactus_params[mod_id].google_analytics_action) 34 { 35 if (typeof ga === 'function') { 36 ga('send', 'event', contactus_params[mod_id].google_analytics_category, contactus_params[mod_id].google_analytics_action, contactus_params[mod_id].google_analytics_label, contactus_params[mod_id].google_analytics_value); 37 } 38 if (typeof gtag === 'function') { 39 var gtag_object = {}; 40 if (contactus_params[mod_id].google_analytics_category){ 41 gtag_object.event_category = contactus_params[mod_id].google_analytics_category; 42 } 43 if (contactus_params[mod_id].google_analytics_label){ 44 gtag_object.event_label = contactus_params[mod_id].google_analytics_label; 45 } 46 if (contactus_params[mod_id].google_analytics_value){ 47 gtag_object.value = contactus_params[mod_id].google_analytics_value; 48 } 49 gtag('event', contactus_params[mod_id].google_analytics_action, gtag_object); 50 } 51 } 52} 53function contactus_uploader(mod_id){ 54 var input = document.getElementById("file-input" + mod_id); 55 var files = input.files; 56 uploads_counter[mod_id] += files.length; 57 var label = document.getElementById("file-label" + mod_id); 58 var parent = document.getElementById("file-contactus" + mod_id); 59 60 input.setAttribute("id", ""); 61 label.classList.add("contactus-added"); 62 63 new_input = document.createElement("input"); 64 new_input.setAttribute("type", "file"); 65 new_input.setAttribute("name", "file[]"); 66 new_input.setAttribute("multiple", "multiple"); 67 new_input.setAttribute("onchange", "contactus_uploader(" + mod_id + ")"); 68 new_input.setAttribute("class", "contactus-file"); 69 new_input.setAttribute("id", "file-input" + mod_id); 70 71 parent.appendChild(new_input); 72 73 if (uploads_counter[mod_id] > 1) 74 { 75 label.innerHTML = files_added + ": " + uploads_counter[mod_id]; 76 } else 77 { 78 label.innerHTML = input.files[0].name.substr(0,30); 79 } 80} 81function onloadContactusOld(){ 82 var captchas = document.getElementsByClassName("g-recaptcha"); 83 for (var i=0; i < captchas.length; i++) { 84 var sitekey = captchas[i].getAttribute("data-sitekey"); 85 var size= captchas[i].getAttribute("data-size"); 86 if ((captchas[i].innerHTML === "") && (sitekey.length !== 0)) 87 { 88 grecaptcha.render(captchas[i], { 89 'sitekey' : sitekey, 90 'theme' : 'light', 91 'size' : size 92 }); 93 } 94 }; 95} 96function onloadContactus() { 97 var tok = document.getElementsByName("module_token"); 98 grecaptcha.ready(function() { 99 grecaptcha.execute(tok[0].getAttribute("data-sitekey"), {action: 'feedback'}).then(function(token) { 100 for (var i=0; i < tok.length; i++) { 101 tok[i].value = token; 102 } 103 }); 104 }); 105}; 106function getCookie(name) { 107 var matches = document.cookie.match(new RegExp( 108 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 109 )); 110 return matches ? decodeURIComponent(matches[1]) : undefined; 111} 112function getSendingFlag(m_id){ 113 var sendingalert = getCookie("sending-alert"), 114 alerttype = getCookie("alert-type"), 115 sflag = 0; 116 if ((typeof sendingalert !== 'undefined') && (sendingalert == m_id)) 117 { 118 al = document.getElementById("contactus-sending-alert" + m_id); 119 if (alerttype == 'success') 120 { 121 sflag = 1; 122 } else if (alerttype == 'captcha') 123 { 124 sflag = 2; 125 al.childNodes[1].style.backgroundColor = "red"; 126 al.childNodes[3].childNodes[1].innerHTML = captcha_error; 127 } else if (alerttype == 'file') 128 { 129 sflag = 3; 130 al.childNodes[1].style.backgroundColor = "red"; 131 al.childNodes[3].childNodes[1].innerHTML = filesize_error; 132 } else if (alerttype == 'defense') 133 { 134 sflag = 4; 135 al.childNodes[1].style.backgroundColor = "red"; 136 al.childNodes[3].childNodes[1].innerHTML = defense_error; 137 } 138 document.cookie = 'sending-alert=333; Path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 139 document.cookie = 'alert-type=;Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 140 } else 141 { 142 sflag = 0; 143 } 144 return sflag; 145} 146function remove_alert(lightbox, dimmer) 147{ 148 if (lightbox.style.display != "none") 149 { 150 dimmer.parentNode.removeChild(dimmer); 151 lightbox.style.display = 'none'; 152 } 153} 154function set_dependencys(dependencys) 155{ 156 for(var key in dependencys) { 157 var fields = document.getElementsByClassName('field' + key); 158 for (var i=0; i < fields.length; i++) { 159 fields[i].onchange = function(){ 160 tag = this.tagName.toLowerCase(); 161 element = this; 162 tag = (tag == "input") ? this.type : tag; 163 if (tag == "select") 164 { 165 comparsion = this.selectedIndex; 166 } else if (tag == "checkbox") 167 { 168 comparsion = (this.checked) ? 1 : 0; 169 } else if (tag == "radio") { 170 comparsion = this.getAttribute('data-row'); 171 } else 172 { 173 comparsion = this.value; 174 }
175 dependencys[this.getAttribute('data-id')].forEach(function(entry) { 176 if (comparsion == entry.value) 177 { 178 element.parentNode.parentNode.parentNode.getElementsByClassName(entry.child)[0].parentNode.style.display= 'table'; 179 } else 180 { 181 element.parentNode.parentNode.parentNode.getElementsByClassName(entry.child)[0].parentNode.style.display= 'none'; 182 } 183 }); 184 } 185 fields[i].onchange(); 186 } 187 } 188} 189function submitForm() { 190 document.getElementById("contactusForm").submit(); 191} 192function joomlyHandleMask(event, mask) { 193 with (event) { 194 stopPropagation() 195 preventDefault() 196 if (!charCode) return 197 var c = String.fromCharCode(charCode) 198 if (c.match(/\D/)) return 199 with (target) { 200 var val = value.substring(0, selectionStart) + c + value.substr(selectionEnd) 201 var pos = selectionStart + 1 202 } 203 } 204 205 var nan = count(val, /\D/, pos) 206 val = val.replace(/\D/g,''); 207 208 var mask = mask.match(/^(\D*)(.+\d)(\D*)$/) 209 if (!mask) return 210 if (val.length > count(mask[2], /\d/)) return 211 212 for (var txt='', im=0, iv=0; im<mask[2].length && iv<val.length; im+=1) { 213 var c = mask[2].charAt(im) 214 txt += c.match(/\D/) ? c : val.charAt(iv++) 215 } 216 217 with (event.target) { 218 value = mask[1] + txt + mask[3] 219 selectionStart = selectionEnd = pos + (pos==1 ? mask[1].length : count(value, /\D/, pos) - nan) 220 } 221 222 function count(str, c, e) { 223 e = e || str.length 224 for (var n=0, i=0; i<e; i+=1) if (str.charAt(i).match(c)) n+=1 225 return n 226 } 227}
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.