1$(document).ready(function () { 2 3 var cheerShopUI = new CheerShopUI(); 4 5 var activeCouponCode = function (activeCode) { 6 if (!activeCode || typeof(activeCode) !== 'string' && activeCode.length === 0) { 7 cheerShopUI.dialog({ 8 title: 'è¨æ¯', 9 message: 'è«è¼¸å ¥åªæ 代碼', 10 btnText: 'éé' 11 }); 12 } else { 13 cheerShopSDK.activeCoupon(activeCode, function (error, result, statusCode) { 14 if (statusCode === 201) { 15 cheerShopUI.dialog({ 16 title: 'è¨æ¯', 17 message: 'åªæ å·é å宿', 18 btnText: 'éé' 19 }); 20 } else if (statusCode === 409) { 21 cheerShopUI.dialog({ 22 title: 'è¨æ¯', 23 message: 'åªæ 代碼已ç¶é åéå', 24 btnText: 'éé' 25 }); 26 } else if (statusCode === 404) { 27 cheerShopUI.dialog({ 28 title: 'è¨æ¯', 29 message: 'åªæ ä»£ç¢¼ä¸æ£ç¢º', 30 btnText: 'éé' 31 }); 32 } else if (statusCode === 401) { 33 cheerShopUI.dialog({ 34 title: 'è¨æ¯', 35 message: 'è«å ç»å ¥æå¡', 36 btnText: 'éé' 37 }); 38 } 39 if (typeof(COUPON_CALLBACK) === 'function') { 40 COUPON_CALLBACK(error, result, statusCode); 41 } 42 }); 43 } 44 }; 45 46 // é å· 47 $('.btn-coupon-active').click(function () { 48 var activeCode = $(this).parents('div:first').find('input.coupon-active-code').val(); 49 activeCouponCode(activeCode); 50 }); 51 52 // onfocus 53 $('.coupon-active-code').blur(function () { 54 var activeCode = $(this).val(); 55 activeCouponCode(activeCode); 56 }); 57 58});
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.