1function ckplcySetCookie(cname,cvalue,exdays) { 2 var d = new Date(); 3 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 4 var expires = "expires=" + d.toGMTString(); 5 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 6} 7function ckplcyGetCookie(cname) { 8 var name = cname + "="; 9 var decodedCookie = decodeURIComponent(document.cookie); 10 var ca = decodedCookie.split(';'); 11 for(var i = 0; i < ca.length; i++) { 12 var c = ca[i]; 13 while (c.charAt(0) == ' ') { 14 c = c.substring(1); 15 } 16 if (c.indexOf(name) == 0) { 17 return c.substring(name.length, c.length); 18 } 19 } 20 return ""; 21} 22 23function ckplcyCheckCookie() { 24 var ckplcy_cookie_popup_visited=ckplcyGetCookie("cookie_pop_visited"); 25 if (ckplcy_cookie_popup_visited === ''){ 26 setTimeout(function () { 27 28 $("body").append(ckplcy_cookie_popup_html); 29 30 var close = document.getElementsByClassName('mio-cookie-popup__c-p-close')[0]; 31 var card = document.getElementsByClassName('mio-cookie-popup__c-p-card')[0]; 32 var button = document.getElementsByClassName('mio-cookie-popup__c-p-button')[0]; 33 34 35 card.classList.add('mio-cookie-popup--opened'); 36 card.classList.remove('mio-cookie-popup--closed'); 37 card.addEventListener('click', function (e) { 38 if (e.target === close | e.target === button) { 39 card.classList.remove('mio-cookie-popup--opened'); 40 card.classList.add('mio-cookie-popup--closed'); 41 ckplcySetCookie("cookie_pop_visited", true, 365); 42 $("#mio-cookie-popup").remove(); 43 } 44 }); 45 }, 1000); 46 } 47}; 48 49function setCookie(cname, cvalue, exdays) { 50 var d = new Date(); 51 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 52 var expires = "expires="+ d.toUTCString(); 53 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 54} 55 56function open_tab(evt, tabName,owner){ 57 var gtab,dtab,link,wrap_owner = "#tab-"+owner; 58 $(wrap_owner+" > .tabcontent").css("display","none"); 59 $(wrap_owner+"> ul .tablinks").removeClass("active"); 60 $("#"+owner+"-"+tabName).css("display","block"); 61 $(evt).addClass("active"); 62 gtab = gGET(owner); 63 dtab = $(evt).attr("data-tab"); 64 if((gtab == '' || gtab == null || gtab == undefined) && dtab == 1){ 65 // empty 66 }else{ 67 link = sGET(owner,dtab); 68 } 69 var title = $("title").html(); 70 window.history.pushState("object or string",title,link); 71} 72 73function gGET(name, url) { 74 if (!url) url = window.location.href; 75 name = name.replace(/[\[\]]/g, "\\$&"); 76 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 77 results = regex.exec(url); 78 if (!results) return null; 79 if (!results[2]) return ''; 80 return decodeURIComponent(results[2].replace(/\+/g, " ")); 81} 82 83function sGET(key,value,uri) { 84 if (!uri) uri = window.location.href; 85 var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); 86 var separator = uri.indexOf('?') !== -1 ? "&" : "?"; 87 if (uri.match(re)) { 88 return uri.replace(re, '$1' + key + "=" + value + '$2'); 89 } 90 else { 91 return uri + separator + key + "=" + value; 92 } 93} 94 95function strip_tags(html){ 96 var tmp = document.createElement("DIV"); 97 tmp.innerHTML = html; 98 return tmp.textContent || tmp.innerText || ""; 99} 100 101function getJson(str) { 102 var parse; 103 try { 104 parse = JSON.parse(str); 105 } catch (e) { 106 return false; 107 } 108 return parse; 109} 110 111function json_decode(str){ 112 return getJson(str); 113} 114 115function json_encode(obj){ 116 return JSON.stringify(obj); 117} 118 119function in_array(needle, haystack) { 120 var length = haystack.length; 121 for(var i = 0; i < length; i++) { 122 if(haystack[i] == needle) return true; 123 } 124 return false; 125} 126 127String.prototype.rtrim = function(s) { 128 return this.replace(new RegExp(s + "*$"),''); 129};
130 131function checkStrength(password) { 132 var strength = 0 133 if (password.length < 6) return 'weak'; 134 if (password.length > 7) strength += 1; 135// If password contains both lower and uppercase characters, increase strength value. 136 if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1; 137// If it has numbers and characters, increase strength value. 138 if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1; 139// If it has one special character, increase strength value. 140 if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1; 141// If it has two special characters, increase strength value. 142 if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1; 143// Calculated strength value, we can return messages 144// If value is less than 2 145 if (strength < 2) 146 return 'weak'; 147 else if (strength == 2) 148 return 'good'; 149 else 150 return 'strong'; 151} 152 153// Generate a password string 154function randString(options){ 155 156 if(typeof options == "object" && options.characters != undefined && options.characters != '') var characters = options.characters; 157 else var characters = "A-Z,a-z,0-9"; 158 if(typeof options == "object" && options.size != undefined && options.size != '') var size = options.size; 159 else var size = 16; 160 161 var dataSet = characters.split(','); 162 var possible = ''; 163 if($.inArray('a-z', dataSet) >= 0){ 164 possible += 'abcdefghijklmnopqrstuvwxyz'; 165 } 166 if($.inArray('A-Z', dataSet) >= 0){ 167 possible += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 168 } 169 if($.inArray('0-9', dataSet) >= 0){ 170 possible += '0123456789'; 171 } 172 if($.inArray('#', dataSet) >= 0){ 173 possible += '!@#$%^&*?_~'; 174 } 175 var text = ''; 176 for(var i=0; i < size; i++) { 177 text += possible.charAt(Math.floor(Math.random() * possible.length)); 178 } 179 return text; 180} 181 182function MioAjaxElement(element,external_options){ 183 var button = $(element); 184 if(button.attr("data-pending") != undefined) { 185 console.log("Please your wait... Button pending"); 186 }else{ 187 var output,option,options; 188 189 if(external_options){ 190 options = external_options; 191 }else{ 192 option = button.attr("mio-ajax-options"); 193 options = getJson(option); 194 } 195 196 if(options != undefined && options.before_function != undefined){ 197 var beforeCall = window[options.before_function](); 198 if(!beforeCall) return false; 199 } 200 201 if(options != undefined && options.type == "direct"){ 202 button.attr("data-pending","true"); 203 204 if(options != undefined && options.waiting_text != undefined && options.waiting_text != ''){ 205 var before_text = button.html(); 206 button.html(options.waiting_text); 207 } 208 output = options.result; 209 var wmethod = (options.method != undefined && options.method != '') ? options.method : "GET"; 210 var wdata = (options.data != undefined && options.data != '') ? options.data : false; 211 $.ajax({
212 url:options.action, 213 method:wmethod, 214 data:wdata, 215 }).done(function (result) { 216 button.removeAttr("data-pending"); 217 if(options != undefined && options.waiting_text != undefined && options.waiting_text != ''){ 218 button.html(before_text); 219 } 220 221 if(!document.getElementById(output)){ 222 window[output](result); 223 }else{ 224 $("#"+output).html(result); 225 $("#"+output).fadeIn(400); 226 } 227 }).fail(function() { 228 console.log("Failed Request! URL Address: "+options.action); 229 }); 230 231 }else{ 232 233 button.attr("data-pending","true"); 234 235 var form = options.form != undefined ? options.form : $(element).closest("form"); 236 var form_id = form.attr("id"); 237 238 if(options != undefined && options.result != undefined) output = options.result; 239 else output = "mio_success"; 240 241 var file_upload = false; 242 243 $("#"+form_id+" input:file").each(function (key, item) { 244 var val = $(item).val(); 245 if(val != undefined && val != ''){ 246 file_upload = true; 247 } 248 }); 249 250 251 var before_text = button.html(); 252 var replace_button_text = false; 253 254 if(options != undefined && options.progress_text != undefined && options.progress_text != ''){ 255 var progress_text = options.progress_text; 256 progress_text = progress_text.replace('{progress}','<span id="percent">0%</span>'); 257 } 258 259 if(options != undefined && options.waiting_text != undefined && options.waiting_text != ''){ 260 var waiting_text = options.waiting_text; 261 } 262 263 if(waiting_text != undefined && waiting_text != '') 264 replace_button_text = waiting_text; 265 266 if(file_upload && progress_text != undefined && progress_text != '') 267 replace_button_text = progress_text; 268 269 270 if(replace_button_text != undefined && replace_button_text && replace_button_text != '') 271 button.html(replace_button_text); 272 273 274 if(file_upload){ 275 var bar = $("#"+form_id+" #bar"); 276 var percent = $("#"+form_id+" #percent"); 277 } 278 279 $(form).ajaxForm({ 280 beforeSend: function() { 281 if(file_upload){ 282 var percentVal = '0%'; 283 bar.width(percentVal); 284 percent.html(percentVal); 285 } 286 }, 287 uploadProgress: function(event, position, total, percentComplete) { 288 if(file_upload){ 289 var percentVal = percentComplete + '%'; 290 bar.width(percentVal); 291 percent.html(percentVal); 292 if(percentComplete == 100) 293 button.html(waiting_text); 294 } 295 }, 296 success:function(response){ 297 if(!document.getElementById(output)) window[output](response); 298 else $("#"+output).html(response).fadeIn(200); 299 button.removeAttr("data-pending"); 300 if(options != undefined && options.waiting_text != undefined && options.waiting_text != '') button.html(before_text); 301 } 302 }).submit(); 303 } 304 } 305} 306 307var ajax_output; 308function MioAjax(options,returnResponse,getAjax){ 309 if(options.action != undefined && options.action != ''){ 310 var button,before_text; 311 if(options.button_element != undefined) button = $(options.button_element); 312 313 if(button){ 314 if(button.attr("data-pending") != undefined) return {done:function(){}}; 315 316 button.attr("data-pending","true"); 317 if(options != undefined && options.waiting_text != undefined && options.waiting_text != ''){ 318 before_text = button.html(); 319 button.html(options.waiting_text); 320 } 321 } 322 323 $.ajaxSetup({ cache: false }); 324 var form_data = options.form != undefined ? options.form.serialize() : false; 325 var get_data = options.data != undefined ? options.data : form_data; 326 var ajax = $.ajax({
327 url:options.action, 328 method:options.method != undefined && options.method != '' ? options.method : 'GET', 329 data:get_data, 330 cache:false, 331 async:getAjax ? true : false, 332 success:function (result){ 333 334 if(button && before_text){ 335 button.removeAttr("data-pending"); 336 button.html(before_text); 337 } 338 339 if(returnResponse){ 340 ajax_output = result; 341 } 342 else{ 343 var output = options.output != undefined ? options.output : "ajax_response"; 344 if(!document.getElementById(output)) window[output](result); 345 else $("#"+output).html(result).fadeIn(200); 346 } 347 }, 348 error: function(xhr, errorString, exception) { 349 console.log("xhr.status="+xhr.status+" error="+errorString+" exception=|"+exception+"|"); 350 } 351 }); 352 353 } 354 if(getAjax){ 355 return ajax; 356 }else if(returnResponse){ 357 return ajax_output; 358 } 359 else return false; 360} 361 362 363$(document).ready(function(){ 364 $(".mio-ajax-submit").on("click",function(){ 365 MioAjaxElement(this); 366 }); 367 368 // Auto Select Pass On Focus 369 $('input[rel="aselect"]').on("click", function () { 370 $(this).select(); 371 }); 372 373}); 374 375function transliterate(s){ 376 s = String(s); 377 378 var char_map = { 379 // Latin 380 'Ã': 'A', 'Ã': 'A', 'Ã': 'A', 'Ã': 'A', 'Ã': 'A', 'à ': 'A', 'Ã': 'AE', 'Ã': 'C', 381 'Ã': 'E', 'Ã': 'E', 'Ã': 'E', 'Ã': 'E', 'Ã': 'I', 'Ã': 'I', 'Ã': 'I', 'Ã': 'I', 382 'Ã': 'D', 'Ã': 'N', 'Ã': 'O', 'Ã': 'O', 'Ã': 'O', 'Ã': 'O', 'Ã': 'O', 'Å': 'O', 383 'Ã': 'O', 'Ã': 'U', 'Ã': 'U', 'Ã': 'U', 'Ã': 'U', 'Ű': 'U', 'Ã': 'Y', 'Ã': 'TH', 384 'Ã': 'ss', 385 'à ': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'Ã¥': 'a', 'æ': 'ae', 'ç': 'c', 386 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'Ã': 'i', 'î': 'i', 'ï': 'i', 387 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'Å': 'o', 388 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 389 'ÿ': 'y', 390 391 // Latin symbols 392 '©': '(c)', 393 394 // Greek 395 'Î': 'A', 'Î': 'B', 'Î': 'G', 'Î': 'D', 'Î': 'E', 'Î': 'Z', 'Î': 'H', 'Î': '8', 396 'Î': 'I', 'Î': 'K', 'Î': 'L', 'Î': 'M', 'Î': 'N', 'Î': '3', 'Î': 'O', 'Î ': 'P', 397 'Ρ': 'R', 'Σ': 'S', 'Τ': 'T', 'Î¥': 'Y', 'Φ': 'F', 'Χ': 'X', 'Ψ': 'PS', 'Ω': 'W', 398 'Î': 'A', 'Î': 'E', 'Î': 'I', 'Î': 'O', 'Î': 'Y', 'Î': 'H', 'Î': 'W', 'Ϊ': 'I', 399 'Ϋ': 'Y', 400 'α': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'ζ': 'z', 'η': 'h', 'θ': '8', 401 'ι': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': '3', 'ο': 'o', 'Ï': 'p', 402 'Ï': 'r', 'Ï': 's', 'Ï': 't', 'Ï ': 'y', 'Ï': 'f', 'Ï': 'x', 'Ï': 'ps', 'Ï': 'w', 403 'ά': 'a', 'Î': 'e', 'ί': 'i', 'Ï': 'o', 'Ï': 'y', 'ή': 'h', 'Ï': 'w', 'Ï': 's', 404 'Ï': 'i', 'ΰ': 'y', 'Ï': 'y', 'Î': 'i', 405 406 // Turkish 407 'Å': 'S', 'İ': 'I', 'Ã': 'C', 'Ã': 'U', 'Ã': 'O', 'Ä': 'G', 408 'Å': 's', 'ı': 'i', 'ç': 'c', 'ü': 'u', 'ö': 'o', 'Ä': 'g', 409 410 // Russian 411 'Ð': 'A', 'Ð': 'B', 'Ð': 'V', 'Ð': 'G', 'Ð': 'D', 'Ð': 'E', 'Ð': 'Yo', 'Ð': 'Zh', 412 'Ð': 'Z', 'Ð': 'I', 'Ð': 'J', 'Ð': 'K', 'Ð': 'L', 'Ð': 'M', 'Ð': 'N', 'Ð': 'O', 413 'Ð': 'P', 'Ð ': 'R', 'С': 'S', 'Т': 'T', 'У': 'U', 'Ф': 'F', 'Ð¥': 'H', 'Ц': 'C', 414 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sh', 'Ъ': '', 'Ы': 'Y', 'Ь': '', 'Ð': 'E', 'Ю': 'Yu', 415 'Я': 'Ya', 416 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'Ñ': 'yo', 'ж': 'zh', 417 'з': 'z', 'и': 'i', 'й': 'j', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', 418 'п': 'p', 'Ñ': 'r', 'Ñ': 's', 'Ñ': 't', 'Ñ': 'u', 'Ñ': 'f', 'Ñ ': 'h', 'Ñ': 'c', 419 'Ñ': 'ch', 'Ñ': 'sh', 'Ñ': 'sh', 'Ñ': '', 'Ñ': 'y', 'Ñ': '', 'Ñ': 'e', 'Ñ': 'yu', 420 'Ñ': 'ya', 421 422 // Ukrainian 423 'Ð': 'Ye', 'Ð': 'I', 'Ð': 'Yi', 'Ò': 'G', 424 'Ñ': 'ye', 'Ñ': 'i', 'Ñ': 'yi', 'Ò': 'g', 425 426 // Czech 427 'Ä': 'C', 'Ä': 'D', 'Ä': 'E', 'Å': 'N', 'Å': 'R', 'Å ': 'S', 'Ť': 'T', 'Å®': 'U', 428 'Ž': 'Z', 429 'Ä': 'c', 'Ä': 'd', 'Ä': 'e', 'Å': 'n', 'Å': 'r', 'Å¡': 's', 'Å¥': 't', 'ů': 'u', 430 'ž': 'z', 431 432 // Polish 433 'Ä': 'A', 'Ä': 'C', 'Ä': 'e', 'Å': 'L', 'Å': 'N', 'Ã': 'o', 'Å': 'S', 'Ź': 'Z', 434 'Å»': 'Z', 435 'Ä ': 'a', 'Ä': 'c', 'Ä': 'e', 'Å': 'l', 'Å': 'n', 'ó': 'o', 'Å': 's', 'ź': 'z', 436 'ż': 'z', 437 438 // Latvian 439 'Ä': 'A', 'Ä': 'C', 'Ä': 'E', 'Ä¢': 'G', 'Ī': 'i', 'Ķ': 'k', 'Ä»': 'L', 'Å ': 'N', 440 'Å ': 'S', 'Ū': 'u', 'Ž': 'Z',
441 'Ä': 'a', 'Ä': 'c', 'Ä': 'e', 'Ä£': 'g', 'Ä«': 'i', 'Ä·': 'k', 'ļ': 'l', 'Å': 'n', 442 'Å¡': 's', 'Å«': 'u', 'ž': 'z' 443 }; 444 445 // Transliterate characters to ASCII 446 for (var k in char_map) { 447 s = s.replace(RegExp(k, 'g'), char_map[k]); 448 } 449 450 return s; 451} 452var lastDropModal; 453 454function alert_error(title,options){ 455 456 if(lastDropModal != '' && $("#"+lastDropModal).css("display")=="block"){ 457 swal({ 458 type:"error", 459 title:warning_modal_title, 460 text:title, 461 timer: options.timer != undefined ? options.timer : false, 462 }); 463 464 return false; 465 } 466 467 if(document.getElementById("modal-alert")) $("#modal-alert").remove(); 468 $("body").append('<div id="modal-alert" class="iziModal"></div>'); 469 470 var subtitle; 471 if(title.length>80){ 472 subtitle = title; 473 title = warning_modal_title; 474 } 475 $("#modal-alert").iziModal('destroy'); 476 $("#modal-alert").iziModal({ 477 overlay:false, 478 title: title, 479 subtitle:subtitle, 480 icon: 'fa fa-ban', 481 headerColor: '#CC0000', 482 width: 600, 483 timeout: typeof options == "object" && options.timer != undefined ? options.timer : false, 484 timeoutProgressbar: typeof options == "object" && options.timer != undefined ? true : false, 485 transitionIn: 'fadeInDown', 486 transitionOut: 'fadeOutDown', 487 loop: true, 488 pauseOnHover: true, 489 history:false, 490 onResize: function(){ 491 return false; 492 }, 493 }); 494 $("#modal-alert").iziModal('open'); 495} 496 497function alert_success(title,options){ 498 499 if(lastDropModal != '') close_modal(lastDropModal); 500 501 if(document.getElementById("modal-alert")) $("#modal-alert").remove(); 502 $("body").append('<div id="modal-alert" class="iziModal"></div>'); 503 504 var subtitle; 505 if(title.length>80){ 506 subtitle = title; 507 title = success_modal_title; 508 } 509 510 $("#modal-alert").iziModal('destroy'); 511 $("#modal-alert").iziModal({ 512 overlay:false, 513 title: title, 514 subtitle:subtitle, 515 icon: 'fa fa-check', 516 headerColor: '#50B800', 517 width: 600, 518 timeout: typeof options == "object" && options.timer != undefined ? options.timer : false, 519 timeoutProgressbar: typeof options == "object" && options.timer != undefined ? true : false, 520 transitionIn: 'fadeInDown', 521 transitionOut: 'fadeOutDown', 522 loop: true, 523 pauseOnHover: true, 524 history:false, 525 }); 526 $("#modal-alert").iziModal('open'); 527} 528 529function close_modal(modal_id,modal_class){ 530 if(modal_id != '') $("#"+modal_id).iziModal('close'); 531 if(modal_class != '') $("."+modal_class).iziModal('close'); 532} 533 534function get_modal_options_generate(options){ 535 if(!options || typeof options != "object") options = {}; 536 var modal_options = { 537 transitionIn: 'fadeInDown', 538 transitionOut: 'fadeOutDown', 539 bodyOverflow: true, 540 history:false, 541 appendTo:false, 542 }; 543 return $.extend( options, modal_options); 544} 545 546function open_modal(modal_id,options){ 547 lastDropModal = modal_id; 548 549 $("#"+modal_id).iziModal('destroy'); 550 $("#"+modal_id).iziModal(get_modal_options_generate(options)); 551 552 $("#"+modal_id).iziModal('open'); 553} 554 555 556function isMobile(){ 557 if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 558 || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
558sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) 559 { 560 return true; 561 } else 562 { 563 return false; 564 } 565} 566 567 568 569jQuery(document).ready(function($){ 570 // browser window scroll (in pixels) after which the "back to top" link is shown 571 var offset = 300, 572 //browser window scroll (in pixels) after which the "back to top" link opacity is reduced 573 offset_opacity = 1200, 574 //duration of the top scrolling animation (in ms) 575 scroll_top_duration = 700, 576 //grab the "back to top" link 577 $back_to_top = $('.cd-top'); 578 579 //hide or show the "back to top" link 580 $(window).scroll(function(){ 581 ( $(this).scrollTop() > offset ) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out'); 582 if( $(this).scrollTop() > offset_opacity ) { 583 $back_to_top.addClass('cd-fade-out'); 584 } 585 }); 586 587 //smooth scroll to top 588 $back_to_top.on('click', function(event){ 589 event.preventDefault(); 590 $('body,html').animate({ 591 scrollTop: 0 , 592 }, scroll_top_duration 593 ); 594 }); 595 596}); 597 598if(typeof(is_logged) == "undefined") var is_logged = false; 599if(is_logged !== undefined && is_logged && update_online_link !== undefined){ 600 var windowActive = "on",requesting_now=false; 601 function updateOnline(){ 602 if(requesting_now) return false; 603 if(windowActive === "off") return false; 604 605 requesting_now = true; 606 607 var request = MioAjax({ 608 action:update_online_link, 609 data:{ 610 operation: "update_online", 611 title: document.title, 612 }, 613 method:"POST", 614 },true,true); 615 request.done(function(response){ 616 requesting_now = false; 617 }); 618 } 619 setInterval(updateOnline,10000); 620 setTimeout(updateOnline,2000); 621 document.addEventListener('visibilitychange',function(){ 622 if (document.visibilityState == "hidden"){ 623 windowActive = "off"; 624 } else { 625 windowActive = "on"; 626 } 627 }, false); 628 629 var interval_id; 630 $(window).focus(function() { 631 if (!interval_id) 632 interval_id = setInterval(function(){ 633 windowActive = "on"; 634 }, 1000); 635 }); 636 637 $(window).blur(function() { 638 clearInterval(interval_id); 639 windowActive = "off"; 640 }); 641 642 $(document).mousemove(function(){ 643 if(windowActive == 'off') 644 { 645 windowActive = "on"; 646 if(!interval_id) 647 interval_id = setInterval(function(){ 648 windowActive = "on"; 649 }, 1000); 650 651 } 652 }); 653} 654 655(function( $ ){ 656 657 $.fn.extend({ 658 credit: function ( args ) { 659 660 $(this).each(function (){ 661 662 663 // Set defaults 664 var defaults = { 665 auto_select:true 666 } 667 668 // Init user arguments 669 var args = $.extend(defaults,args); 670 671 // global var for the orginal input 672 var credit_org = $(this); 673 674 // Hide input if css was not set 675 credit_org.css("display","none"); 676 677 // Create credit control holder 678 var credit_control = $('<div></div>',{ 679 class: "credit-input" 680 }); 681 682 // Add credit cell inputs to the holder 683 for ( i = 0; i < 4; i++ ) { 684 credit_control.append( 685 $("<input />",{ 686 class: "credit-cell", 687 placeholder: "0000", 688 maxlength: 4 689 }) 690 ); 691 } 692 693 // Print the full credit input 694 credit_org.after( credit_control ); 695 696 // Global var for credit cells 697 var cells = credit_control.children(".credit-cell"); 698 699 /** 700 * Set key press event for all credit inputs 701 * this function will allow only to numbers to be inserted. 702 * @access public 703 * @return {bool} check if user input is only numbers 704 */ 705 cells.keypress(function ( event ) {
706 // Check if key code is a number 707 if ( event.keyCode > 31 && (event.keyCode < 48 || event.keyCode > 57) ) { 708 // Key code is a number, the `keydown` event will fire next 709 return false; 710 } 711 // Key code is not a number return false, the `keydown` event will not fire 712 return true; 713 }); 714 715 /** 716 * Set key down event for all credit inputs 717 * @access public 718 * @return {void} 719 */ 720 cells.keydown(function ( event ) { 721 // Check if key is backspace 722 var backspace = ( event.keyCode == 8 ); 723 // Switch credit text length 724 switch( $(this).val().length ) { 725 case 4: 726 // If key is backspace do nothing 727 if ( backspace ) { 728 return; 729 } 730 // Select next credit element 731 var n = $(this).next(".credit-cell"); 732 // If found 733 if (n.length) { 734 // Focus on it 735 n.focus(); 736 } 737 break; 738 case 0: 739 // Check if key down is backspace 740 if ( !backspace ) { 741 // Key is not backspace, do nothing. 742 return; 743 } 744 // Select previous credit element 745 var n = $(this).prev(".credit-cell"); 746 // If found 747 if (n.length) { 748 // Focus on it 749 n.focus(); 750 } 751 break; 752 } 753 }); 754 755 // On cells focus 756 cells.focus( function() { 757 // Add focus class 758 credit_control.addClass('c-focus'); 759 }); 760 761 // On focus out 762 cells.blur( function() { 763 // Remove focus class 764 credit_control.removeClass('c-focus'); 765 }); 766 767 /** 768 * Update orginal input value to the credit card number 769 * @access public 770 * @return {void} 771 */ 772 cells.keyup(function (){ 773 // Init card number var 774 var card_number = ''; 775 // For each of the credit card cells 776 cells.each(function (){ 777 // Add current cell value 778 card_number = card_number + $(this).val(); 779 }); 780 // Set orginal input value 781 credit_org.val( card_number ); 782 }); 783 784 785 if ( args["auto_select"] === true ) { 786 // Focus on the first credit cell input 787 credit_control.children(".credit-cell:first").focus(); 788 } 789 790 }); 791 792 } 793 }); 794 795})(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.