1/** 2 * This is commercial software, only users who have purchased a valid license 3 * and accept to the terms of the License Agreement can install and use this 4 * program. 5 * 6 * Do not edit or add to this file if you wish to upgrade Godomall5 to newer 7 * versions in the future. 8 * 9 * ê³µì© ì¤í¬ë¦½í¸ ë° íë¡í íì ì ì 10 * 11 * @copyright â 2016, NHN godo: Corp. 12 * @link http://www.godo.co.kr 13 */ 14 15 16/** 17 * ìë°ì¤í¬ë¦½í¸ Trimí¨ì 18 * 19 * @deprecated ìë°ì¤í¬ë¦½í¸ 기본 í¨ì í¹ì $.trim() ì¬ì© 20 * @return string ì¢ì° 공백 ì ê±°í 문ìì´ 21 */ 22//String.prototype.trim = function () { 23// return this.replace(/^\s+|\s+$/, ''); 24//}; 25 26/** 27 * ìë°ì¤í¬ë¦½í¸ number_format í¨ì 28 * 29 * @deprecated numeralë¡ ëì²´ 30 * @return string 문ìì´ì ì¸ì리 ë¨ìë¡ ì¼í ì°ê¸° 31 */ 32//String.prototype.number_format = function() 33//{ 34// return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,'); 35//}; 36 37// ë©í°ìì ë³ì 기본ì²ë¦¬ 38if (typeof gdCurrencyDecimalFormat === 'undefined') { 39 gdCurrencyDecimal = 0; 40 gdCurrencyDecimalFormat = 0; 41} 42 43// IE9ìì console ê°ì²´ê° ìì´ console ê°ì²´ê° ìë ê²½ì° logë¡ ì¬ì©íëë¡ ì²ë¦¬ 44if (!window.console) console = { 45 log: function () { 46 } 47}; 48 49// IE8 ì´íìì Array.indexOf ì§ìíì§ ìë ê²½ì°ì ëí ëì 50if (typeof Array.prototype.indexOf !== 'function') { 51 Array.prototype.indexOf = function (ele) { 52 return $.inArray(ele, this); 53 }; 54} 55 56// IE8 ì´íìì String.trim ì§ìíì§ ìë ê²½ì°ì ëí ëì 57if (typeof String.prototype.trim !== 'function') { 58 String.prototype.trim = function(){ 59 return $.trim(this); 60 }; 61} 62 63// @qnibus bugfix. toFixed ì¬ì©ì 무조건 ë°ì¬ë¦¼ ì²ë¦¬íë ë¶ë¶ì¼ë¡ ì¸í´ ê³ ë몰5ì ì ì± ê³¼ ë§ì§ ììì toFixed ëì ì¬ì©í´ì¼ í¨ 64if (typeof Number.prototype.toRealFixed !== 'function') { 65 Number.prototype.toRealFixed = function (digits, format) { 66 if (typeof digits === 'undefined') { 67 digits = gdCurrencyDecimal; 68 } 69 if (typeof format === 'undefined') { 70 format = gdCurrencyDecimalFormat; 71 } 72 73 _value = this.valueOf(); 74 if(/[9]{9}/g.test(_value)) _value = _value.toFixed(9); 75 return numeral(Math.floor( _value * Math.pow(10, digits)) / Math.pow(10, digits)).format('0,' + format); 76 }; 77} 78 79/** 80 * ì¤í¸ë§ ì¹í ë©ìë 81 * @returns {String} 82 */ 83String.prototype.format = function () { 84 var formatted = this; 85 for (var i = 0; i < arguments.length; i++) { 86 formatted = formatted.replace("{" + i + "}", arguments[i]); 87 } 88 return formatted; 89}; 90 91/** 92 * DOM ë¡ë 93 */ 94$(document).ready(function () { 95 96 // IE 9 ì´í placeholder ì²ë¦¬ 97 if (gd_is_ie() < 10) { 98 $("input, textarea").placeholder(); 99 100 $('form').submit(function(e){ 101 $(this).find("input, textarea").each(function(){ 102 var _name = this.name; 103 var _placeholder = this.getAttribute('placeholder'); 104 105 if (_name && _placeholder) { 106 var _target = document.getElementsByName(_name)[0]; 107 if (_target.value == _placeholder) { 108 _target.value = ''; 109 } 110 } 111 }); 112 }); 113 } 114 115 // jQuery Validator ê¸°ë³¸ê° ì¤ì 116 $.validator.setDefaults({ 117 onfocusout: false, 118 onclick: false, 119 onkeyup: false, 120 errorPlacement: function (error, element) { 121 // do nothing 122 }, 123 invalidHandler: function (form, validator) { 124 var errors = validator.numberOfInvalids(); 125 if (errors) { 126 alert(validator.errorList[0].message); 127 validator.errorList[0].element.focus(); 128 } 129 }, 130 submitHandler: function (form) { 131 form.submit(); 132 } 133 }); 134 135 // jQuery Validator 기본 ë©ìì§ ì¤ì 136 jQuery.extend(jQuery.validator.messages, { 137 required: __("íìí목 ì ëë¤."), 138 remote: __("ì´ íë를 ìì í´ì£¼ì¸ì."), 139 email: __("ì´ë©ì¼ì ì ííê² ì ë ¥í´ì£¼ì¸ì."), 140 url: __("ì í¨íì§ ìì URLì´ ì ë ¥ëììµëë¤."), 141 date: __("ë ì§íìì´ ë§ì§ ììµëë¤."), 142 dateISO: __("ì í¨í ISO íì ì ë ì§ë¡ ë¤ì ì ë ¥í´ì£¼ì¸ì."), 143 number: __("ì«ìë§ ì ë ¥íì¤ ì ììµëë¤."), 144 digits: __("ì«ìë§ ì ë ¥íì¤ ì ììµëë¤."), 145 creditcard: __("ì í¨í ì ì©ì¹´ë ë²í¸ë¡ ë¤ì ì ë ¥í´ì£¼ì¸ì."), 146 equalTo: __("ëì¼í ê°ì ì ë ¥í´ì£¼ì¸ì."), 147 accept: "Please enter a value with a valid extension.", 148 maxlength: jQuery.validator.format(__("ìµë %i ì´í ì ë ¥í´ ì£¼ì¸ì.", "{0}")), 149 minlength: jQuery.validator.format(__("ìµì %i ì´ì ì ë ¥í´ ì£¼ì¸ì.", "{0}")), 150 rangelength: jQuery.validator.format(__("%1$iììì %2$iê¹
150ì§ ì ë ¥ê°ë¥í©ëë¤.", ["{0}", "{1}"])), 151 range: jQuery.validator.format(__("%1$iì %2$iì¬ì´ì ì«ì를 ì ë ¥í´ì£¼ì¸ì.", ["{0}", "{1}"])), 152 max: jQuery.validator.format(__("ìµë %i ì´ì ì ë ¥íì¤ ì ììµëë¤.", "{0}")), 153 min: jQuery.validator.format(__("ìµì %i ì´í ì ë ¥íì¤ ì ììµëë¤.", "{0}")) 154 }); 155 156 //ê²ìì´ 157 $("#frmSearchTop").validate({ 158 submitHandler: function (form) { 159 if ($("#frmSearchTop input[name='adUrl']").val() && $("#frmSearchTop input[name='keyword']").val() == '') document.location.href = $("#frmSearchTop input[name='adUrl']").val(); 160 else form.submit(); 161 }, 162 rules: { 163 keyword: { 164 required: function () { 165 166 if ($("#frmSearchTop input[name='adUrl']").val()) { 167 return false;o 168 } 169 else { 170 return true; 171 } 172 } 173 } 174 }, 175 messages: { 176 keyword: { 177 required: __('ê²ìì´ë¥¼ ì ë ¥íì¸ì.') 178 } 179 } 180 }); 181 182 // ìµê·¼ ê²ìì´ ìì 183 $('.btn_top_search_del').click(function(e){ 184 e.stopPropagation(); 185 $self = $(this); 186 $.post('../goods/goods_ps.php', { 187 'mode': 'delete_recent_keyword', 188 'keyword': $(this).data('recent-keyword') 189 }, function (data, status) { 190 // ê°ì´ ìë ê²½ì° ì±ê³µ 191 if (status == 'success' && data == '') { 192 if ($self.closest('ul').find('li').length == 1) { 193 $self.closest('li').remove(); 194 $('.btn_top_search_all_del').remove(); 195 $('.js_recent_area').append('<dd>' + __('ìµê·¼ ê²ìì´ê° ììµëë¤.') + '</dd>'); 196 } else { 197 $self.closest('li').remove(); 198 } 199 } else { 200 console.log('request fail. ajax status (' + status + ')'); 201 } 202 }); 203 }); 204 205 // ìµê·¼ ê²ìì´ ì ì²´ ìì 206 $('.btn_top_search_all_del').click(function(e){ 207 $.post('../goods/goods_ps.php', { 208 'mode': 'delete_recent_all_keyword' 209 }, function (data, status) { 210 // ê°ì´ ìë ê²½ì° ì±ê³µ 211 if (status == 'success' && data == '') { 212 $('.js_recent_list').find('li').remove() 213 $('.btn_top_search_all_del').remove(); 214 $('.js_recent_area').append('<dd>' + __('ìµê·¼ ê²ìì´ê° ììµëë¤.') + '</dd>'); 215 } else { 216 console.log('request fail. ajax status (' + status + ')'); 217 } 218 }); 219 }); 220 221 // Ajax ìë¬ ë° ì²ë¦¬ ê¸°ë³¸ê° ì¤ì 222 $.ajaxSetup({ 223 beforeSend: function (xhr, settings) { 224 xhr.url = settings.url; 225 xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); 226 }, 227 complete: function () { 228 gd_trigger_checkbox_ui(); 229 gd_select_remodeling(); 230 gd_checkbox_all(); 231 232 //ì´ë¯¸ì§ ë¡ë© í¥ì ì¬ì© ì í¸ì¶. 233 if ($.isFunction($.fn.lazyload) === true) { 234 setTimeout(function() { 235 $("img.gd_image_lazy").lazyload({threshold:200}); 236 }, 1); 237 } 238 }, 239 error: function (xhr, textStatus, error) { 240 if (xhr.status == '404' && error == 'Not Found') { 241 console.log('[404 Not Found]\nThe requested URL was not found.'); 242 } 243 else if (xhr.status == '500' && error == 'Internal Server Error' && xhr.responseText != '') { 244 console.log(xhr.responseText); 245 } 246 gd_close_layer(); 247 } 248 }); 249 250 $(document).on('click', '.btn_alert_login', function (e) { 251 var target = $(this).attr('id'); 252 e.preventDefault(); 253 alert(__('ë¡ê·¸ì¸íì ì¼ ë³¸ ìë¹ì¤ë¥¼ ì´ì©íì¤ ì ììµëë¤.')); 254 document.location.href = target == undefined ? "../member/login.php" : "../member/login.php?id=" + target; 255 return false;
256 }); 257 258 // 미íì¸ ì ê¸ì íì 259 $('#ghostDepositorBanner').click(function () { 260 var url = '/service/popup_ghost_depositor.php'; 261 var win = gd_popup({ 262 url: url 263 , target: 'ghostDepositorPopup' 264 , width: 630 265 , height: 560 266 , resizable: 'no' 267 , scrollbars: 'no' 268 }); 269 win.focus(); 270 return win; 271 }); 272 273 if ($('.btn_prev').length > 0) { 274 $('.btn_prev').click(function (e) { 275 e.preventDefault(); 276 history.go(-1); 277 }); 278 } 279 280 // ë³µì¬ ê¸°ë¥ 281 // https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/api/ZeroClipboard.md 282 if ($('.gd_clipboard').length) { 283 if (navigator.userAgent.match(/MSIE 8/) !== null) { 284 $('.gd_clipboard').each(function () { 285 $(this).click(function () { 286 alert(__("주ì를 ëëê·¸ í´ì ë³µì¬í´ì£¼ì¸ì")); 287 return false; 288 }); 289 }); 290 } else { 291 var clipboard = new Clipboard('.gd_clipboard'); 292 clipboard.on('success', function (e) { 293 var title = $(e.trigger).attr('title') == undefined ? '' : $(e.trigger).attr('title'); 294 alert('[' + title + '] '+__('ì 보를 í´ë¦½ë³´ëì ë³µì¬íìµëë¤.\nCtrl+V를 ì´ì©í´ì ì¬ì©íì¸ì.')); 295 e.clearSelection(); 296 }); 297 clipboard.on('error', function (e) { 298 console.error('Action:', e.action); 299 console.error('Trigger:', e.trigger); 300 }); 301 } 302 } 303}); 304 305// @qnibus bugfix. toFixed ì¬ì©ì 무조건 ë°ì¬ë¦¼ ì²ë¦¬íë ë¶ë¶ì¼ë¡ ì¸í´ ê³ ë몰5ì ì ì± ê³¼ ë§ì§ ììì toFixed ëì ì¬ì©í´ì¼ í¨ 306if (typeof Number.prototype.toRealFixed !== 'function') { 307 Number.prototype.toRealFixed = function (digits, format) { 308 if (typeof digits === 'undefined') { 309 digits = gdCurrencyDecimal; 310 } 311 if (typeof format === 'undefined') { 312 format = gdCurrencyDecimalFormat; 313 } 314 315 return numeral(Math.floor(this.valueOf() * Math.pow(10, digits)) / Math.pow(10, digits)).format('0,' + format); 316 }; 317} 318 319/** 320 * 기ì¤íí íì¨ë³í 321 * 322 * @param price ê¸ì¡ 323 * @param isFormat í¬ë§·ì¬ë¶ 324 * @returns {*} 325 */ 326function gd_money_format(price, isFormat) { 327 var convertPrice = fx.convert(price).toRealFixed(); 328 if (typeof isFormat !== 'undefined') { 329 if (isFormat) { 330 return numeral().unformat(convertPrice); 331 } 332 } 333 334 return convertPrice; 335} 336 337/** 338 * ì¶ê°íí íì¨ë³í 339 * 340 * @param price ê¸ì¡ 341 * @param isFormat í¬ë§·ì¬ë¶ 342 * @returns {*} 343 */ 344function gd_add_money_format(price, isFormat) { 345 var convertPrice = fx.convert(price, {to: gdCurrencyAddCode}).toRealFixed(gdCurrencyAddDecimal, gdCurrencyAddDecimalFormat); 346 if (typeof isFormat !== 'undefined') { 347 if (isFormat) { 348 return numeral().unformat(convertPrice); 349 } 350 } 351 352 return convertPrice; 353} 354 355/** 356 * ìëì°íì í¸ì¶ 357 * @param array options ì°½ì ë³´ 358 * @return object Window ê°ì²´ 359 */ 360function gd_popup(options) { 361 if (!options.width) options.width = 500; 362 if (!options.height) options.height = 415; 363 var status = new Array(); 364 $.each(options, function (i, v) { 365 if ($.inArray(i, ['url', 'target']) == '-1') { 366 status.push(i + '=' + v); 367 } 368 }); 369 var status = status.join(','); 370 var win = window.open(options.url, options.target, status); 371 return win; 372} 373 374/** 375 * íµì í매ì¬ì ì ìì¸ì¡°íì°½ 376 * @param string businessNo ì¬ì ì ë²í¸ 377 * @return 378 */ 379function gd_popup_bizInfo(businessNo) { 380 var url = 'http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no=' + businessNo; 381 var win = gd_popup({ 382 url: url 383 , target: 'communicationViewPopup' 384 , width: 750 385 , height: 700 386 , resizable: 'no' 387 , scrollbars: 'yes' 388 }); 389 win.focus(); 390 return win; 391} 392/** 393 * ì¿ í¤ ìì± 394 */ 395function createCookie(name, value, days) { 396 var expires; 397 if (days) { 398 var date = new Date(); 399 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 400 expires = "; expires=" + date.toGMTString(); 401 } else { 402 expires = ""; 403 } 404 document.cookie = name + "=" + value + "; path=/; expires=" + expires + ";"; 405} 406/** 407 * íì ì°½ Cookie 컨í¸ë¡¤ 408 * @param string name íì ì°½ ì´ë¦ (ì½ë_ì°½ì¢ ë¥) 409 * @param object elemnt elemnt 410 * @return 411 */ 412function gd_popup_cookie(name, elemnt) { 413 if (elemnt.checked === true) { 414 createCookie(name,'true',1); 415 var popupKind = name.split('_'); 416 if (popupKind[1] == 'window') { 417 setTimeout('self.close()'); 418 } else { 419 setTimeout("$('#" + name + "').hide()"); 420 } 421 } else { 422 createCookie(name, null); 423 } 424 return; 425} 426 427/** 428 * ë©ì¼ ëë©ì¸ ì í 429 */ 430function gd_select_email_domain(name,select) { 431 if (typeof select === 'undefined') { 432 select = 'emailDomain'; 433 } 434 var $email = $(':text[name=' + name + ']'); 435 var $emailDomain = $('select[id='+select+']'); 436 $emailDomain.on('change', function (e) { 437 var emailValue = $email.val(); 438 var indexOf = emailValue.indexOf('@'); 439 if (indexOf == -1) { 440 if ($emailDomain.val() === 'self') { 441 $email.val(emailValue + '@'); 442 } else { 443 $email.val(emailValue + '@' + $emailDomain.val()); 444 } 445 $email.trigger('focusout'); 446 } else { 447 if ($emailDomain.val() === 'self') { 448 $email.val(emailValue.substring(0, indexOf + 1)); 449 $email.focus(); 450 } else { 451 $email.val(emailValue.substring(0, indexOf + 1) + $emailDomain.val()); 452 $email.trigger('focusout'); 453 } 454 } 455 }); 456} 457 458/** 459 * ëë¡ëª 주ì 찾기 (íì ) 460 * 461 * @author artherot 462 * @param string zoneCodeID zonecode input ID 463 * @param string addrID address input ID 464 * @param string zipCodeID zipcode input ID 465 */ 466function gd_postcode_search(zoneCodeID, addrID, zipCodeID) { 467 var win = gd_popup({ 468 url: '../share/postcode_search.php?zoneCodeID=' + zoneCodeID + '&addrID=' + addrID + '&zipCodeID=' + zipCodeID, 469 target: 'postcode', 470 width: 540, 471 height: 700, 472 resizable: 'yes', 473 scrollbars: 'yes' 474 }); 475 win.focus(); 476 return win; 477} 478 479/** 480 * ë¹íì ê°ì¸ì ë³´ ìì§í목 ëì ë§í¬ 481 */ 482function gd_redirect_collection_agree() { 483 window.open('/service/private.php'); 484} 485 486/** 487 * íì¼ ì ë¡ë ê°ì²´ 488 */ 489var gdAjaxUpload = { 490 upload : function(data) { 491 var formData = new FormData(); 492 for (var k in data.params){ 493 if (data.params.hasOwnProperty(k)) { 494 formData.append(k, data.params[k]); 495 } 496 } 497 if(data.onbeforeunload){ 498 window.onbeforeunload = data.onbeforeunload; 499 data.formObj.on("submit", function () { 500 window.onbeforeunload = null; 501 }); 502 } 503 504 if(data.formObj.find('[name=uploadType][value=ajax]').length < 1) { 505 data.formObj.append('<input type="hidden" name="uploadType" value="ajax" >'); 506 }
507 var index = data.thisObj.closest('form').find('input:file').index(data.thisObj); 508 formData.append('uploadFile', data.thisObj[0].files[0]); 509 510 $.ajax({ 511 url: data.actionUrl, 512 type: 'POST', 513 data: formData, 514 async: false, 515 cache: false, 516 contentType: false, 517 processData: false, 518 dataType: 'json', 519 success: function (returnData) { 520 returnData['index'] = index; 521 if(returnData.result == 'ok') { 522 if ($('input[name="uploadFileNm[' + index + ']"]').length == 0) { 523 data.formObj.append("<input type='hidden' name='uploadFileNm[" + index + "]' value='" + returnData.uploadFileNm + "'>"); 524 data.formObj.append("<input type='hidden' name='saveFileNm[" + index + "]' value='" + returnData.saveFileNm + "'>"); 525 } 526 else { 527 $("input[name='uploadFileNm[" + index + "]']").val(returnData.uploadFileNm); 528 $("input[name='saveFileNm[" + index + "]']").val(returnData.saveFileNm); 529 } 530 if(typeof data.successAfter == 'function') { 531 data.successAfter(returnData); 532 } 533 } 534 else if(returnData.result == 'cancel'){ 535 if ($("input[name='uploadFileNm[" + index + "]']").length > 0) { 536 $("input[name='uploadFileNm[" + index + "]']").remove(); 537 $("input[name='saveFileNm[" + index + "]']").remove(); 538 } 539 } 540 else { 541 gdAjaxUpload.isSuccess = false; 542 $('label[for=attach' + (index + 1) + '] .text').val(''); //íì¼ìì¤í í ì¤í¸ ë¹ê° ì²ë¦¬ 543 alert(returnData.errorMsg); 544 if(typeof data.failAfter == 'function') { 545 data.failAfter(returnData); 546 } 547 } 548 } 549 }); 550 } 551}; 552 553/** 554 * íë ì 리ì¬ì´ì¦ 555 */ 556function gd_resize_frame(obj) { 557 var iframeHeight = (obj).contentWindow.document.body.clientHeight; 558 (obj).height = iframeHeight + 80; 559} 560 561/** 562 * íìë¤ì´ë¡ë ì¿ í° ë§í¬ ë¤ì´ ë°ê¸° 563 * 564 * @param couponNo 565 */ 566function couponLinkDown(couponNo) { 567 var params = { 568 mode: "couponDownLink", 569 couponCode: couponNo 570 }; 571 $.ajax({ 572 method: "POST", 573 async: false, 574 cache: false, 575 url: "/mypage/coupon_link_down.php", 576 data: params, 577 success: function (data) { 578 result = JSON.parse(data); 579 alert(result['msg']); 580 if (result['code'] == '0') { 581 document.location.href = "/member/login.php"; 582 } 583 }, 584 error: function (data) { 585 alert(result['msg']); 586 } 587 }); 588} 589 590/** 591 * PG ê´ë ¨ ììì¦ ë³´ê¸° 592 * 593 * @author artherot 594 * @param string modeStr ì¹´ë, íê¸ììì¦ ì¢ ë¥ (card, cash) 595 * @param string orderNo 주문 ë²í¸ 596 */ 597function gd_pg_receipt_view(modeStr, orderNo) { 598 // ì¬ì´ì¦ë¥¼ 미리 ì¤ì - ìëì¼ë¡ ì°½ì´ ì»¤ì§ì§ ìì 미리 ì¤ì í¨ 599 var preWidth = 430; 600 var preHeight = 700; 601 602 // 미리 íì ì°½ì ëì°ê¸° 603 var prePopupData = { 604 'url': 'about:blank', 605 'target': 'show_receipt', 606 'width': preWidth, 607 'height': preHeight 608 }; 609 var show_receipt = gd_popup(prePopupData); 610 611 // ê° PGë³ ììì¦ íì ì°½ 612 $.post('../share/show_receipt.php', { 613 mode: modeStr, 614 orderNo: orderNo 615 }, function (data) { 616 var infoData = data; 617 if (typeof infoData['error'] == 'undefined') { 618 gd_popup(infoData); 619 } 620 else { 621 alert(infoData['error']); 622 show_receipt.close(); 623 } 624 }, 'json'); 625} 626 627/*** IE ë²ì ì²´í¬ ***/ 628function gd_is_ie () { 629 var nav = navigator.userAgent.toLowerCase(); 630 if (nav.indexOf('msie') != -1) { 631 return parseInt(nav.split('msie')[1]); 632 } else { 633 return false;
634 } 635} 636 637/** 638 * 쿼리ì¤í¸ë§ê° 찾기 639 * @param query 640 * @param variable 641 * @returns {string} 642 */ 643function gd_get_query_variable(query, variable) { 644 var vars = query.split('&'); 645 for (var i = 0; i < vars.length; i++) { 646 var pair = vars[i].split('='); 647 if (decodeURIComponent(pair[0]) == variable) { 648 return decodeURIComponent(pair[1]); 649 } 650 } 651 console.log('Query variable %s not found', variable); 652} 653 654/** 655 * ëì ì¤í¬ë¦½í¸ ë°ì¸ë© (ì¤í¬ë¦½í¸ ë¡ë© í ë©ìë ì¤íëëë¡ ì²ë¦¬) 656 * 657 * @author Jong-tae Ahn 658 * @param number 659 * @param places 660 * @param symbol 661 * @param thousand 662 * @param decimal 663 * @returns {string} 664 */ 665function add_script(url, callback) { 666 var done = false; // ì¤í¬ë¦½í¸ ë¡ë© ì¬ë¶ 667 var head = document.getElementsByTagName("head")[0] || document.documentElement; 668 var script = document.createElement("script"); 669 670 //script.charset = 'UTF-8'; 671 script.src = url; 672 script.onload = script.onreadystatechange = function () { 673 if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { 674 done = true; 675 callback(); 676 677 // IEìì ë©ëª¨ë¦¬ ëì ë°©ì§ë¥¼ ìí ì²ë¦¬ 678 script.onload = script.onreadystatechange = null; 679 if (head && script.parentNode) { 680 head.removeChild(script); 681 } 682 } 683 }; 684 685 // Use insertBefore instead of appendChild to circumvent an IE6 bug. 686 // This arises when a base node is used (#2709 and #4378). 687 head.insertBefore(script, head.firstChild); 688} 689 690 691 692 693/*** ì¤í ë¦¬ì§ ì§ì ì¬ë¶ ***/ 694function supports_html5_storage() { 695 try { 696 return 'localStorage' in window && window['localStorage'] !== null; 697 } catch (e) { 698 return false; 699 } 700} 701 702/*** ì¸ì ì¤í ë¦¬ì§ ì ì¥ ***/ 703function saveSession(control_key, control_value) { 704 if (!supports_html5_storage()) { 705 createCookie(control_key, control_value, 7); 706 } else { 707 sessionStorage[control_key] = control_value; 708 } 709}; 710 711/*** ì¸ì ì¤í ë¦¬ì§ ë¡ë ***/ 712function loadSession(control_key) { 713 var control_value; 714 if (!supports_html5_storage()) { 715 control_value = readCookie(control_key); 716 } else { 717 control_value = sessionStorage[control_key]; 718 } 719 return control_value; 720}; 721 722/*** ë¡ì»¬ ì¤í ë¦¬ì§ ì ì¥ ***/ 723function saveVal(control_key, control_value) { 724 if (!supports_html5_storage()) { 725 createCookie(control_key, control_value, 7); 726 } else { 727 localStorage.setItem(control_key, control_value); 728 } 729}; 730 731/*** ë¡ì»¬ ì¤í ë¦¬ì§ ë¡ë ***/ 732function loadVal(control_key) { 733 var control_value; 734 if (!supports_html5_storage()) { 735 control_value = readCookie(control_key); 736 } else { 737 control_value = localStorage.getItem(control_key); 738 } 739 return control_value; 740};
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.