From bc9219ca266359876570b1642e5f279da9a79d41 Mon Sep 17 00:00:00 2001 From: totoro Date: Mon, 18 Apr 2016 17:02:40 +0200 Subject: [PATCH] Create HTML_Label with tooltip in the input label change HtmlId by HTML_Id --- web/CXM_dojo.anubis | 56 ++++++++++++++++++++++++++++---------------------------- web/CXM_form.anubis | 458 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- web/CXM_generic_form.anubis | 32 ++++++++++++++++---------------- web/CXM_html_tooltip.anubis | 14 ++++++++------ web/CXM_jquery.anubis | 8 ++++---- web/CXM_making_a_web_site.anubis | 258 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------- web/CXM_widgets.anubis | 20 ++++++++++---------- web/widgets/css_helper.anubis | 4 ++-- web/widgets/fisheye_menu.anubis | 2 +- 9 files changed, 496 insertions(+), 356 deletions(-) diff --git a/web/CXM_dojo.anubis b/web/CXM_dojo.anubis index eca45cf..c4e62eb 100644 --- a/web/CXM_dojo.anubis +++ b/web/CXM_dojo.anubis @@ -67,11 +67,11 @@ public type Input_Type: password. public type InputDial: - input_dial(HtmlId id, Input_Type input_type, String label, Maybe(String) class), - input_date(HtmlId id, String label), - input_combo(HtmlId id, String label, List((List(CoreAttrs), WebArgValue, String)) list_data), - input_check(HtmlId id, String label, Bool checked), - input_hidden(HtmlId id, WebArgValue value). + input_dial(HTML_Id id, Input_Type input_type, String label, Maybe(String) class), + input_date(HTML_Id id, String label), + input_combo(HTML_Id id, String label, List((List(CoreAttrs), WebArgValue, String)) list_data), + input_check(HTML_Id id, String label, Bool checked), + input_hidden(HTML_Id id, WebArgValue value). define List(HTML_Off_Form) @@ -92,7 +92,7 @@ public define HTML_Off_Form dojo_combobox ( WebArgName the_name, - HtmlId the_id, + HTML_Id the_id, String label, List((List(CoreAttrs), WebArgValue, String)) list_data, )= @@ -110,7 +110,7 @@ define HTML_Off_Form _maybe_label ( String label_text, - HtmlId html_id + HTML_Id html_id ) = if length(label_text) > 0 then literal("") else literal(""). @@ -119,7 +119,7 @@ public define HTML_Off_Form dojo_checkbox ( WebArgName the_name, - HtmlId the_id, + HTML_Id the_id, String label, WebArgValue val, Bool checked, @@ -316,7 +316,7 @@ define String to_String(DojoGridView view) = public define String dojo_make_grid_script ( - HtmlId html_id, + HTML_Id html_id, DojoGridLayout layout, String layout_name, String store_name, @@ -333,7 +333,7 @@ public define String public define HTML_Off_Form dojo_make_grid_script ( - HtmlId html_id, + HTML_Id html_id, List(String) columns, Bool can_edit ) @@ -349,7 +349,7 @@ public define HTML_Off_Form public define HTML_Off_Form dojo_grid ( - HtmlId html_id, + HTML_Id html_id, Int rowsPerPage, List(Table_Option) attributes, )= @@ -361,7 +361,7 @@ public define HTML_Off_Form public define HTML_Off_Form dojo_grid ( - HtmlId html_id, + HTML_Id html_id, List(CoreAttrs) attributes, // List(GridColumn) columns, String colum1, @@ -558,7 +558,7 @@ public define HTML_Off_Form ( List(CoreAttrs) attributes, List(Text_Option) txt_attr, - HtmlId html_id, + HTML_Id html_id, String label, HTML_Off_Form tooltip_content, )= @@ -571,7 +571,7 @@ public define HTML_Off_Form public define HTML_Off_Form dojo_button ( - HtmlId html_id, + HTML_Id html_id, // Maybe(String) class, String name, String iconclass, @@ -595,7 +595,7 @@ public define HTML_Off_Form public define HTML_In_Form dojo_button ( - HtmlId html_id, + HTML_Id html_id, // Maybe(String) class, String name, String iconclass, @@ -642,7 +642,7 @@ public define HTML_Off_Form dojo_editor ( List(CoreAttrs) attributes, - HtmlId html_id, + HTML_Id html_id, WebArgName input_name, HTML_Off_Form text, )= @@ -653,7 +653,7 @@ public define HTML_Off_Form public define HTML_In_Form dojo_button ( - HtmlId html_id, + HTML_Id html_id, String name, String iconclass, Maybe(String) tip_msg, @@ -671,33 +671,33 @@ public define HTML_Off_Form public define HTML_In_Form dojo_checkbox ( - List(InputAttrs) attributes, + List(CoreAttrs) attributes, WebArgName name, - HtmlId id, - String label, + HTML_Id id, + String label_str, WebArgValue val, Bool checked, )= - check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label, id, name, val, checked). + check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label(label_str, no_help), id, name, val, checked). public define HTML_In_Form dojo_combobox ( - List(InputAttrs) attributes, + List(CoreAttrs) attributes, WebArgName name, - HtmlId id, - String label, + HTML_Id id, + String label_str, List((List(CoreAttrs),WebArgValue,String)) list_data, InitialValue selected, )= // selector_c([attr("dojoType", "dijit.form.ComboBox") . attributes], label, id, name, 1, list_data, selected, non_mandatory). - selector_c(attributes, label, id, name, 1, list_data, selected). + selector_c([attr("dojoType", "dijit.form.ComboBox") . attributes], label(label_str, no_help), id, name, 1, list_data, selected). public define HTML_Off_Form dojo_toaster ( List(CoreAttrs) attributes, - HtmlId html_id, + HTML_Id html_id, String message_topic, Position_Direction position_direction, Bool separator, @@ -720,7 +720,7 @@ public define HTML_Off_Form ( List(CoreAttrs) attributes, List(Text_Option) attributes_text, - HtmlId html_id, + HTML_Id html_id, String label )= sequence([ @@ -733,7 +733,7 @@ public define HTML_Off_Form ( List(CoreAttrs) attributes, List(Text_Option) attributes_text, - HtmlId html_id, + HTML_Id html_id, String label, Int progress, Int maximum diff --git a/web/CXM_form.anubis b/web/CXM_form.anubis index d7d1702..8b40da5 100644 --- a/web/CXM_form.anubis +++ b/web/CXM_form.anubis @@ -30,145 +30,167 @@ public type Width: public type FormFieldWidth: auto, custom(Int). - -public type CXM_FormTooltip: - tooltip(String title, String content, Int width). public type CXM_Form_Field: - no_field, // empty field + no_field, // empty field //--- title field --------------------------------------------------------------------- - title (String text), -// title (Int text_size, -// String text), -// title_f (List(Text_Option) -> HTML_In_Form), + title( + String text + ), //--- message field ------------------------------------------------------------------- - message (String text), + message( + String text + ), //--- text input field ---------------------------------------------------------------- - input (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - InitialValue init_value, - Width width, - Mandatory mandatory), - input_readonly (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - InitialValue init_value, - Width width), + input( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + InitialValue init_value, + Width width, + Mandatory mandatory + ), + + input_readonly( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + InitialValue init_value, + Width width + ), //--- text area field ----------------------------------------------------------------- - text_area (List(TextAreaOption) options, - String label, - HtmlId id, - WebArgName web_arg_name, - InitialValue init_value, - Width width, - Int height, - Mandatory mandatory), + text_area( + List(TextAreaOption) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + InitialValue init_value, + Width width, + Int height, + Mandatory mandatory + ), //--- password input field ------------------------------------------------------------ - password_input (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - InitialValue init_value, - Width width, - Mandatory mandatory), + password_input( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + InitialValue init_value, + Width width, + Mandatory mandatory), //--- hidden field ------------------------------------------------------------ - hidden (HtmlId id, - WebArgName web_arg_name, - WebArgValue init_value), + hidden( + HTML_Id id, + WebArgName web_arg_name, + WebArgValue init_value + ), //--- explanation field --------------------------------------------------------------- - explain (String text), + explain( + String text + ), //--- selector field ------------------------------------------------------------------ - selector (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - Int size, - List(String) items, - Maybe(InitialValue) selected, - Mandatory mandatory), + selector( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + Int size, + List(String) items, + Maybe(InitialValue) selected, + Mandatory mandatory + ), - selector_c (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - Int size, - List((List(CoreAttrs), WebArgValue, String)) items, - Maybe(InitialValue) selected, - Mandatory mandatory), + selector_c( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + Int size, + List((List(CoreAttrs), WebArgValue, String)) items, + Maybe(InitialValue) selected, + Mandatory mandatory + ), - selector_hide_show (List(InputAttrs) options, - String label, - HtmlId id, + selector_hide_show (List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, WebArgName web_arg_name, - Int size, + Int size, List((List(CoreAttrs), WebArgValue, String, HTML_Partial_Content)) items, Maybe(InitialValue) selected, Mandatory mandatory), //--- checkbox field ------------------------------------------------------------------ - checkbox (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - WebArgValue web_arg_value, - Bool checked, - Mandatory mandatory), + checkbox (List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + Mandatory mandatory), // the same one, but with the tag on the right of the checkbox - checkboxr (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - WebArgValue web_arg_value, - Bool checked, - Mandatory mandatory), + checkboxr( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + 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_Form_Field) fields), + checkbox_hide_show( + List(CoreAttrs) options, + HTML_Label label, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + List(CXM_Form_Field) fields + ), //--- radio-button field -------------------------------------------------------------- - radio_button (List(InputAttrs) options, - String label, - HtmlId id, - WebArgName web_arg_name, - WebArgValue web_arg_value, - Bool checked, - Mandatory mandatory), + radio_button( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + Mandatory mandatory + ), //radio_button_hide_show radio_button_hide_show( - List(InputAttrs) options, - String label, - WebArgName web_arg_name, - WebArgValue web_arg_value, - Bool checked, - List(CXM_Form_Field) fields), + List(CoreAttrs) options, + HTML_Label label, + WebArgName web_arg_name, + WebArgValue web_arg_value, + Bool checked, + List(CXM_Form_Field) fields + ), // the same one, but with the tag on the right of the radio_button - radio_buttonr (List(InputAttrs) options, - String label, - HtmlId id, + radio_buttonr (List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, WebArgName web_arg_name, WebArgValue web_arg_value, Bool checked, Mandatory mandatory), - radio_button_list (List(InputAttrs) options, - String label, - HtmlId id, + radio_button_list( + List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, WebArgName web_arg_name, List((WebArgValue, String)) web_arg_value, Maybe(InitialValue) selected, @@ -189,24 +211,24 @@ public type CXM_Form_Field: // preview (String html_text), //--- upload field ------------------------------------------------------------------- - 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, - HtmlId id, - HTML_In_Form input), + upload (List(CoreAttrs) options, + HTML_Label label, + HTML_Id id, + WebArgName name, + Width width, + Mandatory mandatory), + + raw_in_form (HTML_In_Form html), + label_for ( String label, + HTML_Id id, + HTML_In_Form input), div (List(CoreAttrs), HTML_In_Form content), partial (HTML_Partial_Content p_content), br, - input_with_help (CXM_Form_Field field, - Maybe(String) help_title, - String help_text, - Int width), +// input_with_help (CXM_Form_Field field, +// Maybe(String) help_title, +// String help_text, +// Int width), fieldset (List(CoreAttrs) options, String legend, @@ -230,7 +252,7 @@ public type CXM_Form_Field: public define CXM_Form_Field fieldset ( - HtmlId fieldSetId, + HTML_Id fieldSetId, List(CXM_Form_Field) fields ) = fieldset([id(fieldSetId.id)], "", fields). @@ -252,39 +274,39 @@ public define CXM_Form_Field public define CXM_Form_Field input(WebArgName n, InitialValue init_value, Width width) - = input([], "", htmlId(n.name), n, init_value, width, non_mandatory). + = input([], no_label, html_Id(n.name), n, init_value, width, non_mandatory). public define CXM_Form_Field - input(String label, WebArgName n, InitialValue init_value, Width width) - = input([], label, htmlId(n.name), n, init_value, width, non_mandatory). + input(HTML_Label label, WebArgName n, InitialValue init_value, Width width) + = input([], label, html_Id(n.name), n, init_value, width, non_mandatory). public define CXM_Form_Field - input(String label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) - = input([], label, htmlId(n.name), n, init_value, width, mand). + input(HTML_Label label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) + = input([], label, html_Id(n.name), n, init_value, width, mand). public define CXM_Form_Field - input_readonly(String label, WebArgName n, InitialValue init_value, Width width) - = input_readonly([], label, htmlId(n.name), n, init_value, width). + input_readonly(HTML_Label label, WebArgName n, InitialValue init_value, Width width) + = input_readonly([], label, html_Id(n.name), n, init_value, width). public define CXM_Form_Field - password_input(String label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) - = password_input([], label, htmlId(n.name), n, init_value, width, mand). + password_input(HTML_Label label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) + = password_input([], label, html_Id(n.name), n, init_value, width, mand). public define CXM_Form_Field - checkbox(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) - = checkbox([], label, htmlId(n.name), n, value, checked, mand). + checkbox(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) + = checkbox([], label, html_Id(n.name), n, value, checked, mand). public define CXM_Form_Field - checkboxr(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) - = checkboxr([], label, htmlId(n.name), n, value, checked, mand). + checkboxr(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) + = checkboxr([], label, html_Id(n.name), n, value, checked, mand). public define CXM_Form_Field - radio_button(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) - = radio_button([], label, htmlId(n.name), n, value, checked, mand). + radio_button(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) + = radio_button([], label, html_Id(n.name), n, value, checked, mand). public define CXM_Form_Field - radio_buttonr(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) - = radio_buttonr([], label, htmlId(n.name), n, value, checked, mand). + radio_buttonr(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) + = radio_buttonr([], label, html_Id(n.name), n, value, checked, mand). public define CXM_Form_Field submit(String action_name, HtmlClass class, Maybe(String) label, String button_text, List((String,String)) extra_operands) @@ -295,18 +317,18 @@ public define CXM_Form_Field = submit([], htmlClass(""), action_name, label, button_text, extra_operands). public define CXM_Form_Field - upload(String label, HtmlId id, WebArgName name, Width width) + upload(HTML_Label label, HTML_Id id, WebArgName name, Width width) = upload([], label, id, name, width, non_mandatory). public define CXM_Form_Field - upload(String label, HtmlId id, WebArgName name, Width width, Mandatory mand) + upload(HTML_Label label, HTML_Id id, WebArgName name, Width width, Mandatory mand) = upload([], label, id, name, width, mand). -public define CXM_Form_Field + public define CXM_Form_Field input_with_help (CXM_Form_Field field, String help_text) = input_with_help (field, failure, help_text, 250). -public define CXM_Form_Field + public define CXM_Form_Field input_with_help (CXM_Form_Field field, String help_text, Int width) = input_with_help (field, failure, help_text, width). @@ -314,11 +336,11 @@ public define CXM_Form_Field ip_input ( String label, - HtmlId id, + HTML_Id id, WebArgName wan_prefix, String ip )= - raw_in_form( + label_for( label, id, ip_input(id, wan_prefix, ip) @@ -328,13 +350,13 @@ public define CXM_Form_Field public define CXM_Form_Field partial_ip_input ( - String label, - HtmlId id, - WebArgName wan_prefix, + String label, + HTML_Id id, + WebArgName wan_prefix, List(String) ip_fixed_part, String ip )= - raw_in_form( + label_for( label, id, partial_ip_input(id, wan_prefix, ip_fixed_part, ip) @@ -346,7 +368,7 @@ public define CXM_Form_Field WebArgName web_arg_name, WebArgValue value )= - hidden(htmlId(""), web_arg_name, value). + hidden(html_Id(""), web_arg_name, value). //--- explanation field --------------------- @@ -384,11 +406,17 @@ public define HTML_In_Form CXM_Form_Field ff, List(Web_arg) lwa ) = - with star = (Mandatory m) |-> (String) + with star = (HTML_Label l, Mandatory m) |-> (HTML_Label) if m is { - mandatory then "*", - non_mandatory then "" + mandatory then + if l is + { + no_label then l, + label(str, help) then label(str + "*", help), + } + + non_mandatory then l }, pixels = (Width width) |-> if width is @@ -398,51 +426,30 @@ public define HTML_In_Form wide then 70, custom(n) then n }, - // special case out of the div("inputable") tag. -// if ff is submit(attrs, action_name, mb_label, button_text, extra_operands) then -// mf_format_form_field_inside_inputable(ff, star, pixels) -// else if ff is hidden(name, init) then -// mf_format_form_field_inside_inputable(ff, star, pixels) -// else if ff is sub_fieldset(fieldset) then -// mf_format_form_field_inside_inputable(ff, star, pixels) -// else -// div([class("inputable")], -// mf_format_form_field_inside_inputable(ff, star, pixels)) - -// sequence([ -// literal(" \n"), -// mf_format_form_field_inside_inputable(ff, star, pixels, failure), -// literal(" \n"), -// ]) + if ff is { no_field then - literal(""), + empty, title(t) then literal("

" + t + "

"), - -// title(s,t) then -// text([h_center, size(s),bold,color(rgb(0,0,0))], t), -// -// title_f(t) then -// t([h_center, size(16),bold,color(rgb(0,0,0))]), message(t) then literal(t), - input(options, label, id, wan, default, w, mand) then - text_input([class("in") . options], label + star(mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w)), + input(options, _label, id, wan, default, w, mand) then + text_input([class("in") . options], star(_label, mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w)), - input_readonly(options, label, id, name, init, w) then - text_input_ro([class("in") . options], label, id, name, init, pixels(w)), - - text_area(options, label, id, wan, default, w, height, mand) then - text_area([input_attrs([class("in")]) . options], label + star(mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w), height), + input_readonly(options, _label, id, name, init, w) then + text_input_ro([class("in") . options], _label, id, name, init, pixels(w)), + + text_area(options, _label, id, wan, default, w, height, mand) then + text_area([input_attrs([class("in")]) . options], star(_label, mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w), height), - password_input(options, label, id, name, init, w, mand) then - password_input([class("in") . options], label + star(mand), id, name, init, pixels(w)), + password_input(options, _label, id, name, init, w, mand) then + password_input([class("in") . options], star(_label, mand), id, name, init, pixels(w)), hidden(id, name, init) then hidden(id, name, init), @@ -450,55 +457,55 @@ public define HTML_In_Form explain(t) then div([class("sub")], literal(t)), - selector(options, label, id, wan, size, items, selected, mand) then - if selected is - { - failure then selector([class("in") . options], label + star(mand), id, wan, size, items), - success(default) then selector([class("in") . options], label + star(mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), - }, + selector(options, _label, id, wan, size, items, selected, mand) then + if selected is + { + failure then selector([class("in") . options], star(_label, mand), id, wan, size, items), + success(default) then selector([class("in") . options], star(_label, mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), + }, - selector_c(options, label, id, wan, size, items, selected, mand) then - if selected is - { - failure then selector_c([class("in") . options], label + star(mand), id, wan, size, items), - success(default) then selector_c([class("in") . options], label + star(mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), - }, + selector_c(options, _label, id, wan, size, items, selected, mand) then + if selected is + { + failure then selector_c([class("in") . options], star(_label, mand), id, wan, size, items), + success(default) then selector_c([class("in") . options], star(_label, mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), + }, - selector_hide_show(options, label, id, wan, size, items_with_partial, selected, mand) then + selector_hide_show(options, _label, id, wan, size, items_with_partial, selected, mand) then with div_id = generate_random_string(15), since construct_selector_hide_show(div_id, items_with_partial) is (items, partial_content_list), sequence([ - selector_c([class("in"), class("cxm_selector_hide_show"), event(onchange, "select_hide_show('" + div_id + "', this);")], label + star(mand), id, wan, size, reverse(items), if selected is { failure then init(""), success(default) then init(get_String(lwa, wan.name, default.value)) } ), + selector_c([class("in"), class("cxm_selector_hide_show"), event(onchange, "select_hide_show('" + div_id + "', this);")], star(_label, mand), id, wan, size, reverse(items), if selected is { failure then init(""), success(default) then init(get_String(lwa, wan.name, default.value)) } ), partial(partial_content(partial_content_list)) ]), - checkbox(options, label, id, wan, val, checked, mand) then - check_box([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), + checkbox(options, _label, id, wan, val, checked, mand) then + check_box([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), - checkboxr(options, label, id, wan, val, checked, mand) then - check_box_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), + checkboxr(options, _label, id, wan, val, checked, mand) then + check_box_r([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), - checkbox_hide_show(options, label, wan, val, checked, fields) then + checkbox_hide_show(options, _label, wan, val, checked, fields) then with div_id = generate_random_string(15), sequence([ - check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], label, htmlId(""), wan, val, get_Bool(lwa, wan.name, checked)), + check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], _label, html_Id(""), wan, val, get_Bool(lwa, wan.name, checked)), div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], format_CXM_Form_Field(ff2, lwa)),fields))) ]), - radio_button(options, label, id, wan, val, checked, mand) then - radio_button([class("in"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), + radio_button(options, _label, id, wan, val, checked, mand) then + radio_button([class("in"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), - radio_button_hide_show(options, label, wan, val, checked, fields) then + radio_button_hide_show(options, _label, wan, val, checked, fields) then with div_id = generate_random_string(15), sequence([ - radio_button([data("show_id", div_id), class("in"), class("cxm_radio_hide_show"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);")], label, htmlId(""), wan, val, get_Bool(lwa, wan.name, checked)), + radio_button([data("show_id", div_id), class("in"), class("cxm_radio_hide_show"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);")], _label, html_Id(""), wan, val, get_Bool(lwa, wan.name, checked)), div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], format_CXM_Form_Field(ff2, lwa)),fields))) ]), - radio_buttonr(options, label, id, wan, val, checked, mand) then - radio_button_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), + radio_buttonr(options, _label, id, wan, val, checked, mand) then + radio_button_r([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), - radio_button_list (options, label, id, wan, items, selected, mand, wide) then + radio_button_list (options, _label, id, wan, items, selected, mand, wide) then with new_selected = if get_String(lwa, wan.name) is { @@ -507,15 +514,15 @@ public define HTML_In_Form }, sequence([ - literal(""), + //literal(""), div( [class("radiolist")], sequence( with i = var((Int)-1), itemclass = if wide then "radiolistitem_wide" else "radiolistitem", map( ((WebArgValue, String) item) |-> i <- *i + 1; if item is (wav, item_label) then - with _id = if id is htmlId(the_id) then htmlId(the_id + "_radio_" + *i), - div([class(itemclass)], radio_button_r(options, item_label, _id, wan, wav, + with _id = if id is html_Id(the_id) then html_Id(the_id + "_radio_" + *i), + div([class(itemclass)], radio_button_r(options, label(item_label), _id, wan, wav, if new_selected is success(v) then wav.value = v.value else false)), items)) ), @@ -525,14 +532,14 @@ public define HTML_In_Form map((CXM_Form_Field ff2) |-> cell([],format_CXM_Form_Field(ff2, lwa)),fields))]) , - upload(options, label, id, name, w, mand) then - file_upload([class("in") . options], label + star(mand), id, name, pixels(w)), + upload(options, _label, id, name, w, mand) then + file_upload([class("in") . options], star(_label, mand), id, name, pixels(w)), raw_in_form(html) then html, // div([class("in")], html), - raw_in_form(label, id, input) then + label_for(label, id, input) then sequence([ - if id is htmlId(_id) then + if id is html_Id(_id) then literal(""), input ]), @@ -541,11 +548,10 @@ public define HTML_In_Form partial(p_content) then partial(p_content), br then br, - input_with_help(input, help_title, help_text, width) then - sequence([ - format_CXM_Form_Field(input, lwa), - html_tooltip(force_String(help_title), help_text, width), - ]), +// input_with_help(input, help_title, help_text, width) then +// sequence([ +// format_CXM_Form_Field(input, lwa, html_tooltip(force_String(help_title), help_text, width)), +// ]), fieldset(options, legend, fields) then sequence([ @@ -561,7 +567,7 @@ public define HTML_In_Form blank_space(htmlClass) then div([class(htmlClass.class)], literal(" ")), - submit(attrs, htmlClass, action_name, mb_label, button_text, extra_operands) then + submit(attrs, htmlClass, action_name, Maybe(String) mb_label, button_text, extra_operands) then actioner( same, // TODO change this to allow external URL if mb_label is { @@ -611,7 +617,7 @@ public define HTML_In_Form public define HTML_Off_Form cxm_form ( - HtmlId form_Id, + HTML_Id form_Id, List(CoreAttrs) options, String action_name, List((String,String)) extra_ops, @@ -637,12 +643,12 @@ public define HTML_Off_Form List(Web_arg) lwa, List(CXM_Form_Field) form_fields )= - cxm_form(htmlId(form_name), options, action_name, extra_ops, lwa, form_fields). + cxm_form(html_Id(form_name), options, action_name, extra_ops, lwa, form_fields). public define HTML_In_Form cxm_fieldset ( - HtmlId fieldSetId, + HTML_Id fieldSetId, List(Web_arg) lwa, List(CXM_Form_Field) fields ) = @@ -657,7 +663,7 @@ public define HTML_Off_Form List(CoreAttrs) options, List(HTML_In_Form) fields ) = - cxm_form(htmlId(form_id), options, "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). + cxm_form(html_Id(form_id), options, "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). public define HTML_Off_Form cxm_form @@ -667,7 +673,7 @@ public define HTML_Off_Form List(Web_arg) lwa, List(CXM_Form_Field) fields ) = - cxm_form(htmlId(form_id), options, "", [], lwa, fields). + cxm_form(html_Id(form_id), options, "", [], lwa, fields). public define HTML_Off_Form cxm_form @@ -675,7 +681,7 @@ public define HTML_Off_Form String form_id, List(HTML_In_Form) fields ) = - cxm_form(htmlId(form_id), [], "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). + cxm_form(html_Id(form_id), [], "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). public define HTML_Off_Form cxm_form @@ -692,4 +698,4 @@ public define HTML_Off_Form String form_id, List(CXM_Form_Field) fields ) = - cxm_form(htmlId(form_id), [], "", [], [], fields). + cxm_form(html_Id(form_id), [], "", [], [], fields). diff --git a/web/CXM_generic_form.anubis b/web/CXM_generic_form.anubis index 77422a5..853fb66 100644 --- a/web/CXM_generic_form.anubis +++ b/web/CXM_generic_form.anubis @@ -250,7 +250,7 @@ define HTML_Row(HTML_In_Form) [ cell([right ], text([size(10)],tag)), cell([width(7) ], star(mand)), - cell([left ], text_input([], "",htmlId(""), wan, init,if w is + cell([left ], text_input([], "",html_Id(""), wan, init,if w is { small then 10, narrow then 50, @@ -261,7 +261,7 @@ define HTML_Row(HTML_In_Form) input(wan,w,init) then (List(HTML_Cell(HTML_In_Form))) [ - cell([left,columns(3) ], text_input([], "", htmlId(""), wan,init,if w is + cell([left,columns(3) ], text_input([], "", html_Id(""), wan,init,if w is { small then 10, narrow then 30, @@ -274,7 +274,7 @@ define HTML_Row(HTML_In_Form) [ cell([right ], tag([size(10)])), cell([width(7) ], star(mand)), - cell([left ], text_input([], "", htmlId(""),wan,init,if w is + cell([left ], text_input([], "", html_Id(""),wan,init,if w is { small then 15, narrow then 30, @@ -287,14 +287,14 @@ define HTML_Row(HTML_In_Form) [ cell([right ], text([size(10)],tag)), cell([width(7) ], star(mand)), - cell([left ], password_input([], "",htmlId(""), wan, init(""), 30)) + cell([left ], password_input([], "",html_Id(""), wan, init(""), 30)) ], password_input_f(wan,tag,mand) then (List(HTML_Cell(HTML_In_Form))) [ cell([right ], tag([size(10)])), cell([width(7) ], star(mand)), - cell([left ], password_input([], "",htmlId(""), wan, init(""), 30)) + cell([left ], password_input([], "",html_Id(""), wan, init(""), 30)) ], explain(t) then (List(HTML_Cell(HTML_In_Form))) @@ -329,8 +329,8 @@ define HTML_Row(HTML_In_Form) cell([width(7)], star(mand)), cell([left ], if selected is { - failure then selector([], "", htmlId(""), wan,1,items) - success(sel) then selector([], "", htmlId(""), wan,1,items, sel) + failure then selector([], "", html_Id(""), wan,1,items) + success(sel) then selector([], "", html_Id(""), wan,1,items, sel) }) ], @@ -340,8 +340,8 @@ define HTML_Row(HTML_In_Form) cell([width(7)], star(mand)), cell([left ], if selected is { - failure then selector([], "", htmlId(""), wan,1,items) - success(sel) then selector([], "", htmlId(""), wan,1,items, sel) + failure then selector([], "", html_Id(""), wan,1,items) + success(sel) then selector([], "", html_Id(""), wan,1,items, sel) }) ], @@ -351,8 +351,8 @@ define HTML_Row(HTML_In_Form) cell([width(7)], star(mand)), cell([left ], if selected is { - failure then selector_c([], "", htmlId(""), wan,1,items) - success(sel) then selector_c([], "", htmlId(""), wan,1,items,sel) + failure then selector_c([], "", html_Id(""), wan,1,items) + success(sel) then selector_c([], "", html_Id(""), wan,1,items,sel) }) ], @@ -360,12 +360,12 @@ define HTML_Row(HTML_In_Form) [ cell([right ], text([size(10)],tag)), cell([width(7)], star(mand)), - cell([left ], check_box([], "",htmlId(""),wan, wav(wan.name),checked)) + cell([left ], check_box([], "",html_Id(""),wan, wav(wan.name),checked)) ], checkboxr(wan,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) [ - cell([right ], check_box([], "",htmlId(""),wan, wav(wan.name),checked)), + cell([right ], check_box([], "",html_Id(""),wan, wav(wan.name),checked)), cell([width(7)], star(mand)), cell([left ], text([size(10)],tag)) ], @@ -374,19 +374,19 @@ define HTML_Row(HTML_In_Form) [ cell([right ], tag([size(10)])), cell([width(7)], star(mand)), - cell([left ], check_box([], "",htmlId(""),wan,wav(wan.name),checked)) + cell([left ], check_box([], "",html_Id(""),wan,wav(wan.name),checked)) ], radio_button(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) [ cell([right ], text([size(10)],tag)), cell([width(7)], star(mand)), - cell([left ], radio_button([], "", htmlId(""), wan, wav, checked)) + cell([left ], radio_button([], "", html_Id(""), wan, wav, checked)) ], radio_buttonr(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) [ - cell([right ], radio_button([], "", htmlId(""), wan, wav, checked)), + cell([right ], radio_button([], "", html_Id(""), wan, wav, checked)), cell([width(7)], star(mand)), cell([left ], text([size(10)],tag)) ], diff --git a/web/CXM_html_tooltip.anubis b/web/CXM_html_tooltip.anubis index 3877354..e2ef274 100644 --- a/web/CXM_html_tooltip.anubis +++ b/web/CXM_html_tooltip.anubis @@ -11,7 +11,9 @@ read tools/basis.anubis read calexium_lib/web/CXM_common.anubis read calexium_lib/web/CXM_making_a_web_site.anubis -public define HTML_Off_Form +//public type HTML_Off_Form:... + + public define HTML_Off_Form html_tooltip ( String title, @@ -21,7 +23,7 @@ public define HTML_Off_Form actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). -public define HTML_Off_Form + public define HTML_Off_Form html_tooltip ( String title, @@ -32,7 +34,7 @@ public define HTML_Off_Form actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword), ("width", to_decimal(width))], []). -public define HTML_In_Form + public define HTML_In_Form html_tooltip ( String title, @@ -42,7 +44,7 @@ public define HTML_In_Form actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). -public define HTML_In_Form + public define HTML_In_Form html_tooltip ( String title, @@ -62,7 +64,7 @@ public define HTML_In_Form ) = actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []). -public define HTML_Off_Form + public define HTML_Off_Form html_tooltip_ext ( String title, @@ -95,7 +97,7 @@ public define HTML_Off_Form with extra_args = format_extra_operands(ext_args), literal(""). -public define HTML_In_Form + public define HTML_In_Form html_tooltip_ext ( String title, diff --git a/web/CXM_jquery.anubis b/web/CXM_jquery.anubis index 703e615..fa1b908 100644 --- a/web/CXM_jquery.anubis +++ b/web/CXM_jquery.anubis @@ -23,9 +23,9 @@ public type JQuery_Actioner: /* jQuery Selector - http://api.jquery.com/category/selectors/ */ public type JQuerySelector: - element(HtmlId id), + element(HTML_Id id), element_class(String name), - childs(HtmlId id). + childs(HTML_Id id). define String jquery_button_get_onclick_action_window_options @@ -101,13 +101,13 @@ public define String if selector is { element(html_id) then - if html_id is htmlId(id) then "'#" + id + "'", + if html_id is html_Id(id) then "'#" + id + "'", element_class(name) then "'." + name + "'", childs(html_id) then - if html_id is htmlId(id) then "'#" + id + " > *'" + if html_id is html_Id(id) then "'#" + id + " > *'" }. /* */ diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 71c534c..377d422 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -60,7 +60,8 @@ read CXM_multihost_http_server.anubis read web/mime.anubis read CXM_cookies.anubis read CXM_json.anubis - +//read CXM_html_tooltip.anubis + * (1) Structure of a web site. First of all we need to explain what a web site should be made of. Ideally, the @@ -683,8 +684,8 @@ public type Reading_Way: /** * String value for 'id' attribut */ -public type HtmlId: - htmlId(String id). +public type HTML_Id: + html_Id(String id). /** * String value for 'class' attribut @@ -710,7 +711,7 @@ public type WebArgValue: public type InitialValue: init(String value). -public define Printable_tree [HtmlId x . Printable_tree y] = str_pt(x.id, y). +public define Printable_tree [HTML_Id x . Printable_tree y] = str_pt(x.id, y). public define Printable_tree [HtmlClass x . Printable_tree y] = str_pt(x.class, y). public define Printable_tree [WebArgName x . Printable_tree y] = str_pt(x.name, y). public define Printable_tree [WebArgValue x . Printable_tree y] = str_pt(x.value, y). @@ -1116,7 +1117,58 @@ public type HTML_Head_Tag: css(CSS_File), css_inline(String css_styles) /* Note: tags are not necessaries */ . + + /* Label with help */ + + + +public type HTML_tooltip: + html_tooltip + ( + String title, + String keyword, + Int width, + ), + html_tooltip_ext + ( + String title, + String extend_type, + String class_suffix, + List((String, String)) ext_args + ). + +public define HTML_tooltip + html_tooltip + ( + String keyword, + Int width + )= + html_tooltip("", keyword, width). + +public define HTML_tooltip + html_tooltip + ( + String title, + String keyword + )= + html_tooltip(title, keyword, 0). +public type HTML_Help_Position: + left, + right. + +public type HTML_Help: + no_help, //no help text available + tooltip(HTML_tooltip, + HTML_Help_Position). + +public type HTML_Label: + no_label, + label( + String text, //label to show + HTML_Help help //HTML help (tooltip with ajax call or not) + + ). /* It contains * - a List of HTML_Head_Tag representing necessaries head tags for the content. ex: jquery js files, js script, css specific styles, ... * - a HTML_Off_Form representing the HTML code for the part of the page we want to display @@ -1169,25 +1221,25 @@ public type HTML_In_Form: foreign_link (List(Text_Option), String url, String name), private_download (String abs_path, String name, String extra_ext, Maybe((String,List((String,String)))) action), - text_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), - text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), - password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), - text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height), - file_upload (List(InputAttrs), String label, HtmlId id, WebArgName name, Int width), - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices), - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices, InitialValue selected), + text_input (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), + text_input_ro (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), + password_input (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), + text_area (List(TextAreaOption), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width, Int height), + file_upload (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int width), + selector (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List(String) choices), + selector (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List(String) choices, InitialValue selected), // List((String,String)) = List((code,name)) where : // code is the web-arg value // name appears in selector - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices), - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected), - radio_button (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), - radio_button_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), - check_box (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), - check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), + selector_c (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices), + selector_c (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected), + radio_button (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), + radio_button_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), + check_box (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), + check_box_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), div (List(CoreAttrs), HTML_In_Form content), div_empty (List(CoreAttrs)), - hidden (HtmlId id, WebArgName name, WebArgValue value), + hidden (HTML_Id id, WebArgName name, WebArgValue value), partial (HTML_Partial_Content), br, progress (List(CoreAttrs), Int value, Int max), @@ -1244,7 +1296,7 @@ public define HTML_In_Form Int width, Int height ) = - text_area([], "", htmlId(""), name,init,width,height). + text_area([], no_label, html_Id(""), name,init,width,height). public define HTML_In_Form text_area @@ -1255,7 +1307,7 @@ public define HTML_In_Form Int width, Int height ) = - text_area(options, "", htmlId(""), name,init,width,height). + text_area(options, no_label, html_Id(""), name,init,width,height). public define HTML_In_Form table @@ -1317,29 +1369,29 @@ public define HTML_In_Form text([],s). public define HTML_In_Form - radio_button (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) - = radio_button (options, label_text, htmlId(n.name), n, value, checked). + radio_button (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) + = radio_button (options, label, html_Id(n.name), n, value, checked). public define HTML_In_Form - radio_button_r (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) - = radio_button_r (options, label_text, htmlId(n.name), n, value, checked). + radio_button_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) + = radio_button_r (options, label, html_Id(n.name), n, value, checked). public define HTML_In_Form - check_box (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) - = check_box (options, label_text, htmlId(n.name), n, value, checked). + check_box (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) + = check_box (options, label, html_Id(n.name), n, value, checked). public define HTML_In_Form - check_box_r (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) - = check_box_r (options, label_text, htmlId(n.name), n, value, checked). + check_box_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) + = check_box_r (options, label, html_Id(n.name), n, value, checked). public define HTML_In_Form - file_upload (WebArgName name, Int width) - = file_upload([], "", htmlId(""), name, width). + file_upload (WebArgName n, Int width) + = file_upload([], no_label, html_Id(n.name), n, width). public define HTML_In_Form hidden (WebArgName name, WebArgValue value) = - hidden(htmlId(""), name, value). + hidden(html_Id(""), name, value). public type HTML_Body:... @@ -1373,11 +1425,11 @@ public type HTML_Off_Form: private_download (String abs_path, String name, String extra_ext, Maybe((String,List((String,String)))) action), label (String name), - form (HtmlId form_id, List(CoreAttrs), HTML_In_Form content), - form (HtmlId form_id, List(CoreAttrs), + form (HTML_Id form_id, List(CoreAttrs), HTML_In_Form content), + form (HTML_Id form_id, List(CoreAttrs), String action_name, List((String,String)) extra_ops, HTML_In_Form content), - in_form (HtmlId form_id, HTML_In_Form content), + in_form (HTML_Id form_id, HTML_In_Form content), div (List(CoreAttrs), HTML_Off_Form content), div (List(CoreAttrs), HTML_Partial_Content p_content), div_empty (List(CoreAttrs)), @@ -1408,7 +1460,7 @@ public define HTML_Off_Form List(CoreAttrs) options, HTML_In_Form content ) = - form(htmlId(form_name), options, content). + form(html_Id(form_name), options, content). public define HTML_Off_Form form @@ -1419,7 +1471,7 @@ public define HTML_Off_Form List((String,String)) extra_ops, HTML_In_Form content ) = - form(htmlId(form_name), options, action_name, extra_ops, content). + form(html_Id(form_name), options, action_name, extra_ops, content). public define HTML_Off_Form literal(Printable_tree t) = literal_pt(t). @@ -4155,16 +4207,96 @@ define Printable_tree // *** [5.8] Formating 'in form' elements. + +public define Printable_tree + format + ( + HTML_tooltip tooltip + )= + if tooltip is + { + html_tooltip(title, keyword, width) then + [" 0 then ["&width=",width,"\""] else ["\""]), ">"], + + html_tooltip_ext(title, extend_type, class_suffix, ext_args) then + with extra_args = format_extra_operands(ext_args), + [""] + }. + +public define HTML_Off_Form + html_tooltip + ( + String title, + String keyword, + ) = + literal_pt(format(html_tooltip(title, keyword, 0))). + +public define HTML_In_Form + html_tooltip + ( + String title, + String keyword, + ) = + literal_pt(format(html_tooltip(title, keyword, 0))). + +public define HTML_Off_Form + html_tooltip + ( + String keyword, + Int size, + ) = + literal_pt(format(html_tooltip("", keyword, size))). + +public define HTML_In_Form + html_tooltip + ( + String keyword, + Int size, + ) = + literal_pt(format(html_tooltip("", keyword, size))). + +public define Printable_tree + format_help + ( + Printable_tree label, + HTML_Help _help + ) = + if _help is + { + no_help then label, + tooltip(html_tooltip, position) then + if position is + { + left then pt_pt(format(html_tooltip),label), + right then pt_pt(label, format(html_tooltip)) + } + }. + + + +public define HTML_Label + label + ( + String text + )= + label(text, no_help). -define Printable_tree - maybe_label +public define Printable_tree + format_label ( - String label_text, - HtmlId id + HTML_Label _label, + HTML_Id _id ) = - if length(label_text) > 0 then [""] - else []. + if _label is + { + no_label then [], + label(text, help) then + format_help( + ["",text,""], + help + ) + }. define Printable_tree @@ -4218,50 +4350,50 @@ define Printable_tree private_download(url,name,extra,action) then format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https, action_count, head_tags), text_input(options, label_text, id, name, i, w) then - [ maybe_label(label_text, id), + [ format_label(label_text, id), ""], text_input_ro(options, label_text, id, name,i,w) then - [ maybe_label(label_text, id), + [ format_label(label_text, id), ""], password_input(options, label_text, id, name,i,w) then - [ maybe_label(label_text, id), + [ format_label(label_text, id), ""], text_area(options,label_text, id, n,i,w,h) then - [ maybe_label(label_text, id), ""], + [ format_label(label_text, id), ""], file_upload(options, label, id, n, w) then - [ maybe_label(label, id), + [ format_label(label, id), ""], selector(options, label, id, n,s,cs) then - [ maybe_label(label, id), + [ format_label(label, id), ""], selector(options, label, id, n,s,cs,sd) then - [ maybe_label(label, id), + [ format_label(label, id), ""], selector_c(options, label, id, n,s,cs) then - [ maybe_label(label, id), + [ format_label(label, id), ""], selector_c(options, label, id, n,s,cs,sd) then - [ maybe_label(label, id), + [ format_label(label, id), ""], - radio_button(options, label_text, id, n, v, c) then - [ maybe_label(label_text, id), + radio_button(options, label, id, n, v, c) then + [ format_label(label, id), ""], - radio_button_r(options, label_text, id, n, v, c) then + radio_button_r(options, label, id, n, v, c) then [ "", - maybe_label(label_text, id)], - check_box(options, label_text, id, n, v, c) then - [ maybe_label(label_text, id), + format_label(label, id)], + check_box(options, label, id, n, v, c) then + [ format_label(label, id), ""] - check_box_r(options, label_text, id, n, v, c) then + check_box_r(options, label, id, n, v, c) then [ "", - maybe_label(label_text, id)] + format_label(label, id)] div(options, e) then format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https, action_count, head_tags), div_empty(options) then format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https, action_count, head_tags), hidden(_id, name, value) then - since _id is htmlId(id), + since _id is html_Id(id), [""], partial(p_content) then if p_content is partial_content(tags, html_elements) then @@ -4444,7 +4576,7 @@ define Printable_tree "://",common_name,":",to_decimal(http_port),"/\">", // action is set dynamically by // the actioner using JavaScript - if fn is htmlId(id) then + if fn is html_Id(id) then format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), "" ] @@ -4462,12 +4594,12 @@ define Printable_tree // "://",common_name,":",http_port,"/\">", // action is set dynamically by // the actioner using JavaScript - if fn is htmlId(id) then + if fn is html_Id(id) then format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), "" ], in_form(fn, content) then - if fn is htmlId(id) then + if fn is html_Id(id) then format(cinfo,id,sn,ic_v, content,is_https, action_count, head_tags), div(options, e) then format(cinfo, sn, ic_v, any_div(options, e), format_element, is_https, action_count, head_tags), diff --git a/web/CXM_widgets.anubis b/web/CXM_widgets.anubis index e9d553c..2fc79c0 100644 --- a/web/CXM_widgets.anubis +++ b/web/CXM_widgets.anubis @@ -14,23 +14,23 @@ read calexium_lib/web/CXM_making_a_web_site.anubis public define HTML_In_Form ip_input ( - HtmlId the_id, + HTML_Id the_id, WebArgName wan_prefix, String ip )= with ip_fields = split(ip, '.'), - if the_id is htmlId(id_str) then + if the_id is html_Id(id_str) then if wan_prefix is wan(field_prefix) then div([id(id_str)], sequence( [ - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_0"), init(force_nth(0,ip_fields,"")), 3), + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_0"), init(force_nth(0,ip_fields,"")), 3), text("."), - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_1"), init(force_nth(1,ip_fields,"")), 3), + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_1"), init(force_nth(1,ip_fields,"")), 3), text("."), - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_2"), init(force_nth(2,ip_fields,"")), 3), + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_2"), init(force_nth(2,ip_fields,"")), 3), text("."), - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_3"), init(force_nth(3,ip_fields,"")), 3), + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_3"), init(force_nth(3,ip_fields,"")), 3), ])) . @@ -39,21 +39,21 @@ public define HTML_In_Form public define HTML_In_Form partial_ip_input ( - HtmlId the_id, + HTML_Id the_id, WebArgName wan_prefix, List(String) ip_fixed_part, String ip )= with ip_fields = split(ip, '.'), - if the_id is htmlId(id_str) then + if the_id is html_Id(id_str) then if wan_prefix is wan(field_prefix) then with make_field = (Int index) |-> if index < length(ip_fixed_part) then text([], force_nth(index, ip_fixed_part, "")) else text_input([class("ip_input")], - "", - htmlId(""), + no_label, + html_Id(""), wan(field_prefix + "_" + index), init(force_nth(index, ip_fields, "")), 3), diff --git a/web/widgets/css_helper.anubis b/web/widgets/css_helper.anubis index 5ecdca3..d4a2e8d 100644 --- a/web/widgets/css_helper.anubis +++ b/web/widgets/css_helper.anubis @@ -188,7 +188,7 @@ public define HTML_Partial_Content table([/*class("module"), */ attr("cellspacing","0")], make_changelist_rows(items, [], 1)))) . -public define HTML_Off_Form + public define HTML_Off_Form html_tooltip ( String title, @@ -209,7 +209,7 @@ public define HTML_Off_Form actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword), ("width", to_decimal(width))], []). -public define HTML_In_Form + public define HTML_In_Form html_tooltip ( String title, diff --git a/web/widgets/fisheye_menu.anubis b/web/widgets/fisheye_menu.anubis index 28be203..e136091 100644 --- a/web/widgets/fisheye_menu.anubis +++ b/web/widgets/fisheye_menu.anubis @@ -55,7 +55,7 @@ public define HTML_Partial_Content if entries is { [] then partial_content([], literal("")), - [_ . _] then partial_content(jquery_animate(childs(htmlId("top_menu")), size_on_hover(64, 64, 350, 1420)), + [_ . _] then partial_content(jquery_animate(childs(html_Id("top_menu")), size_on_hover(64, 64, 350, 1420)), div([id("top_menu"), style("min-height:70px!important;vertical-align:top;display:table-row")], sequence([ -- libgit2 0.21.4