1var AndroidURL = "https://play.google.com/store/apps/details?id=cambodia.sokhakrom.codingate"; 2var IphoneURL = "https://itunes.apple.com/us/app/sokhakrom-healthcare-platform/id1147978088?mt=8"; 3 4$( document ).ready(function() { 5 redirectHealthtip(); 6 redirectHotnews(); 7 redirectWellness(); 8 redirectPlant(); 9}); 10 11$("img").bind("error",function(){ 12 // Replacing image source 13 $(this).attr("src","/img/default.jpeg"); 14}); 15 16function redirectHealthtip() { 17 var elem = jQuery('#redirectHealthtip'); 18 if (elem.length) { 19 var id = elem.data('id'); 20 var AppURL = "sokhakrom://healthtip/detail/"+id; 21 if (navigator.userAgent.match(/Android/)) { 22 if (navigator.userAgent.match(/Chrome/)) { 23 window.location = "intent://healthtip/detail/"+id+"#Intent;scheme=sokhakrom;package=cambodia.sokhakrom.codingate;end" 24 } else { 25 var iframe = document.createElement("iframe"); 26 iframe.style.border = "none"; 27 iframe.style.width = "1px"; 28 iframe.style.height = "1px"; 29 iframe.onload = function() { 30 window.location = AndroidURL; 31 }; 32 iframe.src = AppURL; 33 document.body.appendChild(iframe); 34 } 35 36 } else if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){ 37 setTimeout(function () { window.location = IphoneURL }, 2000); 38 window.location = AppURL; 39 } 40 } 41} 42 43function redirectHotnews() { 44 var elem = jQuery('#redirectHotnews'); 45 if (elem.length) { 46 var id = elem.data('id'); 47 var AppURL = "sokhakrom://hotnews/detail/"+id; 48 if (navigator.userAgent.match(/Android/)) { 49 if (navigator.userAgent.match(/Chrome/)) { 50 window.location = "intent://hotnews/detail/"+id+"#Intent;scheme=sokhakrom;package=cambodia.sokhakrom.codingate;end" 51 } else { 52 var iframe = document.createElement("iframe"); 53 iframe.style.border = "none"; 54 iframe.style.width = "1px"; 55 iframe.style.height = "1px"; 56 iframe.onload = function() { 57 window.location = AndroidURL; 58 }; 59 iframe.src = AppURL; 60 document.body.appendChild(iframe); 61 } 62 63 } else if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){ 64 setTimeout(function () { window.location = IphoneURL }, 2000); 65 window.location = AppURL; 66 } 67 } 68} 69 70function redirectWellness() { 71 var elem = jQuery('#redirectWellness'); 72 if (elem.length) { 73 var id = elem.data('id'); 74 var AppURL = "sokhakrom://wellness/detail/"+id; 75 if (navigator.userAgent.match(/Android/)) { 76 if (navigator.userAgent.match(/Chrome/)) { 77 window.location = "intent://wellness/detail/"+id+"#Intent;scheme=sokhakrom;package=cambodia.sokhakrom.codingate;end" 78 } else { 79 var iframe = document.createElement("iframe"); 80 iframe.style.border = "none"; 81 iframe.style.width = "1px"; 82 iframe.style.height = "1px"; 83 iframe.onload = function() { 84 window.location = AndroidURL; 85 }; 86 iframe.src = AppURL; 87 document.body.appendChild(iframe); 88 } 89 90 } else if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){ 91 setTimeout(function () { window.location = IphoneURL }, 2000); 92 window.location = AppURL; 93 } 94 } 95} 96 97function redirectPlant() { 98 var elem = jQuery('#redirectPlant'); 99 if (elem.length) { 100 var id = elem.data('id'); 101 var AppURL = "sokhakrom://plant/detail/"+id; 102 if (navigator.userAgent.match(/Android/)) { 103 if (navigator.userAgent.match(/Chrome/)) { 104 window.location = "intent://plant/detail/"+id+"#Intent;scheme=sokhakrom;package=cambodia.sokhakrom.codingate;end" 105 } else { 106 var iframe = document.createElement("iframe"); 107 iframe.style.border = "none"; 108 iframe.style.width = "1px"; 109 iframe.style.height = "1px"; 110 iframe.onload = function() { 111 window.location = AndroidURL; 112 }; 113 iframe.src = AppURL; 114 document.body.appendChild(iframe); 115 } 116 117 } else if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){ 118 setTimeout(function () { window.location = IphoneURL }, 2000); 119 window.location = AppURL; 120 } 121 } 122}
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.