1//**** uncheck_box *************************************** 2// Performs ajax call to remove a reminder from an order 3// checklist. Also creates spinner. 4//******************************************************** 5function uncheck_box(order_id, check_id) 6{ 7 //alert('uncheck: ' + order_id + " - " + check_id); 8 var cb_id = "cb_" + order_id + "_" + check_id; 9 var cb = document.getElementById(cb_id); 10 cb.innerHTML = "<i class='fas fa-spinner fa-pulse'></i>"; 11 12 make_ajax_call("/ajax_query/","cmd=uncheck_checklist&order=" + encodeURIComponent(order_id) 13 + "&check=" + encodeURIComponent(check_id), 14 "uncheck_callback"); 15} 16 17//**** check_box ***************************************** 18// Performs ajax call to add a reminder to an order 19// checklist. Also creates spinner. 20//******************************************************** 21function check_box(order_id, check_id) 22{ 23 //alert('check: ' + order_id + " - " + check_id); 24 var cb_id = "cb_" + order_id + "_" + check_id; 25 var cb = document.getElementById(cb_id); 26 cb.innerHTML = "<i class='fas fa-spinner fa-pulse'></i>"; 27 28 make_ajax_call("/ajax_query/","cmd=check_checklist&order=" + encodeURIComponent(order_id) 29 + "&check=" + encodeURIComponent(check_id), 30 "check_callback"); 31} 32 33//**** check_callback ************************************ 34// If successful, it checks the checkbox, and updates the 35// color. If fail, it returns the checkbox to the 36// unchecked state. 37//******************************************************** 38function check_callback(rsp) 39{ 40 var order_id = decodeURIComponent(rsp['order']); 41 var check_id = decodeURIComponent(rsp['check']); 42 43 var cb_id = "cb_" + order_id + "_" + check_id; 44 var cb = document.getElementById(cb_id); 45 46 if (rsp['success']==1) 47 { 48 var str = ""; 49 for (var prop in rsp) 50 { 51 str += prop + ": " + decodeURIComponent(rsp[prop]) +"\n"; 52 } 53 //alert(str); 54 55 //update the two fields: 56 var dbox_id = "d_" + order_id + "_" + check_id; 57 var dbox = document.getElementById(dbox_id); 58 59 cb.innerHTML = "<i class='fas fa-check-square'></i>"; 60 61 cb.onclick = function() { 62 uncheck_box(order_id, check_id); 63 } 64 65 var color = dbox.style.color; 66 dbox.style.color = dbox.style.backgroundColor; 67 dbox.style.backgroundColor = color; 68 dbox.style.border = ""; 69 70 } 71 else 72 { 73 cb.innerHTML = "<i class='far fa-square'></i>"; 74 var str = ""; 75 for (var prop in rsp) 76 { 77 str += prop + ": " + decodeURIComponent(rsp[prop]) +"\n"; 78 } 79 alert ("Unable to update checklist.\n" + str); 80 } 81} 82 83//**** uncheck_callback ********************************** 84// If successful, it unchecks the checkbox, and updates the 85// color. If fail, it returns the checkbox to the 86// checked state. 87//******************************************************** 88function uncheck_callback(rsp) 89{ 90 var order_id = decodeURIComponent(rsp['order']); 91 var check_id = decodeURIComponent(rsp['check']); 92 93 var cb_id = "cb_" + order_id + "_" + check_id; 94 var cb = document.getElementById(cb_id); 95 96 if (rsp['success']==1) 97 { 98 var str = ""; 99 for (var prop in rsp) 100 { 101 str += prop + ": " + decodeURIComponent(rsp[prop]) +"\n"; 102 } 103 //alert(str); 104 105 //update the two fields: 106 var dbox_id = "d_" + order_id + "_" + check_id; 107 var dbox = document.getElementById(dbox_id); 108 109 cb.innerHTML = "<i class='far fa-square'></i>"; 110 111 cb.onclick = function() { 112 check_box(order_id, check_id); 113 } 114 115 var color = dbox.style.color; 116 dbox.style.color = dbox.style.backgroundColor; 117 dbox.style.backgroundColor = color; 118 dbox.style.border = "1px solid #777777"; 119 } 120 else 121 { 122 cb.innerHTML = "<i class='fas fa-check-square'></i>"; 123 var str = ""; 124 for (var prop in rsp) 125 { 126 str += prop + ": " + decodeURIComponent(rsp[prop]) +"\n"; 127 } 128 alert ("Unable to update checklist.\n" + str); 129 } 130} 131 132//**** toggle_checkboxes ********************************* 133// Hides and shows checkboxes 134//******************************************************** 135function toggle_checkboxes(id) 136{ 137 var div = document.getElementById(id); 138 div.style.display = div.style.display == "none" ? "block" : "none"; 139}
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.