diff --git a/web/CXM_form.anubis b/web/CXM_form.anubis index 2bc70af..3e392fa 100644 --- a/web/CXM_form.anubis +++ b/web/CXM_form.anubis @@ -113,7 +113,8 @@ public type CXM_FormField: WebArgName web_arg_name, WebArgValue web_arg_value, Bool checked, - Mandatory mandatory), + Mandatory mandatory), + // the same one, but with the tag on the right of the checkbox checkboxr (List(InputAttrs) options, String label, @@ -121,8 +122,16 @@ public type CXM_FormField: WebArgName web_arg_name, WebArgValue web_arg_value, Bool checked, - Mandatory mandatory), - + Mandatory mandatory), + + //checkbox_hide_show + checkbox_hide_show( List(InputAttrs) options, + String label, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + List(CXM_FormField) fields), + //--- radio-button field -------------------------------------------------------------- radio_button (List(InputAttrs) options, String label, @@ -163,24 +172,25 @@ public type CXM_FormField: // preview (String html_text), //--- upload field ------------------------------------------------------------------- - upload (List(InputAttrs) options, + upload (List(InputAttrs) options, String label, HtmlId id, WebArgName name, Width width, Mandatory mandatory), - raw_in_form (HTML_In_Form html), - raw_in_form (String label, + raw_in_form (HTML_In_Form html), + raw_in_form (String label, HtmlId id, HTML_In_Form input), - partial (HTML_Partial_Content p_content), - input_with_help (CXM_FormField field, + div (List(CoreAttrs), HTML_In_Form content), + partial (HTML_Partial_Content p_content), + input_with_help (CXM_FormField field, Maybe(String) help_title, String help_text, Int width), - sub_fieldset (HTML_In_Form fieldset), + sub_fieldset (HTML_In_Form fieldset), blank_space, blank_space (HtmlClass class), @@ -391,7 +401,14 @@ public define HTML_In_Form checkboxr(options, label, id, name, val, checked, mand) then check_box_r(options, label + star(mand), id, name, val, checked), - + + checkbox_hide_show(options, label, name, val, checked, fields) then + with div_id = generate_random_string(15), + sequence([ + check_box([event(onclick, "checkbox_hide_show_element('"+div_id+"', this);")], label, htmlId(""), name, val, checked), + div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_FormField ff2) |-> div([class("form_field")], cxm_format_form_field(ff2)),fields))) + ]), + radio_button(options, label, id, name, val, checked, mand) then radio_button(options, label + star(mand), id, name, val, checked), @@ -417,29 +434,26 @@ public define HTML_In_Form table([nude],[row([], map((CXM_FormField ff2) |-> cell([],cxm_format_form_field(ff2)),fields))]) , - upload(options, label, id, name, w, mand) then file_upload(options, label + star(mand), id, name, pixels(w)), - raw_in_form(html) then - html, + raw_in_form(html) then html, // div([class("in")], html), raw_in_form(label, id, input) then sequence([ if id is htmlId(id) then literal(""), input]), - partial(p_content) then - partial(p_content), + div(options, e) then div(options, e), + partial(p_content) then partial(p_content), input_with_help(input, help_title, help_text, width) then sequence([ cxm_format_form_field(input), html_tooltip(force_String(help_title), help_text, width), ]), - sub_fieldset(fieldset) then - fieldset, + sub_fieldset(fieldset) then fieldset, blank_space then div([class("blank_space")], literal(" ")), @@ -478,7 +492,7 @@ public define HTML_In_Form cxm_fieldset ( HtmlId fieldSetId, - List(CXM_FormField) fields + List(CXM_FormField) fields ) = cxm_fieldset([id(fieldSetId.id), class("aligned")], "", fields). @@ -517,11 +531,12 @@ public define HTML_Off_Form public define HTML_Off_Form cxm_form ( - String form_name, - List(CoreAttrs) options, - String action_name, + String form_name, + List(CoreAttrs) options, + HtmlId fieldSetId, + String action_name, List((String,String)) extra_ops, - HtmlId fieldSetId, + List(CXM_FormField) fields ) = cxm_form(form_name, options, action_name, extra_ops, @@ -535,7 +550,7 @@ public define HTML_Off_Form String form_name, List(CoreAttrs) options, HtmlId fieldSetId, - List(CXM_FormField) fields + List(CXM_FormField) fields ) = cxm_form(form_name, options, [ @@ -546,7 +561,7 @@ public define HTML_Off_Form cxm_form ( String form_name, - List(HTML_In_Form) fieldSets + List(HTML_In_Form) fieldSets ) = cxm_form(form_name, [], fieldSets). @@ -555,7 +570,7 @@ public define HTML_Off_Form ( String form_name, HtmlId fieldSetId, - List(CXM_FormField) fields + List(CXM_FormField) fields ) = cxm_form(form_name, [], fieldSetId, fields). diff --git a/web/jQuery/CXM_jquery_button.anubis b/web/jQuery/CXM_jquery_button.anubis index ad51aaf..e6bbb33 100644 --- a/web/jQuery/CXM_jquery_button.anubis +++ b/web/jQuery/CXM_jquery_button.anubis @@ -353,3 +353,10 @@ public define HTML_Partial_Content )= jq_button_confirm(button_label, dlg_title, dlg_text, dlg_ok, dlg_cancel, url, []). +public define HTML_Partial_Content + img_submit_button + ( + String label, //translated label of the button + String form_id // + )= + jquery_button(jquery_img_button("icons/16x16/check.png", label, "", jQuery_actioner(same, jqform, form_id), left)). -- libgit2 0.21.4