Commit 0f60e5020040df5c18821d668ce5dc7d7643a275
1 parent
c0c76e0f
enhance code formatting
add optimized an optimized version of "img_button_confirm" function
Showing
2 changed files
with
22 additions
and
6 deletions
Show diff stats
web/jQuery/CXM_jquery_datatable_server_side.anubis
| ... | ... | @@ -17,12 +17,12 @@ public define Maybe(JQuery_datatable_server_side_type) |
| 17 | 17 | List(Web_arg) lwa |
| 18 | 18 | )= |
| 19 | 19 | |
| 20 | - if get_String(lwa, "sEcho") is {failure then println("can't read sEcho");failure, success(secho) then | |
| 21 | - if get_Int(lwa, "iColumns") is {failure then println("can't read iColumns");failure, success(icolumns) then | |
| 22 | - if get_String(lwa, "sColumns") is {failure then println("can't read sColumns");failure, success(scolumns) then | |
| 23 | - if get_Int(lwa, "iDisplayStart") is {failure then println("can't read iDisplayStart");failure, success(idisplaystart) then | |
| 24 | - if get_Int(lwa, "iDisplayLength") is {failure then println("can't read iDisplayLength");failure, success(idisplaylength) then | |
| 25 | - if get_String(lwa, "sSearch") is {failure then println("can't read sSearch");failure, success(sSearch) then | |
| 20 | + if get_String(lwa, "sEcho") is {failure then println("can't read sEcho"); failure, success(secho) then | |
| 21 | + if get_Int(lwa, "iColumns") is {failure then println("can't read iColumns"); failure, success(icolumns) then | |
| 22 | + if get_String(lwa, "sColumns") is {failure then println("can't read sColumns"); failure, success(scolumns) then | |
| 23 | + if get_Int(lwa, "iDisplayStart") is {failure then println("can't read iDisplayStart"); failure, success(idisplaystart) then | |
| 24 | + if get_Int(lwa, "iDisplayLength") is {failure then println("can't read iDisplayLength"); failure, success(idisplaylength) then | |
| 25 | + if get_String(lwa, "sSearch") is {failure then println("can't read sSearch"); failure, success(sSearch) then | |
| 26 | 26 | // if get_String(lwa, "sSortDir") is {failure then failure, success(sSortDir) then |
| 27 | 27 | success(dt_ss(secho, icolumns, scolumns, idisplaystart, idisplaylength, if sSearch = "" then failure else success(sSearch))) |
| 28 | 28 | }}}}}}. | ... | ... |
web/widgets/button.anubis
| ... | ... | @@ -12,6 +12,7 @@ read calexium_lib/web/CXM_json.anubis |
| 12 | 12 | read calexium_lib/web/js_tools.anubis |
| 13 | 13 | transmit calexium_lib/web/widgets/icons_set.anubis |
| 14 | 14 | read tools/basis.anubis |
| 15 | +read tools/printable_tree.anubis | |
| 15 | 16 | |
| 16 | 17 | |
| 17 | 18 | |
| ... | ... | @@ -148,6 +149,21 @@ public define String |
| 148 | 149 | |
| 149 | 150 | "<script type=\"text/javascript\">" + jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)) + "</script>" + |
| 150 | 151 | "<img " + format_attrs(img_button_confirm_image_attrs(core_attrs, uid, actioner)) + " src=\"" + img_path + "\"></img>". |
| 152 | + | |
| 153 | +public define String | |
| 154 | + img_button_confirm | |
| 155 | + ( | |
| 156 | + String img_path, | |
| 157 | + List(CoreAttrs) core_attrs, | |
| 158 | + String dlg_title_js_escaped, | |
| 159 | + String dlg_text_js_escaped, | |
| 160 | + String dlg_ok_js_escaped, | |
| 161 | + String dlg_cancel_js_escaped, | |
| 162 | + String dlg_ok_js_script | |
| 163 | + ) = | |
| 164 | + with uid = generate_random_string(10), | |
| 165 | + "<script type=\"text/javascript\">$(document).ready(function(){CalexiumToolBox.data.confirm_dialog['" + uid + "'] = {title:" + dlg_title_js_escaped + ",text:" + dlg_text_js_escaped + ",ok:" + dlg_ok_js_escaped + ",cancel:" + dlg_cancel_js_escaped + | |
| 166 | + "};});</script><img " + format_attrs(core_attrs) + " id=\"" + uid + "\" style=\"cursor:pointer\" onclick=\"CalexiumToolBox.make_confirm_dialog(this," + dlg_ok_js_script + ");\" src=\"" + img_path + "\"></img>". | |
| 151 | 167 | |
| 152 | 168 | public define String |
| 153 | 169 | img_button_confirm | ... | ... |