1/** 2 * 3 * ì¹´í¸ í´ëì¤ 4 * 5 * @date 2012-07-27 6 * @author ì´ê¸°ì´ 7 * @type class 8 * 9 **/ 10 11Cart = { 12 checkCount : 0, //ì²´í¬í ìì´í ê°¯ì 13 totalItemCount : 0, //ì¹´í¸ì ë´ê¸´ ìíì 14 //ì²´í¬ë ìì´í ì´ ì¡´ì¬íëì§ ì²´í¬ 15 getCheckCount: function() { 16 // :enabled ì¶ê° 기ì ë³´ê³ ììì ì´ë¯¸ 구매í 기ì ë³´ê³ ìê° ì íëì´ ìê³ (disabled ì´ì§ë§) ë¤ì´ë¡ë ëë ì ë 17 // /pay/order ìì ë©ìì§ ì¶ë ¥ -> Error: order->setCartAttributes 주문ìì´í ì ë³´ê° ì¡´ì¬íì§ ìì. 18 return this.checkCount = $('input:checkbox[name="cartSeq[]"]:checked:enabled').length; 19 }, 20 //ì ì²´ì¹´í¸ìí ê°¯ì 21 getTotalCount: function() { 22 return this.totalItemCount = $('input:checkbox[name="cartSeq[]"]').length; 23 }, 24 /** 25 * ì ì²´ìì´í ì í or í´ì 26 */ 27 checkAll: function() { 28 //set vars : ì ì²´ì í ì²´í¬ë°ì¤, ì²´í¬ ì¬ë¶ 29 var $allSelect = $('#all_select'); 30 var procMode = $allSelect.prop('checked'); 31 //set vars : ì¥ë°êµ¬ë ì²´í¬ë°ì¤ ëª©ë¡ 32 var $cartSeqCheckbox = $('input:checkbox[name="cartSeq[]"]'); 33 34 //모ë°ì¼ê³¼ PCì ì²ë¦¬ë¥¼ ë¶ë¦¬í¨ 35 if (Common.isUrlMobileMode()) { 36 //set vars : ì ì²´ì í ì²´í¬ë°ì¤ ìì 37 var $allSelectArea = $('#allSelectArea'); 38 39 if ($allSelectArea.length > 0) { 40 //ì ì²´ì í ì²´í¬ë°ì¤ì ì²´í¬ìí를 í ê¸í¨(ì²´í¬->ì¸ì²´í¬, ì¸ì²´í¬->ì²´í¬) 41 $allSelect.prop('checked', !procMode); 42 43 //ì ì²´ì í ì²´í¬ë°ì¤ ìì css ì¶ê°/ìì ì²ë¦¬ 44 if (procMode) $allSelectArea.find('span').removeClass('checked'); 45 else $allSelectArea.find('span').addClass('checked'); 46 } 47 48 //ì¥ë°êµ¬ë ìë£ë¥¼ ìííë©° ì²´í¬/ì¸ì²´í¬ ì²ë¦¬ 49 $cartSeqCheckbox.each(function () { 50 $(this).prop('checked', !procMode); 51 if (procMode) $(this).parent().find('span').removeClass('checked'); 52 else $(this).parent().find('span').addClass('checked'); 53 }); 54 } else { 55 //ì¥ë°êµ¬ë ìë£ë¥¼ ìííë©° ì²´í¬/ì¸ì²´í¬ ì²ë¦¬ 56 $cartSeqCheckbox.each(function() { 57 $(this).prop('checked', procMode); 58 }); 59 } 60 61 //ê°ê²©ê°±ì 62 this.updateTotalPrice(); 63 }, 64 //ìì´í ì í ì ì²ë¦¬ 65 checkEach : function() { 66 var selectArea = $('#allSelectArea'); 67 //ì ì²´ì í ì²´í¬ë°ì¤ ì²ë¦¬ 68 if(this.getCheckCount() < this.getTotalCount()) { 69 $('#all_select').attr('checked',false); 70 if(selectArea.length > 0) { 71 selectArea.find('span').removeClass('checked'); 72 } 73 } else { 74 $('#all_select').attr('checked',true); 75 if(selectArea.length > 0) { 76 selectArea.find('span').addClass('checked'); 77 } 78 } 79 //ê°ê²©ê°±ì 80 this.updateTotalPrice(); 81 }, 82 83 checkItem:function(itemSeq) { 84 var item = $('input[type=checkbox][value=' + itemSeq + ']'); 85 item.prop('checked', !item.prop('checked')); 86 if(item.prop('checked')) { 87 item.parent().find('span').addClass('checked'); 88 } else { 89 item.parent().find('span').removeClass('checked'); 90 } 91 92 Cart.checkEach(); 93 }, 94 //ì ë°ì´í¸ ì´ê¸ì¡ ê°±ì 95 updateTotalPrice : function() { 96 var sumPrice = Common.numberFormat(this.selectedItemPrice()); 97 $('#totalPrice').val(sumPrice); 98 if($('#idTotalPrice').length) { 99 $('#idTotalPrice').html(sumPrice); 100 } 101 var sumCount = this.getCheckCount(); 102 if($('#idTotalCount').length) { 103 $('#idTotalCount').html(Common.numberFormat(sumCount)); 104 } 105 }, 106 107 //ì íë ìì´í ê°ê²© ê³ì° 108 selectedItemPrice : function() { 109 var sumPrice = 0; 110 $('input:checkbox[name="cartSeq[]"]:checked').each(function(idx){ 111 var _cartSeq = this.value; 112 sumPrice += parseInt($('input:hidden[name="price['+_cartSeq+']"]').val()); 113 }); 114 return sumPrice; 115 }, 116 //ì íë ìì´í ì ìì íë¤. 117 deleteChoice: function() { 118 if(this.getCheckCount()) { 119 if(confirm('ì ííì ìíì ì¥ë°êµ¬ëìì ìì íìê² ìµëê¹?')) 120 $('#cartForm').attr('action','/cart/removeItem').submit(); 121 } else { 122 alert('ìµìí íëì ìë£ë¥¼ ì íí´ ì£¼ì기 ë°ëëë¤.'); 123 } 124 }, 125 /** 126 * ìíì ì¹´í¸ì ì¶ê°íë¤. 127 * @param refSeq 128 * @returns {boolean} 129 */ 130 addItem: function(refSeq) { 131 var that = this; 132 var isMulti = $('#multi').val(); 133 var params = {}; 134 var productTypeSeq = (typeof arguments[1] != 'undefined') ? arguments[1] : 2; 135 var returnUrl = (typeof arguments[2] != 'undefined' && arguments[2]) ? arguments[2] : encodeURIComponent(document.location.href); 136 var target = (typeof arguments[3] != 'undefined') ? arguments[3] : ''; 137 var confirmCheck=(typeof arguments[4] != 'undefined') ? arguments[4] : 'true'; 138 139 //refSeqê° ëì´ì¨ ê²½ì° ì°ì ì ì¼ë¡ ì¤ì 140 if(typeof refSeq != 'undefined') { 141 params = {refSeq:refSeq,productTypeSeq:productTypeSeq}; 142 } else { 143 if ( $('input:checkbox[name="cartSeq[]"]').length > 0 ) { 144 params = $('input:checkbox[name="cartSeq[]"]:checked').serialize(); 145 } else { 146 params = $('input:checkbox[name="docSeq[]"][data-price!=0]:checked').serialize(); 147 } 148 } 149 150 $.ajax({
151 type: 'post', 152 dataType: 'json', 153 url: '/cart/addItem', 154 data: params, 155 async: false, 156 success: function(json){ 157 if(json != null){ 158 if(json.checkResult == 'ok'){ 159 //ì¹´í¸ì¹´ì´í¸ì ê°±ì 160 $('#top_cart_cnt').html(that.getItemCount()); 161 162 if(confirmCheck=="false") return; 163 164 var userAgent = Common.getUserAgent(); 165 var androidVersion = false; 166 if(userAgent.browser == 'safari'){ 167 androidVersion = Common.getAndroidVersion(); 168 } 169 var cartUrl = '/cart/?ru=' + returnUrl; 170 if(androidVersion !== false){ // ìëë¡ì´ë ë¸ë¼ì°ì Confirm ì°½ì [íì¸]ë§ ì¶ë ¥ëë ì¤ë¥ ë³´ì ì ìí´ì && androidVersion < 4 171 Common.divConfirm('<div style="padding:10px;">' + json.message + '</div>', 264, 100, "if('" + target + "' == 'opener'){ window.close(); $(opener.location).attr('href', '" + cartUrl + "'); }else{ $(location).attr('href','" + cartUrl + "'); }", null, 'padding:10px; border:solid 2px #000;border-radius: 5px;box-shadow: 0px 1px 20px #000;', true); 172 } 173 else{ 174 if( confirm(json.message)) { 175 if(target=='opener'){ 176 window.close(); 177 $(opener.location).attr('href', cartUrl); 178 }else{ 179 $(location).attr('href',cartUrl); 180 } 181 } 182 } 183 } else if(json.checkResult == 'buy'){ 184 if( confirm(json.message) ) { 185 var buyListWin = window.open('/mypage/buyList/','buyListWin'); 186 buyListWin.focus(); 187 } 188 189 } else{ 190 if(json.message != ''){ 191 alert(json.message); 192 } else { 193 alert('ìíì¶ê°ì ì¤í¨íììµëë¤. 문ì ê° ì§ìë ê²½ì° 1:1 ê³ ê°ì¼í°ì 문ìë°ëëë¤.'); 194 } 195 } 196 } 197 }, 198 error: function(xhr, status, error){ 199 Common.ajaxErrorProcess(xhr, status, error); 200 } 201 }); 202 }, 203 //íì¬ì¹´í¸ì ë´ê²¨ì§ ìì´í ê°¯ì ë°í 204 getItemCount : function() { 205 var renew = new Date(); 206 var result = null; 207 if($.ajax({ 208 type: "POST", 209 url: "/cart/getItemCount", 210 data: "renew=" + renew.getTime(), 211 dataType: 'json', 212 async: false, 213 success: function(json) { 214 result = json; 215 } 216 })){ 217 218 } 219 return result.count; 220 }, 221 //ì¹´í¸ìì´í ì¼ë¡ 주문ì를 ìì±íë¤. 222 order : function() { 223 if(arguments.length == 1 && typeof arguments[0] == 'function') { 224 if(!arguments[0]()) return false; 225 } 226 227 //ì íë ìì´í ì´ íê° ì´ì ì¡´ì¬íë ê²½ì°ìë§ ê°ë¥. 228 if(this.getCheckCount()) { 229 $('#cartForm').attr('action','/pay/order'); 230 $('#cartForm').submit(); 231 } else { 232 alert('ìµìí íëì ìë£ë¥¼ ì íí´ ì£¼ì기 ë°ëëë¤.'); 233 } 234 }, 235 236 //ì¶ì²ìë£ ë³´ê¸°/ë«ê¸° 237 toggleRecommendDoc : function() { 238 $(".recommend_data").toggle(); 239 240 if ($("#btnRecommend").length) { //리ë´ì¼ 241 if ($("#btnRecommend").attr("src") == "/images/pay/2013/recommend_open.gif") { 242 $("#btnRecommend").attr("src", "/images/pay/2013/recommend_close.gif"); 243 $("#btnRecommend").attr("alt", "ì¶ì²ìë£ ë«ê¸°"); 244 } else { 245 $("#btnRecommend").attr("src", "/images/pay/2013/recommend_open.gif"); 246 $("#btnRecommend").attr("alt", "ì¶ì²ìë£ ì´ê¸°"); 247 } 248 } else { 249 if ($("#btn_recommend").attr("src") == "/images/cart/btn_recommend_open.gif") { 250 $("#btn_recommend").attr("src", "/images/cart/btn_recommend_close.gif"); 251 $("#btn_recommend").attr("alt", "ì¶ì²ìë£ ë«ê¸°"); 252 } else { 253 $("#btn_recommend").attr("src", "/images/cart/btn_recommend_open.gif"); 254 $("#btn_recommend").attr("alt", "ì¶ì²ìë£ ì´ê¸°"); 255 } 256 } 257 }, 258 259 /** 260 * ìµì ìì 261 * @param funCampusProductSeq 262 * @param funCampusProductOptionSeq 263 */ 264 'changeOrderResult': false, 265 'afterChangeOrderInfo': null, 266 'optionDelete':function(funCampusProductSeq, funCampusProductOptionSeq){ 267 if(confirm('í´ë¹ ìµì ìíì ì ë§ë¡ ìì íìê² ìµëê¹?')) { 268 Cart.changeOrderResult = false; 269 Cart.afterChangeOrderInfo = null; 270 $.ajax({ 271 type: 'post', 272 dataType: 'json', 273 url: '/cart/changeCartOption', 274 data: {'mode': 'delete', 'funCampusProductSeq': funCampusProductSeq, 'funCampusProductOptionSeq': funCampusProductOptionSeq}, 275 async: false, 276 success: function(json){ 277 if(json.errorMsg != ''){ 278 alert(json.errorMsg); 279 } 280 else{ 281 Cart.changeOrderResult = true; 282 Cart.afterChangeOrderInfo = json.afterOrderInfo; 283 } 284 }, 285 error: function(xhr, status, error){ 286 Common.ajaxErrorProcess(xhr, status, error); 287 } 288 }); 289 290 if(Cart.changeOrderResult) { 291 $("#opt" + funCampusProductSeq + '_' + funCampusProductOptionSeq).remove(); 292 // íì¬ ëì ìíì ë¨ììë ìµì ì´ ìë ê²½ì° ìíì체를 ìì 293 if ($('[id^="opt' + funCampusProductSeq + '"]').length == 0) { 294 $('#product' + funCampusProductSeq).remove(); 295 } 296 // ë¨ì ìë ìíì´ ìë ê²½ì° 297 if( $('[id^="product"]').length == 0) { 298 if( $("#blankCart").length > 0 ){ 299 $("#blankCart").show(); 300 } else { 301 $('#cartTable').append('<td colspan="5">ì¥ë°êµ¬ëê° ë¹ì´ììµëë¤.</td>'); 302 } 303 } 304 else{ 305 if(Cart.afterChangeOrderInfo !== null) {
306 $('#ticketCount' + funCampusProductSeq).html(Common.numberFormat(Cart.afterChangeOrderInfo['ticketCount']) + 'ì¥'); 307 $('#deliveryPrice' + funCampusProductSeq).html(((Cart.afterChangeOrderInfo['deliveryPrice'] > 0) ? Common.numberFormat(Cart.afterChangeOrderInfo['deliveryPrice']) + 'ì' : '무ë£')); 308 $('#basePrice' + funCampusProductSeq).html(Common.numberFormat(Cart.afterChangeOrderInfo['basePrice']) + 'ì'); 309 $('#amount' + funCampusProductSeq).html('<strong>' + Common.numberFormat(Cart.afterChangeOrderInfo['amount']) + 'ì</strong>'); 310 } 311 } 312 313 Cart.totalBuyPrice(); 314 } 315 } 316 }, 317 318 /** 319 * ìµì ê°¯ì ìì 320 * @param funCampusProductSeq 321 * @param funCampusProductOptionSeq 322 * @param type 323 * @returns {boolean} 324 */ 325 'changeOrderCount':function(funCampusProductSeq, funCampusProductOptionSeq, type){ 326 var postfix = funCampusProductSeq + '_' + funCampusProductOptionSeq; 327 var salePrice = parseInt($("#salePrice"+funCampusProductSeq).val(),10); 328 var buyLimit = parseInt($("#buyLimit"+funCampusProductSeq).val(), 10); 329 var totalOrderCount = parseInt($("#totalOrderCount"+funCampusProductSeq).val(), 10); 330 var buyCount = parseInt($("#optionCount"+postfix).val(), 10); 331 var defaultCount = parseInt($("#defaultCount"+postfix).val(), 10); 332 333 /* ìµì ì ê°ê²©ì´ ì ë ¥ëì´ ìì ê²½ì° */ 334 if( funCampusProductOptionSeq > 0 && $("#salePrice"+funCampusProductOptionSeq).val() > 0 ){ 335 salePrice = $("#salePrice"+funCampusProductOptionSeq).val(); 336 } else if( funCampusProductSeq > 0 && $("#salePrice"+funCampusProductSeq).val() > 0 ){ 337 salePrice = $("#salePrice"+funCampusProductSeq).val(); 338 } 339 340 switch(type){ 341 case 'up': // íê° ì¦ê° 342 if(buyLimit > 0){ 343 if( buyLimit < (buyCount+1) ){ 344 alert("ìµë 구매ìë " + buyLimit + "ê°ê¹ì§ë§ êµ¬ë§¤ê° ê°ë¥í©ëë¤."); 345 $("#optionCount"+postfix).focus(); 346 return false; 347 } 348 } 349 350 ++buyCount; 351 ++totalOrderCount; 352 break; 353 case 'down': // íê° ë´ë¦¼ 354 if(buyCount <= 1){ 355 return false; 356 } 357 358 --buyCount; 359 --totalOrderCount; 360 break; 361 case 'direct': // ì§ì ì ë ¥í ê²½ì° 362 if(!Common.isNumeric($("#optionCount"+postfix).val())){ // ì«ìë§ ì ë ¥ëì´ì¼ í¨ 363 alert('ì«ìë§ ì ë ¥í´ ì£¼ì¸ì'); 364 $("#optionCount"+postfix).val(defaultCount); // 기본ê°ì¼ë¡ ë³ê²½ 365 $("#optionCount"+postfix).focus(); 366 return false; 367 } 368 369 if(defaultCount == buyCount){ 370 return false; 371 } 372 else{ 373 if(defaultCount < buyCount){ // 기존ê°ë³´ë¤ ì¦ê°í ê²½ì° 374 if(buyLimit > 0){ 375 if( buyLimit < buyCount ){ // (totalOrderCount + (buyCount - defaultCount) 376 alert("ìµë 구매ìë " + buyLimit + "ê°ê¹ì§ë§ êµ¬ë§¤ê° ê°ë¥í©ëë¤."); 377 $("#optionCount"+postfix).val(defaultCount); // 기본ê°ì¼ë¡ ë³ê²½ 378 $("#optionCount"+postfix).focus(); 379 return false; 380 } 381 } 382 } 383 else{ 384 if(buyCount < 1){ 385 $("#optionCount"+postfix).val(defaultCount); // 기본ê°ì¼ë¡ ë³ê²½ 386 return false; 387 } 388 } 389 } 390 break; 391 } 392 393 Cart.changeOrderResult = false; 394 Cart.afterChangeOrderInfo = null; 395 $.ajax({ 396 type: 'post', 397 dataType: 'json', 398 url: '/cart/changeCartOption', 399 data: {'mode': 'orderCount', 'funCampusProductSeq': funCampusProductSeq, 'funCampusProductOptionSeq': funCampusProductOptionSeq, 'orderCount': buyCount}, 400 async: false, 401 success: function(json){ 402 if(json.errorMsg != ''){ 403 alert(json.errorMsg); 404 } 405 else{ 406 Cart.changeOrderResult = true; 407 Cart.afterChangeOrderInfo = json.afterOrderInfo; 408 } 409 }, 410 error: function(xhr, status, error){ 411 Common.ajaxErrorProcess(xhr, status, error); 412 } 413 }); 414 415 if(Cart.changeOrderResult) { 416 $("#optionCount" + postfix).val(buyCount); 417 $("#defaultCount"+postfix).val(buyCount); 418 $("#optionPrice" + postfix).html(Common.numberFormat(salePrice * buyCount) + 'ì'); 419 420 $("#totalOrderCount" + funCampusProductSeq).val(Common.numberFormat(Cart.afterChangeOrderInfo['totalOrderCount'])); 421 $('#ticketCount' + funCampusProductSeq).html(Common.numberFormat(Cart.afterChangeOrderInfo['ticketCount']) + 'ì¥'); 422 $('#deliveryPrice' + funCampusProductSeq).html( ((Cart.afterChangeOrderInfo['deliveryPrice'] > 0) ? Common.numberFormat(Cart.afterChangeOrderInfo['deliveryPrice']) +'ì' : '무ë£') ); 423 $('#basePrice' + funCampusProductSeq).html(Common.numberFormat(Cart.afterChangeOrderInfo['basePrice']) + 'ì'); 424 if( Common.isUrlMobileMode() ){ 425 $('#amount' + funCampusProductSeq).html('<strong>' + Common.numberFormat(Cart.afterChangeOrderInfo['amount']) + 'ì<span class="plus"></span></strong>'); 426 } else { 427 $('#amount' + funCampusProductSeq).html('<strong>' + Common.numberFormat(Cart.afterChangeOrderInfo['amount']) + 'ì</strong>'); 428 } 429 430 Cart.totalBuyPrice(); 431 } 432 }, 433 434 /** 435 * ì ì²´ ìí ì í 436 * @param [type] 437 */ 438 'checkAllProduct': function(type) { 439 /* 모ë°ì¼ ì¥ë°êµ¬ë ì ì²´ ì í */ 440 if( $("#allCheckbox").length > 0 ){ 441 if( $("#allCheckbox").is(':checked') ){ 442 $("span.check_mark").addClass('checked'); 443 $('input:checkbox[name="funCampusProductSeq[]"]').attr('checked', 'checked'); 444 } else { 445 $("span.check_mark").removeClass('checked'); 446 $('input:checkbox[name="funCampusProductSeq[]"]').removeAttr('checked'); 447 } 448 } 449 /* PC */ 450 else { 451 switch(type){ 452 case 'cancel': 453 $('#allCheckboxBtn').show(); 454 $('#allCheckboxBtn2').show(); 455 $('#allCheckCancelBtn').hide(); 456 $('#allCheckCancelBtn2').hide(); 457 $('input:checkbox[name="funCampusProductSeq[]"]').removeAttr('checked'); 458 break; 459 default: 460 $('#allCheckboxBtn').hide(); 461 $('#allCheckboxBtn2').hide(); 462 $('#allCheckCancelBtn').show(); 463 $('#allCheckCancelBtn2').show(); 464 $('input:checkbox[name="funCampusProductSeq[]"]').attr('checked', 'checked'); 465 break; 466 } 467 } 468 469 //ê°ê²©ê°±ì 470 Cart.totalBuyPrice(); 471 }, 472 473 /** 474 * ìí íë ì íì 475 * @param productSeq 476 */ 477 'funCartGoodsSelect':function(productSeq){ 478 if( $("#funCartList"+productSeq).is(':checked') ){ 479 $("#checkMark"+productSeq).addClass('checked'); 480 } else { 481 $("#checkMark"+productSeq).removeClass('checked'); 482 } 483 484 var allChk = true; 485 $('input:checkbox[name="funCampusProductSeq[]"]').each(function(){ 486 if( !$(this).is(':checked') ){ 487 allChk = false; 488 } 489 }); 490 491 /* ì ì²´ê° ì íëì´ ìì¼ë©´ ì ì²´ì í ì²´í¬ */ 492 if( allChk ){ 493 $("#checkMark").addClass('checked'); 494 $('#allCheckbox').attr('checked', 'checked'); 495 } else { 496 $("#checkMark").removeClass('checked'); 497 $('#allCheckbox').removeAttr('checked'); 498 } 499 }, 500 501 /** 502 * íì¬ íìí í°ì¼ ìëì´ ë¶ì¡±íì§ ì¬ë¶ 503 * @returns {boolean} 504 */ 505 'isLessTicket': function(){ 506 var currentTicketCount = parseInt($('#currentTicketCount').text().replace(/[,|ì¥|ê°|ì]/g,''), 10); 507 var totalTicketCount = parseInt($('#totalTicketCount').text().replace(/[,|ì¥|ê°|ì]/g,''), 10); 508 if((currentTicketCount < totalTicketCount)) { 509 $('#needTicketCount').html(Common.numberFormat(totalTicketCount - currentTicketCount)); 510 return true; 511 } 512 return false; 513 }, 514 515 /** 516 * ì íë ìí 주문 517 * @returns {boolean} 518 */ 519 'checkOrderForm': function(){ 520 if($('input:checkbox[name="funCampusProductSeq[]"]:checked').length == 0){ 521 alert('주문í ìíì íê° ì´ì ì íí´ ì£¼ì¸ì'); 522 return false; 523 } 524 525 if(this.isLessTicket()){ 526 alert('í°ì¼ì´ ë¶ì¡±í©ëë¤. ë³´ì í°ì¼ ìì ë§ì¶° ìíì ì íí´ ì£¼ì¸ì.'); 527 $('#lessTicketPopup').show(); 528 $('#lessTicketPopup > a').focus(); 529 return false; 530 } 531 532 return true; 533 }, 534 535 /** 536 * íê°ì ìíì ì¹´í¸ìì ìì íë¤. 537 * @param productSeq 538 */ 539 'thisRemoveProduct':function(productSeq){ 540 /* ì ì²´ ì í ì·¨ì */ 541 $(".check_mark ").removeClass('checked'); 542 $('input:checkbox[name="funCampusProductSeq[]"]').removeAttr('checked'); 543 544 /* í´ë¹ ìí ì í */ 545 $("#checkMark"+productSeq).addClass('checked'); 546 $("#funCartList"+productSeq).attr('checked', 'checked'); 547 548 /* ì í ìí ìì */ 549 Cart.removeProduct(); 550 }, 551 552 /** 553 * ì íë ìí ìì 554 * @returns {boolean} 555 */ 556 'deleteTargetProducts': '', 557 'removeProduct': function(){ 558 // ì²´í¬ë ìí ë²í¸ 559 if($('input:checkbox[name="funCampusProductSeq[]"]:checked').length == 0){ 560 alert('ìì í ìíì ì íí´ ì£¼ì¸ì'); 561 return false; 562 } 563 564 if(confirm('ì ë§ë¡ ìì íìê² ìµëê¹?')) { 565 Cart.deleteTargetProducts = ''; 566 $('input:checkbox[name="funCampusProductSeq[]"]:checked').each(function () { 567 Cart.deleteTargetProducts += ((Cart.deleteTargetProducts == '') ? '' : ',') + $(this).val(); 568 }); 569 570 $('#funCampusProducts').val(Cart.deleteTargetProducts); 571 $('#deleteForm').submit(); 572 } 573 }, 574 575 /** 576 * ì´ ìí ê¸ì¡ ê³ì° 577 */ 578 'totalBuyPrice':function(){ 579 var totalBasePrice = 0; 580 var totalTicketCount = 0; 581 var totalDeliveryFee = 0; 582 var totalSalePrice = 0; 583 584 if($('input:checkbox[name="funCampusProductSeq[]"]:checked').length > 0){ 585 $('input:checkbox[name="funCampusProductSeq[]"]:checked').each(function(){ 586 $('[id^=basePrice' + $(this).val() + ']').each(function(){ 587 totalBasePrice += parseInt($(this).text().replace(/[,|ì¥|ê°|ì]/g,''), 10); 588 }); 589 $('[id^=ticketCount' + $(this).val() + ']').each(function(){ 590 if( Common.trim($(this).text()) != '' ){ 591 totalTicketCount += parseInt($(this).text().replace(/[,|ì¥|ê°|ì]/g,''), 10); 592 } 593 }); 594 $('[id^=amount' + $(this).val() + ']').each(function(){ 595 totalSalePrice += parseInt($(this).text().replace(/[,|ì¥|ê°|ì]/g,''), 10); 596 }); 597 $('[id^=deliveryPrice' + $(this).val() + ']').each(function(){ 598 if($(this).text().indexOf('무ë£') === -1){ 599 totalDeliveryFee += parseInt($(this).text().replace(/[,|ì¥|ê°|ì]/g, ''), 10); 600 } 601 }); 602 }); 603 } 604 605 $('#totalBasePrice').html(Common.numberFormat(totalBasePrice) + '<em>ì</em>'); 606 $('#totalTicketCount').html(Common.numberFormat(totalTicketCount) + '<em>ì¥</em>'); 607 $('#totalDiscountPrice').html(Common.numberFormat(totalBasePrice - totalSalePrice) + '<em>ì</em>'); 608 $('#totalDeliveryFee').html( ((totalDeliveryFee > 0) ? Common.numberFormat(totalDeliveryFee) + '<em>ì</em>' : '무ë£') ); 609 $('#totalAmount').html(Common.numberFormat(totalSalePrice+totalDeliveryFee) + '<em>ì</em>'); 610 611 // í°ì¼ ë¶ì¡± íì¸ ë ì´ì´ ë ¸ì¶ ì¡°ì 612 if(this.isLessTicket()){ 613 $('#guestPossible').val(''); 614 $('#lessTicketPopup').show(); 615 $('#totalTicketCount, #totalDiscountPrice, #totalDeliveryFee, #totalAmount').addClass('cal2'); 616 $('#totalAmount').removeClass('cal4'); 617 $('#totalAmount').addClass('cal3'); 618 $('#lessTicketPopup > a').focus(); 619 } 620 else{ 621 $('#guestPossible').val('y'); 622 $('#lessTicketPopup').hide(); 623 $('#totalTicketCount, #totalDiscountPrice, #totalDeliveryFee, #totalAmount').removeClass('cal2'); 624 $('#totalAmount').addClass('cal4'); 625 $('#totalAmount').removeClass('cal3'); 626 } 627 } 628};
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.