1var nowHost = window.location.host; 2var preview = /^preview.*/; 3if (preview.test(nowHost)) { 4 $('body').append("<div style='position:fixed;bottom:0;left:0;background-color:#ff00b4;color:#fff;font-size:12px;z-index:999;padding:0 30px;line-height:2'>PREVIEW MODE</div>"); 5} 6 7BaseUrl = $('.base-url').val(); 8var preurl = location.href.split("/",7); 9var _token = $('#_token').val(); 10// åæç¢ååæ 11$('[typeidontype]').on('click',function(){ 12 var filterurl = BaseUrl+"/"+preurl[4]+"/"+"Ajax/Changetype"; 13 var _this = $(this); 14 $.ajax({ 15 url: filterurl, 16 type:'get', 17 data : { 18 _token: _token, 19 type_id:$(this).attr('typeidontype'), 20 cate_id:$('[cateid]').attr('cateid'), 21 }, 22 23 }) 24 .done(function (data) { 25 $('[typeidonitem]').remove(); 26 $('[itemcontain]').prepend(data.view); 27 $('[typetitle]').text(data.title); 28 $('[typesubtitle]').text(data.content); 29 // console.log($(this).attr('typeidontype')); 30 31 history.replaceState('', "page 2", BaseUrl+"/"+preurl[4]+"/"+preurl[5]+"/"+_this.attr('typeurl')); 32 }) 33 .fail(function (jqXHR, textStatus, errorThrown,data) { 34 }); 35}); 36// è©¢åè»é¸ææç¨é¡å 37function selectapp(obj) 38{ 39 var addcartroute = $('.add-to-list[data-ajax-route]').attr('data-ajax-route').split("/",11); 40 addcartroute[8] = $(obj).attr('appid'); 41 $('.add-to-list[data-ajax-route]').attr('data-ajax-route',addcartroute.join('/')); 42} 43// è©¢åè»é¸æå®ä½ 44function selectquantity(obj) 45{ 46 var addcartroute = $('.add-to-list[data-ajax-route]').attr('data-ajax-route').split("/",11); 47 48 addcartroute[9] = $(obj).attr('quantityid'); 49 $('.add-to-list[data-ajax-route]').attr('data-ajax-route',addcartroute.join('/')); 50} 51// è©¢åè»è¼¸å ¥æç¨é¡åå ¶ä» 52function apptypeother(obj) 53{ 54 var addcartroute = $('.add-to-list[data-ajax-route]').attr('data-ajax-route').split("/",11); 55 56 addcartroute[10] = $(obj).val()?$(obj).val():'none'; 57 $('.add-to-list[data-ajax-route]').attr('data-ajax-route',addcartroute.join('/')); 58 console.log($(obj).val()); 59} 60// éåå°é ç®å å ¥è©¢åè»ççç®± 61function add_list(obj) 62{ 63 var addcarturl = BaseUrl+"/"+'Products'+"/"+"Ajax/AjaxAddCartBefore"+"/"+$(obj).attr('nowitem'); 64 $.ajax4({ 65 Route: addcarturl, 66 Container: '.add-cart-before', 67 Block: '', 68 Callback: 'ajaxCallback.inquiryAdd', 69 Backready: '', 70 Backloaded: '', 71 }); 72} 73// å¾è©¢åç©è»ç§»é¤é ç® 74function remove_list(obj) 75{ 76 where = $(obj).attr('where'); 77 var removecarturl = BaseUrl+"/"+'Products'+"/"+"Ajax/AjaxRemoveCart"+"/"+$(obj).attr('index')+'/'+where; 78 $.ajax({ 79 url: removecarturl, 80 type:'get', 81 data : { 82 _token: _token, 83 }, 84 85 }) 86 .done(function (data) { 87 88 if (where=='incart') { 89 $('[cartcontainer]').html(data.view); 90 setCookie('cartcount',data.count,1); 91 modifycartcount(data.count); 92 txtarr = $('[listcount]').text().split(""); 93 var re = /^[0-9]+.?[0-9]*/; 94 var nochange = 0; 95 for (let index = 0; index < txtarr.length; index++) { 96 const element = txtarr[index]; 97 if(re.test(element)==true&&nochange==0) 98 { 99 txtarr[index] = data.count; 100 nochange = 1; 101 }else if(re.test(element)==true&&nochange==1) 102 { 103 txtarr[index] = ''; 104 } 105 } 106 var newtxt = txtarr.join(""); 107 $('[listcount]').text(newtxt); 108 if (data.count==0) { 109 $('[emptyclass]').addClass('empty'); 110 } 111 }else if(where=='incontact') 112 { 113 $('.table-content').html(data.view); 114 } 115 }) 116 .fail(function (jqXHR, textStatus, errorThrown,data) { 117 alert('Network error and Please reload'); 118 }); 119} 120// éåè©¢åè»ææ¯å¨è©¢åè»ä¸å å ¥é ç® 121function open_list(obj) 122{ 123 var addcarturl = BaseUrl+"/"+'Products'+"/"+"Ajax/InquiryCart"+"/"+'0/0/0/none'; 124 if ($('.inquiry-cart.ajax_close.show').length<=0) { 125 $.ajax4({ 126 Route: addcarturl, 127 Container: '.inquiry-cart', 128 Block: '', 129 Callback: 'ajaxCallback.inquiryCart', 130 Backready: '', 131 Backloaded: '' 132 }); 133 } 134} 135// éåæç¨æ¨¡æ¬çç®± 136function opensimulation(obj) 137{ 138 var addcarturl = BaseUrl+"/"+'Products'+"/"+"Ajax/Simulation"; 139 $.ajax4({ 140 Route: addcarturl, 141 Container: '.app-simulation', 142 Block: '', 143 Callback: 'ajaxCallback.simulation', 144 Backready: '', 145 Backloaded: '' 146 }); 147} 148// å å ¥æ¨è¨å·²é忍¡æ¬æç¨çGETè®æ¸ 149function sharesimulation(obj) 150{ 151 // console.log(location.href); 152 var newurl = updateQueryStringParameter(window.location.href, 'simulationahare', '1'); 153 //åå½åurlæ·»å åæ°ï¼æ²¡æåå²è®°å½ 154 window.history.replaceState({ 155 path: newurl 156 }, '', newurl); 157} 158// å¨ç¶²åä¸å å ¥GETè®æ¸çfunction 159function updateQueryStringParameter(uri, key, value) { 160 if(!value) { 161 return uri; 162 } 163 var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); 164 var separator = uri.indexOf('?') !== -1 ? "&" : "?"; 165 if (uri.match(re)) { 166 return uri.replace(re, '$1' + key + "=" + value + '$2'); 167 } 168 else { 169 return uri + separator + key + "=" + value; 170 } 171} 172// åªé¤ç¶²åä¸é忍¡æ¬æç¨çGETè®æ¸ 173function unsharesimulation(obj) 174{ 175 var newurl = funcUrlDel(location.href,'simulationahare'); 176 //åå½åurlæ·»å åæ°ï¼æ²¡æåå²è®°å½ 177 window.history.replaceState({ 178 path: newurl 179 }, '', newurl); 180} 181// åªé¤GETè®æ¸çfunction 182function funcUrlDel(url,name){ 183 var loca = url.split("?"); 184 var baseUrl = loca[0]; 185 if (loca[1].indexOf(name)>-1) { 186 var obj = {} 187 var arr = loca[1].split("&"); 188 for (var i = 0; i < arr.length; i++) { 189 arr[i] = arr[i].split("="); 190 obj[arr[i][0]] = arr[i][1]; 191 }; 192 delete obj[name]; 193 var url = baseUrl + '?' + JSON.stringify(obj).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&"); 194 return url 195 }; 196} 197function chksharesimulation(obj) 198{ 199 if (funcUrlGet(location.href,'simulationahare')) { 200 opensimulation(); 201 // alert('321'); 202 } 203 204} 205// åå¾getè®æ¸çfunction 206function funcUrlGet(url,variable){ 207 var query = url.split("?");
208 var vars = query[1]!=undefined?query[1].split("&"):[]; 209 for (var i=0;i<vars.length;i++) { 210 var pair = vars[i].split("="); 211 if(pair[0] == variable){return pair[1];} 212 } 213 return(false); 214} 215// æç¨æ¨¡æ¬åæåé¡ 216function changesimulationcate(obj) 217{ 218 appimg=$(obj).attr('appimage'); 219 appbakimg=$(obj).attr('appbakimage'); 220 221 $(".main").css("background-image","url("+appbakimg+")"); 222 $(".mask").css("background-image","url("+appimg+")"); 223 224 $('[s2cateid]').hide(); 225 $('[s2cateid="'+$(obj).attr('s1cateid')+'"]').show(); 226 $('[s2cateid="'+$(obj).attr('s1cateid')+'"] .color-item').eq(0).click(); 227 228} 229// 鏿æç¨æ¨¡æ¬é¡è² 230function selectsimulationcolor(obj) 231{ 232 var addcartroute = $('.open_related[data-ajax-route]').attr('data-ajax-route').split("/",11); 233 addcartroute[7] = $(obj).attr('itemid'); 234 $('.open_related[data-ajax-route]').attr('data-ajax-route',addcartroute.join('/')); 235} 236// è©¢åè»æç¼çè®åææ´æ¹è©¢åè»çæ¸éåæå(éæ¯åªæå¨æ è©¢åè»å«é²ä¾çblade è·æ´åé é¢è¼å ¥çæå使ç¨) 237function modifycartcount(count) 238{ 239 // var cartcount =count?count:getCookie('cartcount'); 240 if (count) { 241 cartcount = count; 242 modifi(cartcount); 243 }else{ 244 245 var filterurl = BaseUrl+"/"+'Products'+"/"+"Ajax/getcartcount"; 246 $.ajax({ 247 248 url: filterurl, 249 type:'get', 250 data : { 251 }, 252 253 }) 254 .done(function (data) { 255 var cartcount = data.count; 256 modifi(cartcount); 257 console.log(data.count); 258 console.log(cartcount); 259 }) 260 .fail(function (jqXHR, textStatus, errorThrown,data) { 261 // haschangedcaptcha=0; 262 }); 263 } 264} 265 266function modifi(cartcount) 267{ 268 $('[data-count]').attr('data-count',cartcount?cartcount:0); 269 // $('.main-navbar [data-count]').attr('data-count',cartcount?cartcount:0); 270 if (cartcount==0||'') { 271 $('[data-count]').removeClass('no_empty'); 272 $('[countLesszero]').text( 273 $('[countLesszero]').attr('countLesszero') 274 ); 275 $('[countLesszero]').attr('data-count',''); 276 }else if(cartcount==1){ 277 $('[data-count]').addClass('no_empty'); 278 $('[countLesszero]').text($( 279 '[countLesszero]').attr('countequalzero') 280 ); 281 }else{ 282 $('[data-count]').addClass('no_empty'); 283 $('[countLesszero]').text( 284 $('[countLesszero]').attr('countLesszero') 285 ); 286 287 } 288} 289 290function ChangeContinent(obj) 291{ 292 $('[name="continent"]').val($(obj).attr('continent_id')); 293} 294 295// ç¼éç¢åcontactè¡¨å® 296function ProductSubmit(obj) 297{ 298 var filterurl = BaseUrl+"/"+'Products'+"/"+"Ajax/ajax_submit"; 299 var Form_data = $('#ProductSubmit').serializeArray(); 300 console.log(Form_data); 301 302 var _this = $(this); 303 $.ajax({ 304 url: filterurl, 305 type:'get', 306 data : { 307 _token: _token, 308 data:Form_data, 309 // type_id:$(this).attr('typeidontype'), 310 // cate_id:$('[cateid]').attr('cateid'), 311 }, 312 313 }) 314 .done(function (data) { 315 haschangedcaptcha=0; 316 if (data.success==false) { 317 alert(data.warning); 318 }else if(data.success==true){ 319 _common.openAjax('.form-btn.submit'); 320 // console.log(data.tomail); 321 322 setCookie('cartcount',0,1); 323 modifycartcount(0); 324 } 325 }) 326 .fail(function (jqXHR, textStatus, errorThrown,data) { 327 haschangedcaptcha=0; 328 }); 329} 330function changecaptcha(obj) 331{ 332 333 if ((typeof haschangedcaptcha === 'undefined'||haschangedcaptcha==0)||$(obj).attr('name')!='captchacode') { 334 $('[alt="Jå4é©è碼"]').click(); 335 haschangedcaptcha=1; 336 } 337} 338function item_list_switch(obj) 339{ 340 console.log($(obj).attr('remenber')); 341 var remember = $(obj).attr('remenber'); 342 if (remember=='ProductFeature') { 343 history.replaceState('', "page 2", BaseUrl+"/"+preurl[4]+"/"+preurl[5]+"/"+remember); 344 }else if(remember=='list'){ 345 $('[typeurl] .active').click(); 346 } 347} 348// è¼¸å ¥cookieå,ècookieå¼ 349function setCookie(cname, cvalue, exdays) 350{ 351 var d = new Date(); 352 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 353 var expires = "expires="+ d.toUTCString(); 354 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 355} 356// è¼¸å ¥cookieåcookieå¼ 357function getCookie(cname) { 358 var name = cname + "="; 359 var decodedCookie = decodeURIComponent(document.cookie); 360 var ca = decodedCookie.split(';'); 361 for(var i = 0; i <ca.length; i++) { 362 var c = ca[i]; 363 364 while (c.charAt(0) == ' ') { 365 c = c.substring(1); 366 } 367 if (c.indexOf(name) == 0) { 368 return c.substring(name.length, c.length); 369 } 370 } 371 return ""; 372} 373 374 function search(obj) 375 { 376 $('#hidegooglesearchform [name="q"]').val($('#hidegooglesearchform_query').val()); 377 $('#hidegooglesearchform').submit(); 378 } 379 380 function colsesuccesslb() 381 { 382 $('.submit-success').removeClass('show'); 383 $('.submit-success').remove(); 384 $('.form-btn.clear').click(); 385 var mt = $('.main-navbar .menubar').innerHeight(); 386 $.anchor4({ 387 target: '.contact-form', 388 margintop: mt, 389 390 }); 391 } 392 393 function successlbreload() 394 {
395 setCookie('getanchorafterseccess',1,1); 396 window.location.reload(); 397 } 398 399 function getanchorafterseccess() 400 { 401 if (getCookie('getanchorafterseccess')==1) { 402 var mt = $('.main-navbar .menubar').innerHeight(); 403 $.anchor4({ 404 target: '.subcategory-navbar', 405 margintop: mt, 406 }); 407 setCookie('getanchorafterseccess',0,1); 408 } 409 } 410 411function preventimgrightclick() 412{ 413 if (!preview.test(nowHost)) { 414 $('html').on('contextmenu'/*, 'img[src$=".png"],img[src$=".jpg"]'*/,function(e){ 415 e.preventDefault(); 416 }) 417 } 418} 419 420function forgetsearchquery() 421{ 422 $("#hidegooglesearchform_query").val(''); 423} 424 425$(document).ready(function () { 426 $('.add-list').off(); 427 $('.open_cart').off(); 428 $('.open_simulation').off(); 429 chksharesimulation(); 430 modifycartcount(); 431 $('[remenber]').on('click', 432 function() 433 { 434 item_list_switch(this); 435 } 436 ); 437 getanchorafterseccess(); 438 preventimgrightclick(); 439 forgetsearchquery(); 440 441 // Place this code in the head section of your HTML file 442 (function(r, d, s) { 443 r.loadSkypeWebSdkAsync = r.loadSkypeWebSdkAsync || function(p) { 444 var js, sjs = d.getElementsByTagName(s)[0]; 445 if (d.getElementById(p.id)) { return; } 446 js = d.createElement(s); 447 js.id = p.id; 448 js.src = p.scriptToLoad; 449 js.onload = p.callback 450 sjs.parentNode.insertBefore(js, sjs); 451 }; 452 var p = { 453 scriptToLoad: 'https://swx.cdn.skype.com/shared/v/latest/skypewebsdk.js', 454 id: 'skype_web_sdk' 455 }; 456 r.loadSkypeWebSdkAsync(p); 457 })(window, document, 'script'); 458});
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.