1 2var Amg = (function(amg) { 3 4 amg.Inquiry = (function(inquiry) { 5 6 var _empty; var _handle; 7 inquiry.locateInquiryForm = function() { 8 if(typeof _empty !== "boolean") return; 9 if(_empty) { 10 alert("\nè©¢å¹è»æ²æè³æï¼"); 11 return; 12 } 13 location.href = Amg.getBaseRoot()+'inquiry'; 14 } 15 16 inquiry.setAjaxInfoHandle = function(handle) { 17 _handle = handle; }; 18 19 20 inquiry.loadInfo = function() { 21 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-info", 22 dataType: "json", 23 success: onLoadInfoSuccess }); 24 }; 25 26 inquiry.addOne = function(id, mix_bool_functor) { 27 var callback = null 28 if(mix_bool_functor) { 29 if(typeof mix_bool_functor === "boolean") callback = onAddCartSuccess; 30 if(typeof mix_bool_functor === "function") callback = mix_bool_functor; 31 } 32 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-add", 33 type: "post", 34 data: Amg.Utils.mergeCsrfParams({ id: id, amount: 1 }), 35 dataType: "json", 36 success: callback }); 37 }; 38 39 inquiry.setQty = function(id, qty) { 40 if(isNaN(qty) || qty <= 0) return; 41 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-set", 42 type: "post", 43 data: Amg.Utils.mergeCsrfParams({ id: id, amount: qty }), 44 dataType: "json", 45 success: inquiry.loadInfo }); 46 }; 47 48 inquiry.addItem = function(id, amount, mix_bool_functor) { 49 var callback = null 50 if(mix_bool_functor) { 51 if(typeof mix_bool_functor === "boolean") callback = onAddCartSuccess; 52 if(typeof mix_bool_functor === "function") callback = mix_bool_functor; 53 } 54 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-add", 55 type: "post", 56 data: Amg.Utils.mergeCsrfParams({ id, amount }), 57 dataType: "json", 58 success: callback }); 59 }; 60 61 inquiry.addData = function(data, mix_bool_functor) { var callback = null 62 if(mix_bool_functor) { 63 if(typeof mix_bool_functor === "boolean") callback = onAddCartSuccess; 64 if(typeof mix_bool_functor === "function") callback = mix_bool_functor; 65 } 66 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-add", 67 type: "post", 68 data: Amg.Utils.mergeCsrfParams(data), 69 dataType: "json", 70 success: callback }); 71 }; 72 73 inquiry.removeItem = function(id) { 74 $.ajax({ url: Amg.getBaseRoot()+"inquiry/ajax-remove", 75 type: "post", 76 data: Amg.Utils.mergeCsrfParams({ id }), 77 dataType: "json", 78 success: onRemoveSuccess }); 79 }; 80 81 function onAddCartSuccess(json) { 82 inquiry.loadInfo(); 83 var html = "<div class=\"center\"><h3>ååå·²å å ¥è©¢å¹è»</h3><p>è«é»é¸å³ä¸æ¹è©¢å¹è»å示填寫詢å¹å®</p></div>"; Amg.Utils.showMessageBox(html, null, true); 84 } 85 86 function onRemoveSuccess(json) { 87 inquiry.loadInfo(); 88 } 89 90 function onLoadInfoSuccess(json) { 91 _empty = isNaN(json.quantity) || parseInt(json.quantity) <= 0; 92 if(typeof _handle === "function") 93 _handle(json); 94 } 95 96 97 inquiry.changeContextSubmit = function(action, params) { 98 Amg.Utils.submitTaskForm(action, params); 99 }; 100 101 inquiry.changeProcessSubmit = function(action) { 102 var form = document.forms["inquiry_form"]; form.method = "POST"; 103 form.action = action; 104 form.submit(); 105 }; 106 107 108 return inquiry; 109 110 }(amg.Inquiry || {})); 111 112 return amg; 113 114}(Amg || {})); 115
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.