Commit bc9219ca266359876570b1642e5f279da9a79d41
1 parent
7437969b
Create HTML_Label with tooltip in the input label
change HtmlId by HTML_Id
Showing
9 changed files
with
496 additions
and
356 deletions
Show diff stats
web/CXM_dojo.anubis
| @@ -67,11 +67,11 @@ public type Input_Type: | @@ -67,11 +67,11 @@ public type Input_Type: | ||
| 67 | password. | 67 | password. |
| 68 | 68 | ||
| 69 | public type InputDial: | 69 | public type InputDial: |
| 70 | - input_dial(HtmlId id, Input_Type input_type, String label, Maybe(String) class), | ||
| 71 | - input_date(HtmlId id, String label), | ||
| 72 | - input_combo(HtmlId id, String label, List((List(CoreAttrs), WebArgValue, String)) list_data), | ||
| 73 | - input_check(HtmlId id, String label, Bool checked), | ||
| 74 | - input_hidden(HtmlId id, WebArgValue value). | 70 | + input_dial(HTML_Id id, Input_Type input_type, String label, Maybe(String) class), |
| 71 | + input_date(HTML_Id id, String label), | ||
| 72 | + input_combo(HTML_Id id, String label, List((List(CoreAttrs), WebArgValue, String)) list_data), | ||
| 73 | + input_check(HTML_Id id, String label, Bool checked), | ||
| 74 | + input_hidden(HTML_Id id, WebArgValue value). | ||
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | define List(HTML_Off_Form) | 77 | define List(HTML_Off_Form) |
| @@ -92,7 +92,7 @@ public define HTML_Off_Form | @@ -92,7 +92,7 @@ public define HTML_Off_Form | ||
| 92 | dojo_combobox | 92 | dojo_combobox |
| 93 | ( | 93 | ( |
| 94 | WebArgName the_name, | 94 | WebArgName the_name, |
| 95 | - HtmlId the_id, | 95 | + HTML_Id the_id, |
| 96 | String label, | 96 | String label, |
| 97 | List((List(CoreAttrs), WebArgValue, String)) list_data, | 97 | List((List(CoreAttrs), WebArgValue, String)) list_data, |
| 98 | )= | 98 | )= |
| @@ -110,7 +110,7 @@ define HTML_Off_Form | @@ -110,7 +110,7 @@ define HTML_Off_Form | ||
| 110 | _maybe_label | 110 | _maybe_label |
| 111 | ( | 111 | ( |
| 112 | String label_text, | 112 | String label_text, |
| 113 | - HtmlId html_id | 113 | + HTML_Id html_id |
| 114 | ) = | 114 | ) = |
| 115 | if length(label_text) > 0 then literal("<label for=\"" + html_id.id + "\">" + label_text + "</label>") | 115 | if length(label_text) > 0 then literal("<label for=\"" + html_id.id + "\">" + label_text + "</label>") |
| 116 | else literal(""). | 116 | else literal(""). |
| @@ -119,7 +119,7 @@ public define HTML_Off_Form | @@ -119,7 +119,7 @@ public define HTML_Off_Form | ||
| 119 | dojo_checkbox | 119 | dojo_checkbox |
| 120 | ( | 120 | ( |
| 121 | WebArgName the_name, | 121 | WebArgName the_name, |
| 122 | - HtmlId the_id, | 122 | + HTML_Id the_id, |
| 123 | String label, | 123 | String label, |
| 124 | WebArgValue val, | 124 | WebArgValue val, |
| 125 | Bool checked, | 125 | Bool checked, |
| @@ -316,7 +316,7 @@ define String to_String(DojoGridView view) = | @@ -316,7 +316,7 @@ define String to_String(DojoGridView view) = | ||
| 316 | public define String | 316 | public define String |
| 317 | dojo_make_grid_script | 317 | dojo_make_grid_script |
| 318 | ( | 318 | ( |
| 319 | - HtmlId html_id, | 319 | + HTML_Id html_id, |
| 320 | DojoGridLayout layout, | 320 | DojoGridLayout layout, |
| 321 | String layout_name, | 321 | String layout_name, |
| 322 | String store_name, | 322 | String store_name, |
| @@ -333,7 +333,7 @@ public define String | @@ -333,7 +333,7 @@ public define String | ||
| 333 | public define HTML_Off_Form | 333 | public define HTML_Off_Form |
| 334 | dojo_make_grid_script | 334 | dojo_make_grid_script |
| 335 | ( | 335 | ( |
| 336 | - HtmlId html_id, | 336 | + HTML_Id html_id, |
| 337 | List(String) columns, | 337 | List(String) columns, |
| 338 | Bool can_edit | 338 | Bool can_edit |
| 339 | ) | 339 | ) |
| @@ -349,7 +349,7 @@ public define HTML_Off_Form | @@ -349,7 +349,7 @@ public define HTML_Off_Form | ||
| 349 | public define HTML_Off_Form | 349 | public define HTML_Off_Form |
| 350 | dojo_grid | 350 | dojo_grid |
| 351 | ( | 351 | ( |
| 352 | - HtmlId html_id, | 352 | + HTML_Id html_id, |
| 353 | Int rowsPerPage, | 353 | Int rowsPerPage, |
| 354 | List(Table_Option) attributes, | 354 | List(Table_Option) attributes, |
| 355 | )= | 355 | )= |
| @@ -361,7 +361,7 @@ public define HTML_Off_Form | @@ -361,7 +361,7 @@ public define HTML_Off_Form | ||
| 361 | public define HTML_Off_Form | 361 | public define HTML_Off_Form |
| 362 | dojo_grid | 362 | dojo_grid |
| 363 | ( | 363 | ( |
| 364 | - HtmlId html_id, | 364 | + HTML_Id html_id, |
| 365 | List(CoreAttrs) attributes, | 365 | List(CoreAttrs) attributes, |
| 366 | // List(GridColumn) columns, | 366 | // List(GridColumn) columns, |
| 367 | String colum1, | 367 | String colum1, |
| @@ -558,7 +558,7 @@ public define HTML_Off_Form | @@ -558,7 +558,7 @@ public define HTML_Off_Form | ||
| 558 | ( | 558 | ( |
| 559 | List(CoreAttrs) attributes, | 559 | List(CoreAttrs) attributes, |
| 560 | List(Text_Option) txt_attr, | 560 | List(Text_Option) txt_attr, |
| 561 | - HtmlId html_id, | 561 | + HTML_Id html_id, |
| 562 | String label, | 562 | String label, |
| 563 | HTML_Off_Form tooltip_content, | 563 | HTML_Off_Form tooltip_content, |
| 564 | )= | 564 | )= |
| @@ -571,7 +571,7 @@ public define HTML_Off_Form | @@ -571,7 +571,7 @@ public define HTML_Off_Form | ||
| 571 | public define HTML_Off_Form | 571 | public define HTML_Off_Form |
| 572 | dojo_button | 572 | dojo_button |
| 573 | ( | 573 | ( |
| 574 | - HtmlId html_id, | 574 | + HTML_Id html_id, |
| 575 | // Maybe(String) class, | 575 | // Maybe(String) class, |
| 576 | String name, | 576 | String name, |
| 577 | String iconclass, | 577 | String iconclass, |
| @@ -595,7 +595,7 @@ public define HTML_Off_Form | @@ -595,7 +595,7 @@ public define HTML_Off_Form | ||
| 595 | public define HTML_In_Form | 595 | public define HTML_In_Form |
| 596 | dojo_button | 596 | dojo_button |
| 597 | ( | 597 | ( |
| 598 | - HtmlId html_id, | 598 | + HTML_Id html_id, |
| 599 | // Maybe(String) class, | 599 | // Maybe(String) class, |
| 600 | String name, | 600 | String name, |
| 601 | String iconclass, | 601 | String iconclass, |
| @@ -642,7 +642,7 @@ public define HTML_Off_Form | @@ -642,7 +642,7 @@ public define HTML_Off_Form | ||
| 642 | dojo_editor | 642 | dojo_editor |
| 643 | ( | 643 | ( |
| 644 | List(CoreAttrs) attributes, | 644 | List(CoreAttrs) attributes, |
| 645 | - HtmlId html_id, | 645 | + HTML_Id html_id, |
| 646 | WebArgName input_name, | 646 | WebArgName input_name, |
| 647 | HTML_Off_Form text, | 647 | HTML_Off_Form text, |
| 648 | )= | 648 | )= |
| @@ -653,7 +653,7 @@ public define HTML_Off_Form | @@ -653,7 +653,7 @@ public define HTML_Off_Form | ||
| 653 | public define HTML_In_Form | 653 | public define HTML_In_Form |
| 654 | dojo_button | 654 | dojo_button |
| 655 | ( | 655 | ( |
| 656 | - HtmlId html_id, | 656 | + HTML_Id html_id, |
| 657 | String name, | 657 | String name, |
| 658 | String iconclass, | 658 | String iconclass, |
| 659 | Maybe(String) tip_msg, | 659 | Maybe(String) tip_msg, |
| @@ -671,33 +671,33 @@ public define HTML_Off_Form | @@ -671,33 +671,33 @@ public define HTML_Off_Form | ||
| 671 | public define HTML_In_Form | 671 | public define HTML_In_Form |
| 672 | dojo_checkbox | 672 | dojo_checkbox |
| 673 | ( | 673 | ( |
| 674 | - List(InputAttrs) attributes, | 674 | + List(CoreAttrs) attributes, |
| 675 | WebArgName name, | 675 | WebArgName name, |
| 676 | - HtmlId id, | ||
| 677 | - String label, | 676 | + HTML_Id id, |
| 677 | + String label_str, | ||
| 678 | WebArgValue val, | 678 | WebArgValue val, |
| 679 | Bool checked, | 679 | Bool checked, |
| 680 | )= | 680 | )= |
| 681 | - check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label, id, name, val, checked). | 681 | + check_box_r([attr("dojoType", "dijit.form.CheckBox") . attributes] , label(label_str, no_help), id, name, val, checked). |
| 682 | 682 | ||
| 683 | public define HTML_In_Form | 683 | public define HTML_In_Form |
| 684 | dojo_combobox | 684 | dojo_combobox |
| 685 | ( | 685 | ( |
| 686 | - List(InputAttrs) attributes, | 686 | + List(CoreAttrs) attributes, |
| 687 | WebArgName name, | 687 | WebArgName name, |
| 688 | - HtmlId id, | ||
| 689 | - String label, | 688 | + HTML_Id id, |
| 689 | + String label_str, | ||
| 690 | List((List(CoreAttrs),WebArgValue,String)) list_data, | 690 | List((List(CoreAttrs),WebArgValue,String)) list_data, |
| 691 | InitialValue selected, | 691 | InitialValue selected, |
| 692 | )= | 692 | )= |
| 693 | // selector_c([attr("dojoType", "dijit.form.ComboBox") . attributes], label, id, name, 1, list_data, selected, non_mandatory). | 693 | // selector_c([attr("dojoType", "dijit.form.ComboBox") . attributes], label, id, name, 1, list_data, selected, non_mandatory). |
| 694 | - selector_c(attributes, label, id, name, 1, list_data, selected). | 694 | + selector_c([attr("dojoType", "dijit.form.ComboBox") . attributes], label(label_str, no_help), id, name, 1, list_data, selected). |
| 695 | 695 | ||
| 696 | public define HTML_Off_Form | 696 | public define HTML_Off_Form |
| 697 | dojo_toaster | 697 | dojo_toaster |
| 698 | ( | 698 | ( |
| 699 | List(CoreAttrs) attributes, | 699 | List(CoreAttrs) attributes, |
| 700 | - HtmlId html_id, | 700 | + HTML_Id html_id, |
| 701 | String message_topic, | 701 | String message_topic, |
| 702 | Position_Direction position_direction, | 702 | Position_Direction position_direction, |
| 703 | Bool separator, | 703 | Bool separator, |
| @@ -720,7 +720,7 @@ public define HTML_Off_Form | @@ -720,7 +720,7 @@ public define HTML_Off_Form | ||
| 720 | ( | 720 | ( |
| 721 | List(CoreAttrs) attributes, | 721 | List(CoreAttrs) attributes, |
| 722 | List(Text_Option) attributes_text, | 722 | List(Text_Option) attributes_text, |
| 723 | - HtmlId html_id, | 723 | + HTML_Id html_id, |
| 724 | String label | 724 | String label |
| 725 | )= | 725 | )= |
| 726 | sequence([ | 726 | sequence([ |
| @@ -733,7 +733,7 @@ public define HTML_Off_Form | @@ -733,7 +733,7 @@ public define HTML_Off_Form | ||
| 733 | ( | 733 | ( |
| 734 | List(CoreAttrs) attributes, | 734 | List(CoreAttrs) attributes, |
| 735 | List(Text_Option) attributes_text, | 735 | List(Text_Option) attributes_text, |
| 736 | - HtmlId html_id, | 736 | + HTML_Id html_id, |
| 737 | String label, | 737 | String label, |
| 738 | Int progress, | 738 | Int progress, |
| 739 | Int maximum | 739 | Int maximum |
web/CXM_form.anubis
| @@ -30,145 +30,167 @@ public type Width: | @@ -30,145 +30,167 @@ public type Width: | ||
| 30 | public type FormFieldWidth: | 30 | public type FormFieldWidth: |
| 31 | auto, | 31 | auto, |
| 32 | custom(Int). | 32 | custom(Int). |
| 33 | - | ||
| 34 | -public type CXM_FormTooltip: | ||
| 35 | - tooltip(String title, String content, Int width). | ||
| 36 | 33 | ||
| 37 | public type CXM_Form_Field: | 34 | public type CXM_Form_Field: |
| 38 | - no_field, // empty field | 35 | + no_field, // empty field |
| 39 | 36 | ||
| 40 | //--- title field --------------------------------------------------------------------- | 37 | //--- title field --------------------------------------------------------------------- |
| 41 | - title (String text), | ||
| 42 | -// title (Int text_size, | ||
| 43 | -// String text), | ||
| 44 | -// title_f (List(Text_Option) -> HTML_In_Form), | 38 | + title( |
| 39 | + String text | ||
| 40 | + ), | ||
| 45 | 41 | ||
| 46 | //--- message field ------------------------------------------------------------------- | 42 | //--- message field ------------------------------------------------------------------- |
| 47 | - message (String text), | 43 | + message( |
| 44 | + String text | ||
| 45 | + ), | ||
| 48 | 46 | ||
| 49 | //--- text input field ---------------------------------------------------------------- | 47 | //--- text input field ---------------------------------------------------------------- |
| 50 | - input (List(InputAttrs) options, | ||
| 51 | - String label, | ||
| 52 | - HtmlId id, | ||
| 53 | - WebArgName web_arg_name, | ||
| 54 | - InitialValue init_value, | ||
| 55 | - Width width, | ||
| 56 | - Mandatory mandatory), | ||
| 57 | - input_readonly (List(InputAttrs) options, | ||
| 58 | - String label, | ||
| 59 | - HtmlId id, | ||
| 60 | - WebArgName web_arg_name, | ||
| 61 | - InitialValue init_value, | ||
| 62 | - Width width), | 48 | + input( |
| 49 | + List(CoreAttrs) options, | ||
| 50 | + HTML_Label label, | ||
| 51 | + HTML_Id id, | ||
| 52 | + WebArgName web_arg_name, | ||
| 53 | + InitialValue init_value, | ||
| 54 | + Width width, | ||
| 55 | + Mandatory mandatory | ||
| 56 | + ), | ||
| 57 | + | ||
| 58 | + input_readonly( | ||
| 59 | + List(CoreAttrs) options, | ||
| 60 | + HTML_Label label, | ||
| 61 | + HTML_Id id, | ||
| 62 | + WebArgName web_arg_name, | ||
| 63 | + InitialValue init_value, | ||
| 64 | + Width width | ||
| 65 | + ), | ||
| 63 | 66 | ||
| 64 | //--- text area field ----------------------------------------------------------------- | 67 | //--- text area field ----------------------------------------------------------------- |
| 65 | - text_area (List(TextAreaOption) options, | ||
| 66 | - String label, | ||
| 67 | - HtmlId id, | ||
| 68 | - WebArgName web_arg_name, | ||
| 69 | - InitialValue init_value, | ||
| 70 | - Width width, | ||
| 71 | - Int height, | ||
| 72 | - Mandatory mandatory), | 68 | + text_area( |
| 69 | + List(TextAreaOption) options, | ||
| 70 | + HTML_Label label, | ||
| 71 | + HTML_Id id, | ||
| 72 | + WebArgName web_arg_name, | ||
| 73 | + InitialValue init_value, | ||
| 74 | + Width width, | ||
| 75 | + Int height, | ||
| 76 | + Mandatory mandatory | ||
| 77 | + ), | ||
| 73 | 78 | ||
| 74 | //--- password input field ------------------------------------------------------------ | 79 | //--- password input field ------------------------------------------------------------ |
| 75 | - password_input (List(InputAttrs) options, | ||
| 76 | - String label, | ||
| 77 | - HtmlId id, | ||
| 78 | - WebArgName web_arg_name, | ||
| 79 | - InitialValue init_value, | ||
| 80 | - Width width, | ||
| 81 | - Mandatory mandatory), | 80 | + password_input( |
| 81 | + List(CoreAttrs) options, | ||
| 82 | + HTML_Label label, | ||
| 83 | + HTML_Id id, | ||
| 84 | + WebArgName web_arg_name, | ||
| 85 | + InitialValue init_value, | ||
| 86 | + Width width, | ||
| 87 | + Mandatory mandatory), | ||
| 82 | 88 | ||
| 83 | //--- hidden field ------------------------------------------------------------ | 89 | //--- hidden field ------------------------------------------------------------ |
| 84 | - hidden (HtmlId id, | ||
| 85 | - WebArgName web_arg_name, | ||
| 86 | - WebArgValue init_value), | 90 | + hidden( |
| 91 | + HTML_Id id, | ||
| 92 | + WebArgName web_arg_name, | ||
| 93 | + WebArgValue init_value | ||
| 94 | + ), | ||
| 87 | //--- explanation field --------------------------------------------------------------- | 95 | //--- explanation field --------------------------------------------------------------- |
| 88 | - explain (String text), | 96 | + explain( |
| 97 | + String text | ||
| 98 | + ), | ||
| 89 | 99 | ||
| 90 | //--- selector field ------------------------------------------------------------------ | 100 | //--- selector field ------------------------------------------------------------------ |
| 91 | - selector (List(InputAttrs) options, | ||
| 92 | - String label, | ||
| 93 | - HtmlId id, | ||
| 94 | - WebArgName web_arg_name, | ||
| 95 | - Int size, | ||
| 96 | - List(String) items, | ||
| 97 | - Maybe(InitialValue) selected, | ||
| 98 | - Mandatory mandatory), | 101 | + selector( |
| 102 | + List(CoreAttrs) options, | ||
| 103 | + HTML_Label label, | ||
| 104 | + HTML_Id id, | ||
| 105 | + WebArgName web_arg_name, | ||
| 106 | + Int size, | ||
| 107 | + List(String) items, | ||
| 108 | + Maybe(InitialValue) selected, | ||
| 109 | + Mandatory mandatory | ||
| 110 | + ), | ||
| 99 | 111 | ||
| 100 | - selector_c (List(InputAttrs) options, | ||
| 101 | - String label, | ||
| 102 | - HtmlId id, | ||
| 103 | - WebArgName web_arg_name, | ||
| 104 | - Int size, | ||
| 105 | - List((List(CoreAttrs), WebArgValue, String)) items, | ||
| 106 | - Maybe(InitialValue) selected, | ||
| 107 | - Mandatory mandatory), | 112 | + selector_c( |
| 113 | + List(CoreAttrs) options, | ||
| 114 | + HTML_Label label, | ||
| 115 | + HTML_Id id, | ||
| 116 | + WebArgName web_arg_name, | ||
| 117 | + Int size, | ||
| 118 | + List((List(CoreAttrs), WebArgValue, String)) items, | ||
| 119 | + Maybe(InitialValue) selected, | ||
| 120 | + Mandatory mandatory | ||
| 121 | + ), | ||
| 108 | 122 | ||
| 109 | - selector_hide_show (List(InputAttrs) options, | ||
| 110 | - String label, | ||
| 111 | - HtmlId id, | 123 | + selector_hide_show (List(CoreAttrs) options, |
| 124 | + HTML_Label label, | ||
| 125 | + HTML_Id id, | ||
| 112 | WebArgName web_arg_name, | 126 | WebArgName web_arg_name, |
| 113 | - Int size, | 127 | + Int size, |
| 114 | List((List(CoreAttrs), WebArgValue, String, HTML_Partial_Content)) items, | 128 | List((List(CoreAttrs), WebArgValue, String, HTML_Partial_Content)) items, |
| 115 | Maybe(InitialValue) selected, | 129 | Maybe(InitialValue) selected, |
| 116 | Mandatory mandatory), | 130 | Mandatory mandatory), |
| 117 | 131 | ||
| 118 | //--- checkbox field ------------------------------------------------------------------ | 132 | //--- checkbox field ------------------------------------------------------------------ |
| 119 | - checkbox (List(InputAttrs) options, | ||
| 120 | - String label, | ||
| 121 | - HtmlId id, | ||
| 122 | - WebArgName web_arg_name, | ||
| 123 | - WebArgValue web_arg_value, | ||
| 124 | - Bool checked, | ||
| 125 | - Mandatory mandatory), | 133 | + checkbox (List(CoreAttrs) options, |
| 134 | + HTML_Label label, | ||
| 135 | + HTML_Id id, | ||
| 136 | + WebArgName web_arg_name, | ||
| 137 | + WebArgValue web_arg_value, | ||
| 138 | + Bool checked, | ||
| 139 | + Mandatory mandatory), | ||
| 126 | 140 | ||
| 127 | // the same one, but with the tag on the right of the checkbox | 141 | // the same one, but with the tag on the right of the checkbox |
| 128 | - checkboxr (List(InputAttrs) options, | ||
| 129 | - String label, | ||
| 130 | - HtmlId id, | ||
| 131 | - WebArgName web_arg_name, | ||
| 132 | - WebArgValue web_arg_value, | ||
| 133 | - Bool checked, | ||
| 134 | - Mandatory mandatory), | 142 | + checkboxr( |
| 143 | + List(CoreAttrs) options, | ||
| 144 | + HTML_Label label, | ||
| 145 | + HTML_Id id, | ||
| 146 | + WebArgName web_arg_name, | ||
| 147 | + WebArgValue web_arg_value, | ||
| 148 | + Bool checked, | ||
| 149 | + Mandatory mandatory | ||
| 150 | + ), | ||
| 135 | 151 | ||
| 136 | //checkbox_hide_show | 152 | //checkbox_hide_show |
| 137 | - checkbox_hide_show( List(InputAttrs) options, | ||
| 138 | - String label, | ||
| 139 | - WebArgName web_arg_name, | ||
| 140 | - WebArgValue web_arg_value, | ||
| 141 | - Bool checked, | ||
| 142 | - List(CXM_Form_Field) fields), | 153 | + checkbox_hide_show( |
| 154 | + List(CoreAttrs) options, | ||
| 155 | + HTML_Label label, | ||
| 156 | + WebArgName web_arg_name, | ||
| 157 | + WebArgValue web_arg_value, | ||
| 158 | + Bool checked, | ||
| 159 | + List(CXM_Form_Field) fields | ||
| 160 | + ), | ||
| 143 | 161 | ||
| 144 | //--- radio-button field -------------------------------------------------------------- | 162 | //--- radio-button field -------------------------------------------------------------- |
| 145 | - radio_button (List(InputAttrs) options, | ||
| 146 | - String label, | ||
| 147 | - HtmlId id, | ||
| 148 | - WebArgName web_arg_name, | ||
| 149 | - WebArgValue web_arg_value, | ||
| 150 | - Bool checked, | ||
| 151 | - Mandatory mandatory), | 163 | + radio_button( |
| 164 | + List(CoreAttrs) options, | ||
| 165 | + HTML_Label label, | ||
| 166 | + HTML_Id id, | ||
| 167 | + WebArgName web_arg_name, | ||
| 168 | + WebArgValue web_arg_value, | ||
| 169 | + Bool checked, | ||
| 170 | + Mandatory mandatory | ||
| 171 | + ), | ||
| 152 | //radio_button_hide_show | 172 | //radio_button_hide_show |
| 153 | radio_button_hide_show( | 173 | radio_button_hide_show( |
| 154 | - List(InputAttrs) options, | ||
| 155 | - String label, | ||
| 156 | - WebArgName web_arg_name, | ||
| 157 | - WebArgValue web_arg_value, | ||
| 158 | - Bool checked, | ||
| 159 | - List(CXM_Form_Field) fields), | 174 | + List(CoreAttrs) options, |
| 175 | + HTML_Label label, | ||
| 176 | + WebArgName web_arg_name, | ||
| 177 | + WebArgValue web_arg_value, | ||
| 178 | + Bool checked, | ||
| 179 | + List(CXM_Form_Field) fields | ||
| 180 | + ), | ||
| 160 | // the same one, but with the tag on the right of the radio_button | 181 | // the same one, but with the tag on the right of the radio_button |
| 161 | - radio_buttonr (List(InputAttrs) options, | ||
| 162 | - String label, | ||
| 163 | - HtmlId id, | 182 | + radio_buttonr (List(CoreAttrs) options, |
| 183 | + HTML_Label label, | ||
| 184 | + HTML_Id id, | ||
| 164 | WebArgName web_arg_name, | 185 | WebArgName web_arg_name, |
| 165 | WebArgValue web_arg_value, | 186 | WebArgValue web_arg_value, |
| 166 | Bool checked, | 187 | Bool checked, |
| 167 | Mandatory mandatory), | 188 | Mandatory mandatory), |
| 168 | 189 | ||
| 169 | - radio_button_list (List(InputAttrs) options, | ||
| 170 | - String label, | ||
| 171 | - HtmlId id, | 190 | + radio_button_list( |
| 191 | + List(CoreAttrs) options, | ||
| 192 | + HTML_Label label, | ||
| 193 | + HTML_Id id, | ||
| 172 | WebArgName web_arg_name, | 194 | WebArgName web_arg_name, |
| 173 | List((WebArgValue, String)) web_arg_value, | 195 | List((WebArgValue, String)) web_arg_value, |
| 174 | Maybe(InitialValue) selected, | 196 | Maybe(InitialValue) selected, |
| @@ -189,24 +211,24 @@ public type CXM_Form_Field: | @@ -189,24 +211,24 @@ public type CXM_Form_Field: | ||
| 189 | // preview (String html_text), | 211 | // preview (String html_text), |
| 190 | 212 | ||
| 191 | //--- upload field ------------------------------------------------------------------- | 213 | //--- upload field ------------------------------------------------------------------- |
| 192 | - upload (List(InputAttrs) options, | ||
| 193 | - String label, | ||
| 194 | - HtmlId id, | ||
| 195 | - WebArgName name, | ||
| 196 | - Width width, | ||
| 197 | - Mandatory mandatory), | ||
| 198 | - | ||
| 199 | - raw_in_form (HTML_In_Form html), | ||
| 200 | - raw_in_form (String label, | ||
| 201 | - HtmlId id, | ||
| 202 | - HTML_In_Form input), | 214 | + upload (List(CoreAttrs) options, |
| 215 | + HTML_Label label, | ||
| 216 | + HTML_Id id, | ||
| 217 | + WebArgName name, | ||
| 218 | + Width width, | ||
| 219 | + Mandatory mandatory), | ||
| 220 | + | ||
| 221 | + raw_in_form (HTML_In_Form html), | ||
| 222 | + label_for ( String label, | ||
| 223 | + HTML_Id id, | ||
| 224 | + HTML_In_Form input), | ||
| 203 | div (List(CoreAttrs), HTML_In_Form content), | 225 | div (List(CoreAttrs), HTML_In_Form content), |
| 204 | partial (HTML_Partial_Content p_content), | 226 | partial (HTML_Partial_Content p_content), |
| 205 | br, | 227 | br, |
| 206 | - input_with_help (CXM_Form_Field field, | ||
| 207 | - Maybe(String) help_title, | ||
| 208 | - String help_text, | ||
| 209 | - Int width), | 228 | +// input_with_help (CXM_Form_Field field, |
| 229 | +// Maybe(String) help_title, | ||
| 230 | +// String help_text, | ||
| 231 | +// Int width), | ||
| 210 | 232 | ||
| 211 | fieldset (List(CoreAttrs) options, | 233 | fieldset (List(CoreAttrs) options, |
| 212 | String legend, | 234 | String legend, |
| @@ -230,7 +252,7 @@ public type CXM_Form_Field: | @@ -230,7 +252,7 @@ public type CXM_Form_Field: | ||
| 230 | public define CXM_Form_Field | 252 | public define CXM_Form_Field |
| 231 | fieldset | 253 | fieldset |
| 232 | ( | 254 | ( |
| 233 | - HtmlId fieldSetId, | 255 | + HTML_Id fieldSetId, |
| 234 | List(CXM_Form_Field) fields | 256 | List(CXM_Form_Field) fields |
| 235 | ) = | 257 | ) = |
| 236 | fieldset([id(fieldSetId.id)], "", fields). | 258 | fieldset([id(fieldSetId.id)], "", fields). |
| @@ -252,39 +274,39 @@ public define CXM_Form_Field | @@ -252,39 +274,39 @@ public define CXM_Form_Field | ||
| 252 | 274 | ||
| 253 | public define CXM_Form_Field | 275 | public define CXM_Form_Field |
| 254 | input(WebArgName n, InitialValue init_value, Width width) | 276 | input(WebArgName n, InitialValue init_value, Width width) |
| 255 | - = input([], "", htmlId(n.name), n, init_value, width, non_mandatory). | 277 | + = input([], no_label, html_Id(n.name), n, init_value, width, non_mandatory). |
| 256 | 278 | ||
| 257 | public define CXM_Form_Field | 279 | public define CXM_Form_Field |
| 258 | - input(String label, WebArgName n, InitialValue init_value, Width width) | ||
| 259 | - = input([], label, htmlId(n.name), n, init_value, width, non_mandatory). | 280 | + input(HTML_Label label, WebArgName n, InitialValue init_value, Width width) |
| 281 | + = input([], label, html_Id(n.name), n, init_value, width, non_mandatory). | ||
| 260 | 282 | ||
| 261 | public define CXM_Form_Field | 283 | public define CXM_Form_Field |
| 262 | - input(String label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) | ||
| 263 | - = input([], label, htmlId(n.name), n, init_value, width, mand). | 284 | + input(HTML_Label label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) |
| 285 | + = input([], label, html_Id(n.name), n, init_value, width, mand). | ||
| 264 | 286 | ||
| 265 | public define CXM_Form_Field | 287 | public define CXM_Form_Field |
| 266 | - input_readonly(String label, WebArgName n, InitialValue init_value, Width width) | ||
| 267 | - = input_readonly([], label, htmlId(n.name), n, init_value, width). | 288 | + input_readonly(HTML_Label label, WebArgName n, InitialValue init_value, Width width) |
| 289 | + = input_readonly([], label, html_Id(n.name), n, init_value, width). | ||
| 268 | 290 | ||
| 269 | public define CXM_Form_Field | 291 | public define CXM_Form_Field |
| 270 | - password_input(String label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) | ||
| 271 | - = password_input([], label, htmlId(n.name), n, init_value, width, mand). | 292 | + password_input(HTML_Label label, WebArgName n, InitialValue init_value, Width width, Mandatory mand) |
| 293 | + = password_input([], label, html_Id(n.name), n, init_value, width, mand). | ||
| 272 | 294 | ||
| 273 | public define CXM_Form_Field | 295 | public define CXM_Form_Field |
| 274 | - checkbox(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | ||
| 275 | - = checkbox([], label, htmlId(n.name), n, value, checked, mand). | 296 | + checkbox(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) |
| 297 | + = checkbox([], label, html_Id(n.name), n, value, checked, mand). | ||
| 276 | 298 | ||
| 277 | public define CXM_Form_Field | 299 | public define CXM_Form_Field |
| 278 | - checkboxr(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | ||
| 279 | - = checkboxr([], label, htmlId(n.name), n, value, checked, mand). | 300 | + checkboxr(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) |
| 301 | + = checkboxr([], label, html_Id(n.name), n, value, checked, mand). | ||
| 280 | 302 | ||
| 281 | public define CXM_Form_Field | 303 | public define CXM_Form_Field |
| 282 | - radio_button(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | ||
| 283 | - = radio_button([], label, htmlId(n.name), n, value, checked, mand). | 304 | + radio_button(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) |
| 305 | + = radio_button([], label, html_Id(n.name), n, value, checked, mand). | ||
| 284 | 306 | ||
| 285 | public define CXM_Form_Field | 307 | public define CXM_Form_Field |
| 286 | - radio_buttonr(String label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) | ||
| 287 | - = radio_buttonr([], label, htmlId(n.name), n, value, checked, mand). | 308 | + radio_buttonr(HTML_Label label, WebArgName n, WebArgValue value, Bool checked, Mandatory mand) |
| 309 | + = radio_buttonr([], label, html_Id(n.name), n, value, checked, mand). | ||
| 288 | 310 | ||
| 289 | public define CXM_Form_Field | 311 | public define CXM_Form_Field |
| 290 | submit(String action_name, HtmlClass class, Maybe(String) label, String button_text, List((String,String)) extra_operands) | 312 | 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 | @@ -295,18 +317,18 @@ public define CXM_Form_Field | ||
| 295 | = submit([], htmlClass(""), action_name, label, button_text, extra_operands). | 317 | = submit([], htmlClass(""), action_name, label, button_text, extra_operands). |
| 296 | 318 | ||
| 297 | public define CXM_Form_Field | 319 | public define CXM_Form_Field |
| 298 | - upload(String label, HtmlId id, WebArgName name, Width width) | 320 | + upload(HTML_Label label, HTML_Id id, WebArgName name, Width width) |
| 299 | = upload([], label, id, name, width, non_mandatory). | 321 | = upload([], label, id, name, width, non_mandatory). |
| 300 | 322 | ||
| 301 | public define CXM_Form_Field | 323 | public define CXM_Form_Field |
| 302 | - upload(String label, HtmlId id, WebArgName name, Width width, Mandatory mand) | 324 | + upload(HTML_Label label, HTML_Id id, WebArgName name, Width width, Mandatory mand) |
| 303 | = upload([], label, id, name, width, mand). | 325 | = upload([], label, id, name, width, mand). |
| 304 | 326 | ||
| 305 | -public define CXM_Form_Field | 327 | + public define CXM_Form_Field |
| 306 | input_with_help (CXM_Form_Field field, String help_text) | 328 | input_with_help (CXM_Form_Field field, String help_text) |
| 307 | = input_with_help (field, failure, help_text, 250). | 329 | = input_with_help (field, failure, help_text, 250). |
| 308 | 330 | ||
| 309 | -public define CXM_Form_Field | 331 | + public define CXM_Form_Field |
| 310 | input_with_help (CXM_Form_Field field, String help_text, Int width) | 332 | input_with_help (CXM_Form_Field field, String help_text, Int width) |
| 311 | = input_with_help (field, failure, help_text, width). | 333 | = input_with_help (field, failure, help_text, width). |
| 312 | 334 | ||
| @@ -314,11 +336,11 @@ public define CXM_Form_Field | @@ -314,11 +336,11 @@ public define CXM_Form_Field | ||
| 314 | ip_input | 336 | ip_input |
| 315 | ( | 337 | ( |
| 316 | String label, | 338 | String label, |
| 317 | - HtmlId id, | 339 | + HTML_Id id, |
| 318 | WebArgName wan_prefix, | 340 | WebArgName wan_prefix, |
| 319 | String ip | 341 | String ip |
| 320 | )= | 342 | )= |
| 321 | - raw_in_form( | 343 | + label_for( |
| 322 | label, | 344 | label, |
| 323 | id, | 345 | id, |
| 324 | ip_input(id, wan_prefix, ip) | 346 | ip_input(id, wan_prefix, ip) |
| @@ -328,13 +350,13 @@ public define CXM_Form_Field | @@ -328,13 +350,13 @@ public define CXM_Form_Field | ||
| 328 | public define CXM_Form_Field | 350 | public define CXM_Form_Field |
| 329 | partial_ip_input | 351 | partial_ip_input |
| 330 | ( | 352 | ( |
| 331 | - String label, | ||
| 332 | - HtmlId id, | ||
| 333 | - WebArgName wan_prefix, | 353 | + String label, |
| 354 | + HTML_Id id, | ||
| 355 | + WebArgName wan_prefix, | ||
| 334 | List(String) ip_fixed_part, | 356 | List(String) ip_fixed_part, |
| 335 | String ip | 357 | String ip |
| 336 | )= | 358 | )= |
| 337 | - raw_in_form( | 359 | + label_for( |
| 338 | label, | 360 | label, |
| 339 | id, | 361 | id, |
| 340 | partial_ip_input(id, wan_prefix, ip_fixed_part, ip) | 362 | partial_ip_input(id, wan_prefix, ip_fixed_part, ip) |
| @@ -346,7 +368,7 @@ public define CXM_Form_Field | @@ -346,7 +368,7 @@ public define CXM_Form_Field | ||
| 346 | WebArgName web_arg_name, | 368 | WebArgName web_arg_name, |
| 347 | WebArgValue value | 369 | WebArgValue value |
| 348 | )= | 370 | )= |
| 349 | - hidden(htmlId(""), web_arg_name, value). | 371 | + hidden(html_Id(""), web_arg_name, value). |
| 350 | 372 | ||
| 351 | 373 | ||
| 352 | //--- explanation field --------------------- | 374 | //--- explanation field --------------------- |
| @@ -384,11 +406,17 @@ public define HTML_In_Form | @@ -384,11 +406,17 @@ public define HTML_In_Form | ||
| 384 | CXM_Form_Field ff, | 406 | CXM_Form_Field ff, |
| 385 | List(Web_arg) lwa | 407 | List(Web_arg) lwa |
| 386 | ) = | 408 | ) = |
| 387 | - with star = (Mandatory m) |-> (String) | 409 | + with star = (HTML_Label l, Mandatory m) |-> (HTML_Label) |
| 388 | if m is | 410 | if m is |
| 389 | { | 411 | { |
| 390 | - mandatory then "<span>*</span>", | ||
| 391 | - non_mandatory then "" | 412 | + mandatory then |
| 413 | + if l is | ||
| 414 | + { | ||
| 415 | + no_label then l, | ||
| 416 | + label(str, help) then label(str + "<span>*</span>", help), | ||
| 417 | + } | ||
| 418 | + | ||
| 419 | + non_mandatory then l | ||
| 392 | }, | 420 | }, |
| 393 | pixels = (Width width) |-> | 421 | pixels = (Width width) |-> |
| 394 | if width is | 422 | if width is |
| @@ -398,51 +426,30 @@ public define HTML_In_Form | @@ -398,51 +426,30 @@ public define HTML_In_Form | ||
| 398 | wide then 70, | 426 | wide then 70, |
| 399 | custom(n) then n | 427 | custom(n) then n |
| 400 | }, | 428 | }, |
| 401 | - // special case out of the div("inputable") tag. | ||
| 402 | -// if ff is submit(attrs, action_name, mb_label, button_text, extra_operands) then | ||
| 403 | -// mf_format_form_field_inside_inputable(ff, star, pixels) | ||
| 404 | -// else if ff is hidden(name, init) then | ||
| 405 | -// mf_format_form_field_inside_inputable(ff, star, pixels) | ||
| 406 | -// else if ff is sub_fieldset(fieldset) then | ||
| 407 | -// mf_format_form_field_inside_inputable(ff, star, pixels) | ||
| 408 | -// else | ||
| 409 | -// div([class("inputable")], | ||
| 410 | -// mf_format_form_field_inside_inputable(ff, star, pixels)) | ||
| 411 | - | ||
| 412 | -// sequence([ | ||
| 413 | -// literal(" <tr class=\"form_row\">\n"), | ||
| 414 | -// mf_format_form_field_inside_inputable(ff, star, pixels, failure), | ||
| 415 | -// literal(" </tr>\n"), | ||
| 416 | -// ]) | 429 | + |
| 417 | 430 | ||
| 418 | if ff is | 431 | if ff is |
| 419 | { | 432 | { |
| 420 | no_field then | 433 | no_field then |
| 421 | - literal(""), | 434 | + empty, |
| 422 | 435 | ||
| 423 | title(t) then | 436 | title(t) then |
| 424 | literal("<h2>" + t + "</h2>"), | 437 | literal("<h2>" + t + "</h2>"), |
| 425 | - | ||
| 426 | -// title(s,t) then | ||
| 427 | -// text([h_center, size(s),bold,color(rgb(0,0,0))], t), | ||
| 428 | -// | ||
| 429 | -// title_f(t) then | ||
| 430 | -// t([h_center, size(16),bold,color(rgb(0,0,0))]), | ||
| 431 | 438 | ||
| 432 | message(t) then | 439 | message(t) then |
| 433 | literal(t), | 440 | literal(t), |
| 434 | 441 | ||
| 435 | - input(options, label, id, wan, default, w, mand) then | ||
| 436 | - text_input([class("in") . options], label + star(mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w)), | 442 | + input(options, _label, id, wan, default, w, mand) then |
| 443 | + text_input([class("in") . options], star(_label, mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w)), | ||
| 437 | 444 | ||
| 438 | - input_readonly(options, label, id, name, init, w) then | ||
| 439 | - text_input_ro([class("in") . options], label, id, name, init, pixels(w)), | ||
| 440 | - | ||
| 441 | - text_area(options, label, id, wan, default, w, height, mand) then | ||
| 442 | - text_area([input_attrs([class("in")]) . options], label + star(mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w), height), | 445 | + input_readonly(options, _label, id, name, init, w) then |
| 446 | + text_input_ro([class("in") . options], _label, id, name, init, pixels(w)), | ||
| 447 | + | ||
| 448 | + text_area(options, _label, id, wan, default, w, height, mand) then | ||
| 449 | + text_area([input_attrs([class("in")]) . options], star(_label, mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w), height), | ||
| 443 | 450 | ||
| 444 | - password_input(options, label, id, name, init, w, mand) then | ||
| 445 | - password_input([class("in") . options], label + star(mand), id, name, init, pixels(w)), | 451 | + password_input(options, _label, id, name, init, w, mand) then |
| 452 | + password_input([class("in") . options], star(_label, mand), id, name, init, pixels(w)), | ||
| 446 | 453 | ||
| 447 | hidden(id, name, init) then | 454 | hidden(id, name, init) then |
| 448 | hidden(id, name, init), | 455 | hidden(id, name, init), |
| @@ -450,55 +457,55 @@ public define HTML_In_Form | @@ -450,55 +457,55 @@ public define HTML_In_Form | ||
| 450 | explain(t) then | 457 | explain(t) then |
| 451 | div([class("sub")], literal(t)), | 458 | div([class("sub")], literal(t)), |
| 452 | 459 | ||
| 453 | - selector(options, label, id, wan, size, items, selected, mand) then | ||
| 454 | - if selected is | ||
| 455 | - { | ||
| 456 | - failure then selector([class("in") . options], label + star(mand), id, wan, size, items), | ||
| 457 | - success(default) then selector([class("in") . options], label + star(mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), | ||
| 458 | - }, | 460 | + selector(options, _label, id, wan, size, items, selected, mand) then |
| 461 | + if selected is | ||
| 462 | + { | ||
| 463 | + failure then selector([class("in") . options], star(_label, mand), id, wan, size, items), | ||
| 464 | + success(default) then selector([class("in") . options], star(_label, mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), | ||
| 465 | + }, | ||
| 459 | 466 | ||
| 460 | - selector_c(options, label, id, wan, size, items, selected, mand) then | ||
| 461 | - if selected is | ||
| 462 | - { | ||
| 463 | - failure then selector_c([class("in") . options], label + star(mand), id, wan, size, items), | ||
| 464 | - success(default) then selector_c([class("in") . options], label + star(mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), | ||
| 465 | - }, | 467 | + selector_c(options, _label, id, wan, size, items, selected, mand) then |
| 468 | + if selected is | ||
| 469 | + { | ||
| 470 | + failure then selector_c([class("in") . options], star(_label, mand), id, wan, size, items), | ||
| 471 | + success(default) then selector_c([class("in") . options], star(_label, mand), id, wan, size, items, init(get_String(lwa, wan.name, default.value))), | ||
| 472 | + }, | ||
| 466 | 473 | ||
| 467 | - selector_hide_show(options, label, id, wan, size, items_with_partial, selected, mand) then | 474 | + selector_hide_show(options, _label, id, wan, size, items_with_partial, selected, mand) then |
| 468 | with div_id = generate_random_string(15), | 475 | with div_id = generate_random_string(15), |
| 469 | since construct_selector_hide_show(div_id, items_with_partial) is (items, partial_content_list), | 476 | since construct_selector_hide_show(div_id, items_with_partial) is (items, partial_content_list), |
| 470 | sequence([ | 477 | sequence([ |
| 471 | - 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)) } ), | 478 | + 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)) } ), |
| 472 | partial(partial_content(partial_content_list)) | 479 | partial(partial_content(partial_content_list)) |
| 473 | ]), | 480 | ]), |
| 474 | 481 | ||
| 475 | - checkbox(options, label, id, wan, val, checked, mand) then | ||
| 476 | - check_box([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | 482 | + checkbox(options, _label, id, wan, val, checked, mand) then |
| 483 | + check_box([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | ||
| 477 | 484 | ||
| 478 | - checkboxr(options, label, id, wan, val, checked, mand) then | ||
| 479 | - check_box_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | 485 | + checkboxr(options, _label, id, wan, val, checked, mand) then |
| 486 | + check_box_r([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | ||
| 480 | 487 | ||
| 481 | - checkbox_hide_show(options, label, wan, val, checked, fields) then | 488 | + checkbox_hide_show(options, _label, wan, val, checked, fields) then |
| 482 | with div_id = generate_random_string(15), | 489 | with div_id = generate_random_string(15), |
| 483 | sequence([ | 490 | sequence([ |
| 484 | - 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)), | 491 | + 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)), |
| 485 | 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))) | 492 | 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))) |
| 486 | ]), | 493 | ]), |
| 487 | 494 | ||
| 488 | - radio_button(options, label, id, wan, val, checked, mand) then | ||
| 489 | - 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)), | 495 | + radio_button(options, _label, id, wan, val, checked, mand) then |
| 496 | + 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)), | ||
| 490 | 497 | ||
| 491 | - radio_button_hide_show(options, label, wan, val, checked, fields) then | 498 | + radio_button_hide_show(options, _label, wan, val, checked, fields) then |
| 492 | with div_id = generate_random_string(15), | 499 | with div_id = generate_random_string(15), |
| 493 | sequence([ | 500 | sequence([ |
| 494 | - 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)), | 501 | + 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)), |
| 495 | 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))) | 502 | 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))) |
| 496 | ]), | 503 | ]), |
| 497 | 504 | ||
| 498 | - radio_buttonr(options, label, id, wan, val, checked, mand) then | ||
| 499 | - radio_button_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | 505 | + radio_buttonr(options, _label, id, wan, val, checked, mand) then |
| 506 | + radio_button_r([class("in") . options], star(_label, mand), id, wan, val, get_Bool(lwa, wan.name, checked)), | ||
| 500 | 507 | ||
| 501 | - radio_button_list (options, label, id, wan, items, selected, mand, wide) then | 508 | + radio_button_list (options, _label, id, wan, items, selected, mand, wide) then |
| 502 | with new_selected = | 509 | with new_selected = |
| 503 | if get_String(lwa, wan.name) is | 510 | if get_String(lwa, wan.name) is |
| 504 | { | 511 | { |
| @@ -507,15 +514,15 @@ public define HTML_In_Form | @@ -507,15 +514,15 @@ public define HTML_In_Form | ||
| 507 | }, | 514 | }, |
| 508 | 515 | ||
| 509 | sequence([ | 516 | sequence([ |
| 510 | - literal("<label for=\"" + wan.name + "\">" + label + star(mand) + "</label>"), | 517 | + //literal("<label for=\"" + wan.name + "\">" + label + star(_label, mand) + "</label>"), |
| 511 | div( [class("radiolist")], sequence( | 518 | div( [class("radiolist")], sequence( |
| 512 | with i = var((Int)-1), | 519 | with i = var((Int)-1), |
| 513 | itemclass = if wide then "radiolistitem_wide" else "radiolistitem", | 520 | itemclass = if wide then "radiolistitem_wide" else "radiolistitem", |
| 514 | map( ((WebArgValue, String) item) |-> | 521 | map( ((WebArgValue, String) item) |-> |
| 515 | i <- *i + 1; | 522 | i <- *i + 1; |
| 516 | if item is (wav, item_label) then | 523 | if item is (wav, item_label) then |
| 517 | - with _id = if id is htmlId(the_id) then htmlId(the_id + "_radio_" + *i), | ||
| 518 | - div([class(itemclass)], radio_button_r(options, item_label, _id, wan, wav, | 524 | + with _id = if id is html_Id(the_id) then html_Id(the_id + "_radio_" + *i), |
| 525 | + div([class(itemclass)], radio_button_r(options, label(item_label), _id, wan, wav, | ||
| 519 | if new_selected is success(v) then wav.value = v.value else false)), | 526 | if new_selected is success(v) then wav.value = v.value else false)), |
| 520 | items)) | 527 | items)) |
| 521 | ), | 528 | ), |
| @@ -525,14 +532,14 @@ public define HTML_In_Form | @@ -525,14 +532,14 @@ public define HTML_In_Form | ||
| 525 | map((CXM_Form_Field ff2) |-> cell([],format_CXM_Form_Field(ff2, lwa)),fields))]) | 532 | map((CXM_Form_Field ff2) |-> cell([],format_CXM_Form_Field(ff2, lwa)),fields))]) |
| 526 | , | 533 | , |
| 527 | 534 | ||
| 528 | - upload(options, label, id, name, w, mand) then | ||
| 529 | - file_upload([class("in") . options], label + star(mand), id, name, pixels(w)), | 535 | + upload(options, _label, id, name, w, mand) then |
| 536 | + file_upload([class("in") . options], star(_label, mand), id, name, pixels(w)), | ||
| 530 | 537 | ||
| 531 | raw_in_form(html) then html, | 538 | raw_in_form(html) then html, |
| 532 | // div([class("in")], html), | 539 | // div([class("in")], html), |
| 533 | - raw_in_form(label, id, input) then | 540 | + label_for(label, id, input) then |
| 534 | sequence([ | 541 | sequence([ |
| 535 | - if id is htmlId(_id) then | 542 | + if id is html_Id(_id) then |
| 536 | literal("<label for=\"" + _id + "\">" + label + "</label>"), | 543 | literal("<label for=\"" + _id + "\">" + label + "</label>"), |
| 537 | input | 544 | input |
| 538 | ]), | 545 | ]), |
| @@ -541,11 +548,10 @@ public define HTML_In_Form | @@ -541,11 +548,10 @@ public define HTML_In_Form | ||
| 541 | 548 | ||
| 542 | partial(p_content) then partial(p_content), | 549 | partial(p_content) then partial(p_content), |
| 543 | br then br, | 550 | br then br, |
| 544 | - input_with_help(input, help_title, help_text, width) then | ||
| 545 | - sequence([ | ||
| 546 | - format_CXM_Form_Field(input, lwa), | ||
| 547 | - html_tooltip(force_String(help_title), help_text, width), | ||
| 548 | - ]), | 551 | +// input_with_help(input, help_title, help_text, width) then |
| 552 | +// sequence([ | ||
| 553 | +// format_CXM_Form_Field(input, lwa, html_tooltip(force_String(help_title), help_text, width)), | ||
| 554 | +// ]), | ||
| 549 | 555 | ||
| 550 | fieldset(options, legend, fields) then | 556 | fieldset(options, legend, fields) then |
| 551 | sequence([ | 557 | sequence([ |
| @@ -561,7 +567,7 @@ public define HTML_In_Form | @@ -561,7 +567,7 @@ public define HTML_In_Form | ||
| 561 | blank_space(htmlClass) then | 567 | blank_space(htmlClass) then |
| 562 | div([class(htmlClass.class)], literal(" ")), | 568 | div([class(htmlClass.class)], literal(" ")), |
| 563 | 569 | ||
| 564 | - submit(attrs, htmlClass, action_name, mb_label, button_text, extra_operands) then | 570 | + submit(attrs, htmlClass, action_name, Maybe(String) mb_label, button_text, extra_operands) then |
| 565 | actioner( same, // TODO change this to allow external URL | 571 | actioner( same, // TODO change this to allow external URL |
| 566 | if mb_label is | 572 | if mb_label is |
| 567 | { | 573 | { |
| @@ -611,7 +617,7 @@ public define HTML_In_Form | @@ -611,7 +617,7 @@ public define HTML_In_Form | ||
| 611 | public define HTML_Off_Form | 617 | public define HTML_Off_Form |
| 612 | cxm_form | 618 | cxm_form |
| 613 | ( | 619 | ( |
| 614 | - HtmlId form_Id, | 620 | + HTML_Id form_Id, |
| 615 | List(CoreAttrs) options, | 621 | List(CoreAttrs) options, |
| 616 | String action_name, | 622 | String action_name, |
| 617 | List((String,String)) extra_ops, | 623 | List((String,String)) extra_ops, |
| @@ -637,12 +643,12 @@ public define HTML_Off_Form | @@ -637,12 +643,12 @@ public define HTML_Off_Form | ||
| 637 | List(Web_arg) lwa, | 643 | List(Web_arg) lwa, |
| 638 | List(CXM_Form_Field) form_fields | 644 | List(CXM_Form_Field) form_fields |
| 639 | )= | 645 | )= |
| 640 | - cxm_form(htmlId(form_name), options, action_name, extra_ops, lwa, form_fields). | 646 | + cxm_form(html_Id(form_name), options, action_name, extra_ops, lwa, form_fields). |
| 641 | 647 | ||
| 642 | public define HTML_In_Form | 648 | public define HTML_In_Form |
| 643 | cxm_fieldset | 649 | cxm_fieldset |
| 644 | ( | 650 | ( |
| 645 | - HtmlId fieldSetId, | 651 | + HTML_Id fieldSetId, |
| 646 | List(Web_arg) lwa, | 652 | List(Web_arg) lwa, |
| 647 | List(CXM_Form_Field) fields | 653 | List(CXM_Form_Field) fields |
| 648 | ) = | 654 | ) = |
| @@ -657,7 +663,7 @@ public define HTML_Off_Form | @@ -657,7 +663,7 @@ public define HTML_Off_Form | ||
| 657 | List(CoreAttrs) options, | 663 | List(CoreAttrs) options, |
| 658 | List(HTML_In_Form) fields | 664 | List(HTML_In_Form) fields |
| 659 | ) = | 665 | ) = |
| 660 | - cxm_form(htmlId(form_id), options, "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). | 666 | + cxm_form(html_Id(form_id), options, "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). |
| 661 | 667 | ||
| 662 | public define HTML_Off_Form | 668 | public define HTML_Off_Form |
| 663 | cxm_form | 669 | cxm_form |
| @@ -667,7 +673,7 @@ public define HTML_Off_Form | @@ -667,7 +673,7 @@ public define HTML_Off_Form | ||
| 667 | List(Web_arg) lwa, | 673 | List(Web_arg) lwa, |
| 668 | List(CXM_Form_Field) fields | 674 | List(CXM_Form_Field) fields |
| 669 | ) = | 675 | ) = |
| 670 | - cxm_form(htmlId(form_id), options, "", [], lwa, fields). | 676 | + cxm_form(html_Id(form_id), options, "", [], lwa, fields). |
| 671 | 677 | ||
| 672 | public define HTML_Off_Form | 678 | public define HTML_Off_Form |
| 673 | cxm_form | 679 | cxm_form |
| @@ -675,7 +681,7 @@ public define HTML_Off_Form | @@ -675,7 +681,7 @@ public define HTML_Off_Form | ||
| 675 | String form_id, | 681 | String form_id, |
| 676 | List(HTML_In_Form) fields | 682 | List(HTML_In_Form) fields |
| 677 | ) = | 683 | ) = |
| 678 | - cxm_form(htmlId(form_id), [], "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). | 684 | + cxm_form(html_Id(form_id), [], "", [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields) ). |
| 679 | 685 | ||
| 680 | public define HTML_Off_Form | 686 | public define HTML_Off_Form |
| 681 | cxm_form | 687 | cxm_form |
| @@ -692,4 +698,4 @@ public define HTML_Off_Form | @@ -692,4 +698,4 @@ public define HTML_Off_Form | ||
| 692 | String form_id, | 698 | String form_id, |
| 693 | List(CXM_Form_Field) fields | 699 | List(CXM_Form_Field) fields |
| 694 | ) = | 700 | ) = |
| 695 | - cxm_form(htmlId(form_id), [], "", [], [], fields). | 701 | + cxm_form(html_Id(form_id), [], "", [], [], fields). |
web/CXM_generic_form.anubis
| @@ -250,7 +250,7 @@ define HTML_Row(HTML_In_Form) | @@ -250,7 +250,7 @@ define HTML_Row(HTML_In_Form) | ||
| 250 | [ | 250 | [ |
| 251 | cell([right ], text([size(10)],tag)), | 251 | cell([right ], text([size(10)],tag)), |
| 252 | cell([width(7) ], star(mand)), | 252 | cell([width(7) ], star(mand)), |
| 253 | - cell([left ], text_input([], "",htmlId(""), wan, init,if w is | 253 | + cell([left ], text_input([], "",html_Id(""), wan, init,if w is |
| 254 | { | 254 | { |
| 255 | small then 10, | 255 | small then 10, |
| 256 | narrow then 50, | 256 | narrow then 50, |
| @@ -261,7 +261,7 @@ define HTML_Row(HTML_In_Form) | @@ -261,7 +261,7 @@ define HTML_Row(HTML_In_Form) | ||
| 261 | 261 | ||
| 262 | input(wan,w,init) then (List(HTML_Cell(HTML_In_Form))) | 262 | input(wan,w,init) then (List(HTML_Cell(HTML_In_Form))) |
| 263 | [ | 263 | [ |
| 264 | - cell([left,columns(3) ], text_input([], "", htmlId(""), wan,init,if w is | 264 | + cell([left,columns(3) ], text_input([], "", html_Id(""), wan,init,if w is |
| 265 | { | 265 | { |
| 266 | small then 10, | 266 | small then 10, |
| 267 | narrow then 30, | 267 | narrow then 30, |
| @@ -274,7 +274,7 @@ define HTML_Row(HTML_In_Form) | @@ -274,7 +274,7 @@ define HTML_Row(HTML_In_Form) | ||
| 274 | [ | 274 | [ |
| 275 | cell([right ], tag([size(10)])), | 275 | cell([right ], tag([size(10)])), |
| 276 | cell([width(7) ], star(mand)), | 276 | cell([width(7) ], star(mand)), |
| 277 | - cell([left ], text_input([], "", htmlId(""),wan,init,if w is | 277 | + cell([left ], text_input([], "", html_Id(""),wan,init,if w is |
| 278 | { | 278 | { |
| 279 | small then 15, | 279 | small then 15, |
| 280 | narrow then 30, | 280 | narrow then 30, |
| @@ -287,14 +287,14 @@ define HTML_Row(HTML_In_Form) | @@ -287,14 +287,14 @@ define HTML_Row(HTML_In_Form) | ||
| 287 | [ | 287 | [ |
| 288 | cell([right ], text([size(10)],tag)), | 288 | cell([right ], text([size(10)],tag)), |
| 289 | cell([width(7) ], star(mand)), | 289 | cell([width(7) ], star(mand)), |
| 290 | - cell([left ], password_input([], "",htmlId(""), wan, init(""), 30)) | 290 | + cell([left ], password_input([], "",html_Id(""), wan, init(""), 30)) |
| 291 | ], | 291 | ], |
| 292 | 292 | ||
| 293 | password_input_f(wan,tag,mand) then (List(HTML_Cell(HTML_In_Form))) | 293 | password_input_f(wan,tag,mand) then (List(HTML_Cell(HTML_In_Form))) |
| 294 | [ | 294 | [ |
| 295 | cell([right ], tag([size(10)])), | 295 | cell([right ], tag([size(10)])), |
| 296 | cell([width(7) ], star(mand)), | 296 | cell([width(7) ], star(mand)), |
| 297 | - cell([left ], password_input([], "",htmlId(""), wan, init(""), 30)) | 297 | + cell([left ], password_input([], "",html_Id(""), wan, init(""), 30)) |
| 298 | ], | 298 | ], |
| 299 | 299 | ||
| 300 | explain(t) then (List(HTML_Cell(HTML_In_Form))) | 300 | explain(t) then (List(HTML_Cell(HTML_In_Form))) |
| @@ -329,8 +329,8 @@ define HTML_Row(HTML_In_Form) | @@ -329,8 +329,8 @@ define HTML_Row(HTML_In_Form) | ||
| 329 | cell([width(7)], star(mand)), | 329 | cell([width(7)], star(mand)), |
| 330 | cell([left ], if selected is | 330 | cell([left ], if selected is |
| 331 | { | 331 | { |
| 332 | - failure then selector([], "", htmlId(""), wan,1,items) | ||
| 333 | - success(sel) then selector([], "", htmlId(""), wan,1,items, sel) | 332 | + failure then selector([], "", html_Id(""), wan,1,items) |
| 333 | + success(sel) then selector([], "", html_Id(""), wan,1,items, sel) | ||
| 334 | }) | 334 | }) |
| 335 | ], | 335 | ], |
| 336 | 336 | ||
| @@ -340,8 +340,8 @@ define HTML_Row(HTML_In_Form) | @@ -340,8 +340,8 @@ define HTML_Row(HTML_In_Form) | ||
| 340 | cell([width(7)], star(mand)), | 340 | cell([width(7)], star(mand)), |
| 341 | cell([left ], if selected is | 341 | cell([left ], if selected is |
| 342 | { | 342 | { |
| 343 | - failure then selector([], "", htmlId(""), wan,1,items) | ||
| 344 | - success(sel) then selector([], "", htmlId(""), wan,1,items, sel) | 343 | + failure then selector([], "", html_Id(""), wan,1,items) |
| 344 | + success(sel) then selector([], "", html_Id(""), wan,1,items, sel) | ||
| 345 | }) | 345 | }) |
| 346 | ], | 346 | ], |
| 347 | 347 | ||
| @@ -351,8 +351,8 @@ define HTML_Row(HTML_In_Form) | @@ -351,8 +351,8 @@ define HTML_Row(HTML_In_Form) | ||
| 351 | cell([width(7)], star(mand)), | 351 | cell([width(7)], star(mand)), |
| 352 | cell([left ], if selected is | 352 | cell([left ], if selected is |
| 353 | { | 353 | { |
| 354 | - failure then selector_c([], "", htmlId(""), wan,1,items) | ||
| 355 | - success(sel) then selector_c([], "", htmlId(""), wan,1,items,sel) | 354 | + failure then selector_c([], "", html_Id(""), wan,1,items) |
| 355 | + success(sel) then selector_c([], "", html_Id(""), wan,1,items,sel) | ||
| 356 | }) | 356 | }) |
| 357 | ], | 357 | ], |
| 358 | 358 | ||
| @@ -360,12 +360,12 @@ define HTML_Row(HTML_In_Form) | @@ -360,12 +360,12 @@ define HTML_Row(HTML_In_Form) | ||
| 360 | [ | 360 | [ |
| 361 | cell([right ], text([size(10)],tag)), | 361 | cell([right ], text([size(10)],tag)), |
| 362 | cell([width(7)], star(mand)), | 362 | cell([width(7)], star(mand)), |
| 363 | - cell([left ], check_box([], "",htmlId(""),wan, wav(wan.name),checked)) | 363 | + cell([left ], check_box([], "",html_Id(""),wan, wav(wan.name),checked)) |
| 364 | ], | 364 | ], |
| 365 | 365 | ||
| 366 | checkboxr(wan,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) | 366 | checkboxr(wan,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) |
| 367 | [ | 367 | [ |
| 368 | - cell([right ], check_box([], "",htmlId(""),wan, wav(wan.name),checked)), | 368 | + cell([right ], check_box([], "",html_Id(""),wan, wav(wan.name),checked)), |
| 369 | cell([width(7)], star(mand)), | 369 | cell([width(7)], star(mand)), |
| 370 | cell([left ], text([size(10)],tag)) | 370 | cell([left ], text([size(10)],tag)) |
| 371 | ], | 371 | ], |
| @@ -374,19 +374,19 @@ define HTML_Row(HTML_In_Form) | @@ -374,19 +374,19 @@ define HTML_Row(HTML_In_Form) | ||
| 374 | [ | 374 | [ |
| 375 | cell([right ], tag([size(10)])), | 375 | cell([right ], tag([size(10)])), |
| 376 | cell([width(7)], star(mand)), | 376 | cell([width(7)], star(mand)), |
| 377 | - cell([left ], check_box([], "",htmlId(""),wan,wav(wan.name),checked)) | 377 | + cell([left ], check_box([], "",html_Id(""),wan,wav(wan.name),checked)) |
| 378 | ], | 378 | ], |
| 379 | 379 | ||
| 380 | radio_button(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) | 380 | radio_button(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) |
| 381 | [ | 381 | [ |
| 382 | cell([right ], text([size(10)],tag)), | 382 | cell([right ], text([size(10)],tag)), |
| 383 | cell([width(7)], star(mand)), | 383 | cell([width(7)], star(mand)), |
| 384 | - cell([left ], radio_button([], "", htmlId(""), wan, wav, checked)) | 384 | + cell([left ], radio_button([], "", html_Id(""), wan, wav, checked)) |
| 385 | ], | 385 | ], |
| 386 | 386 | ||
| 387 | radio_buttonr(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) | 387 | radio_buttonr(wan,wav,tag,checked,mand) then (List(HTML_Cell(HTML_In_Form))) |
| 388 | [ | 388 | [ |
| 389 | - cell([right ], radio_button([], "", htmlId(""), wan, wav, checked)), | 389 | + cell([right ], radio_button([], "", html_Id(""), wan, wav, checked)), |
| 390 | cell([width(7)], star(mand)), | 390 | cell([width(7)], star(mand)), |
| 391 | cell([left ], text([size(10)],tag)) | 391 | cell([left ], text([size(10)],tag)) |
| 392 | ], | 392 | ], |
web/CXM_html_tooltip.anubis
| @@ -11,7 +11,9 @@ read tools/basis.anubis | @@ -11,7 +11,9 @@ read tools/basis.anubis | ||
| 11 | read calexium_lib/web/CXM_common.anubis | 11 | read calexium_lib/web/CXM_common.anubis |
| 12 | read calexium_lib/web/CXM_making_a_web_site.anubis | 12 | read calexium_lib/web/CXM_making_a_web_site.anubis |
| 13 | 13 | ||
| 14 | -public define HTML_Off_Form | 14 | +//public type HTML_Off_Form:... |
| 15 | + | ||
| 16 | + public define HTML_Off_Form | ||
| 15 | html_tooltip | 17 | html_tooltip |
| 16 | ( | 18 | ( |
| 17 | String title, | 19 | String title, |
| @@ -21,7 +23,7 @@ public define HTML_Off_Form | @@ -21,7 +23,7 @@ public define HTML_Off_Form | ||
| 21 | 23 | ||
| 22 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). | 24 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). |
| 23 | 25 | ||
| 24 | -public define HTML_Off_Form | 26 | + public define HTML_Off_Form |
| 25 | html_tooltip | 27 | html_tooltip |
| 26 | ( | 28 | ( |
| 27 | String title, | 29 | String title, |
| @@ -32,7 +34,7 @@ public define HTML_Off_Form | @@ -32,7 +34,7 @@ public define HTML_Off_Form | ||
| 32 | 34 | ||
| 33 | 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))], []). | 35 | 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))], []). |
| 34 | 36 | ||
| 35 | -public define HTML_In_Form | 37 | + public define HTML_In_Form |
| 36 | html_tooltip | 38 | html_tooltip |
| 37 | ( | 39 | ( |
| 38 | String title, | 40 | String title, |
| @@ -42,7 +44,7 @@ public define HTML_In_Form | @@ -42,7 +44,7 @@ public define HTML_In_Form | ||
| 42 | 44 | ||
| 43 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). | 45 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). |
| 44 | 46 | ||
| 45 | -public define HTML_In_Form | 47 | + public define HTML_In_Form |
| 46 | html_tooltip | 48 | html_tooltip |
| 47 | ( | 49 | ( |
| 48 | String title, | 50 | String title, |
| @@ -62,7 +64,7 @@ public define HTML_In_Form | @@ -62,7 +64,7 @@ public define HTML_In_Form | ||
| 62 | ) = | 64 | ) = |
| 63 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []). | 65 | actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []). |
| 64 | 66 | ||
| 65 | -public define HTML_Off_Form | 67 | + public define HTML_Off_Form |
| 66 | html_tooltip_ext | 68 | html_tooltip_ext |
| 67 | ( | 69 | ( |
| 68 | String title, | 70 | String title, |
| @@ -95,7 +97,7 @@ public define HTML_Off_Form | @@ -95,7 +97,7 @@ public define HTML_Off_Form | ||
| 95 | with extra_args = format_extra_operands(ext_args), | 97 | with extra_args = format_extra_operands(ext_args), |
| 96 | literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_ext="+keyword+extra_args+"\"></a>"). | 98 | literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_ext="+keyword+extra_args+"\"></a>"). |
| 97 | 99 | ||
| 98 | -public define HTML_In_Form | 100 | + public define HTML_In_Form |
| 99 | html_tooltip_ext | 101 | html_tooltip_ext |
| 100 | ( | 102 | ( |
| 101 | String title, | 103 | String title, |
web/CXM_jquery.anubis
| @@ -23,9 +23,9 @@ public type JQuery_Actioner: | @@ -23,9 +23,9 @@ public type JQuery_Actioner: | ||
| 23 | 23 | ||
| 24 | /* jQuery Selector - http://api.jquery.com/category/selectors/ */ | 24 | /* jQuery Selector - http://api.jquery.com/category/selectors/ */ |
| 25 | public type JQuerySelector: | 25 | public type JQuerySelector: |
| 26 | - element(HtmlId id), | 26 | + element(HTML_Id id), |
| 27 | element_class(String name), | 27 | element_class(String name), |
| 28 | - childs(HtmlId id). | 28 | + childs(HTML_Id id). |
| 29 | 29 | ||
| 30 | define String | 30 | define String |
| 31 | jquery_button_get_onclick_action_window_options | 31 | jquery_button_get_onclick_action_window_options |
| @@ -101,13 +101,13 @@ public define String | @@ -101,13 +101,13 @@ public define String | ||
| 101 | if selector is | 101 | if selector is |
| 102 | { | 102 | { |
| 103 | element(html_id) then | 103 | element(html_id) then |
| 104 | - if html_id is htmlId(id) then "'#" + id + "'", | 104 | + if html_id is html_Id(id) then "'#" + id + "'", |
| 105 | 105 | ||
| 106 | element_class(name) then | 106 | element_class(name) then |
| 107 | "'." + name + "'", | 107 | "'." + name + "'", |
| 108 | 108 | ||
| 109 | childs(html_id) then | 109 | childs(html_id) then |
| 110 | - if html_id is htmlId(id) then "'#" + id + " > *'" | 110 | + if html_id is html_Id(id) then "'#" + id + " > *'" |
| 111 | }. | 111 | }. |
| 112 | 112 | ||
| 113 | /* */ | 113 | /* */ |
web/CXM_making_a_web_site.anubis
| @@ -60,7 +60,8 @@ read CXM_multihost_http_server.anubis | @@ -60,7 +60,8 @@ read CXM_multihost_http_server.anubis | ||
| 60 | read web/mime.anubis | 60 | read web/mime.anubis |
| 61 | read CXM_cookies.anubis | 61 | read CXM_cookies.anubis |
| 62 | read CXM_json.anubis | 62 | read CXM_json.anubis |
| 63 | - | 63 | +//read CXM_html_tooltip.anubis |
| 64 | + | ||
| 64 | * (1) Structure of a web site. | 65 | * (1) Structure of a web site. |
| 65 | 66 | ||
| 66 | First of all we need to explain what a web site should be made of. Ideally, the | 67 | 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: | @@ -683,8 +684,8 @@ public type Reading_Way: | ||
| 683 | /** | 684 | /** |
| 684 | * String value for 'id' attribut | 685 | * String value for 'id' attribut |
| 685 | */ | 686 | */ |
| 686 | -public type HtmlId: | ||
| 687 | - htmlId(String id). | 687 | +public type HTML_Id: |
| 688 | + html_Id(String id). | ||
| 688 | 689 | ||
| 689 | /** | 690 | /** |
| 690 | * String value for 'class' attribut | 691 | * String value for 'class' attribut |
| @@ -710,7 +711,7 @@ public type WebArgValue: | @@ -710,7 +711,7 @@ public type WebArgValue: | ||
| 710 | public type InitialValue: | 711 | public type InitialValue: |
| 711 | init(String value). | 712 | init(String value). |
| 712 | 713 | ||
| 713 | -public define Printable_tree [HtmlId x . Printable_tree y] = str_pt(x.id, y). | 714 | +public define Printable_tree [HTML_Id x . Printable_tree y] = str_pt(x.id, y). |
| 714 | public define Printable_tree [HtmlClass x . Printable_tree y] = str_pt(x.class, y). | 715 | public define Printable_tree [HtmlClass x . Printable_tree y] = str_pt(x.class, y). |
| 715 | public define Printable_tree [WebArgName x . Printable_tree y] = str_pt(x.name, y). | 716 | public define Printable_tree [WebArgName x . Printable_tree y] = str_pt(x.name, y). |
| 716 | public define Printable_tree [WebArgValue x . Printable_tree y] = str_pt(x.value, y). | 717 | public define Printable_tree [WebArgValue x . Printable_tree y] = str_pt(x.value, y). |
| @@ -1116,7 +1117,58 @@ public type HTML_Head_Tag: | @@ -1116,7 +1117,58 @@ public type HTML_Head_Tag: | ||
| 1116 | css(CSS_File), | 1117 | css(CSS_File), |
| 1117 | css_inline(String css_styles) /* Note: <style> and </style> tags are not necessaries */ | 1118 | css_inline(String css_styles) /* Note: <style> and </style> tags are not necessaries */ |
| 1118 | . | 1119 | . |
| 1120 | + | ||
| 1121 | + /* Label with help */ | ||
| 1122 | + | ||
| 1123 | + | ||
| 1124 | + | ||
| 1125 | +public type HTML_tooltip: | ||
| 1126 | + html_tooltip | ||
| 1127 | + ( | ||
| 1128 | + String title, | ||
| 1129 | + String keyword, | ||
| 1130 | + Int width, | ||
| 1131 | + ), | ||
| 1132 | + html_tooltip_ext | ||
| 1133 | + ( | ||
| 1134 | + String title, | ||
| 1135 | + String extend_type, | ||
| 1136 | + String class_suffix, | ||
| 1137 | + List((String, String)) ext_args | ||
| 1138 | + ). | ||
| 1139 | + | ||
| 1140 | +public define HTML_tooltip | ||
| 1141 | + html_tooltip | ||
| 1142 | + ( | ||
| 1143 | + String keyword, | ||
| 1144 | + Int width | ||
| 1145 | + )= | ||
| 1146 | + html_tooltip("", keyword, width). | ||
| 1147 | + | ||
| 1148 | +public define HTML_tooltip | ||
| 1149 | + html_tooltip | ||
| 1150 | + ( | ||
| 1151 | + String title, | ||
| 1152 | + String keyword | ||
| 1153 | + )= | ||
| 1154 | + html_tooltip(title, keyword, 0). | ||
| 1119 | 1155 | ||
| 1156 | +public type HTML_Help_Position: | ||
| 1157 | + left, | ||
| 1158 | + right. | ||
| 1159 | + | ||
| 1160 | +public type HTML_Help: | ||
| 1161 | + no_help, //no help text available | ||
| 1162 | + tooltip(HTML_tooltip, | ||
| 1163 | + HTML_Help_Position). | ||
| 1164 | + | ||
| 1165 | +public type HTML_Label: | ||
| 1166 | + no_label, | ||
| 1167 | + label( | ||
| 1168 | + String text, //label to show | ||
| 1169 | + HTML_Help help //HTML help (tooltip with ajax call or not) | ||
| 1170 | + | ||
| 1171 | + ). | ||
| 1120 | /* It contains | 1172 | /* It contains |
| 1121 | * - a List of HTML_Head_Tag representing necessaries head tags for the content. ex: jquery js files, js script, css specific styles, ... | 1173 | * - a List of HTML_Head_Tag representing necessaries head tags for the content. ex: jquery js files, js script, css specific styles, ... |
| 1122 | * - a HTML_Off_Form representing the HTML code for the part of the page we want to display | 1174 | * - 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: | @@ -1169,25 +1221,25 @@ public type HTML_In_Form: | ||
| 1169 | foreign_link (List(Text_Option), String url, String name), | 1221 | foreign_link (List(Text_Option), String url, String name), |
| 1170 | private_download (String abs_path, String name, String extra_ext, | 1222 | private_download (String abs_path, String name, String extra_ext, |
| 1171 | Maybe((String,List((String,String)))) action), | 1223 | Maybe((String,List((String,String)))) action), |
| 1172 | - text_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), | ||
| 1173 | - text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), | ||
| 1174 | - password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), | ||
| 1175 | - text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height), | ||
| 1176 | - file_upload (List(InputAttrs), String label, HtmlId id, WebArgName name, Int width), | ||
| 1177 | - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices), | ||
| 1178 | - selector (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List(String) choices, InitialValue selected), | 1224 | + text_input (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), |
| 1225 | + text_input_ro (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), | ||
| 1226 | + password_input (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width), | ||
| 1227 | + text_area (List(TextAreaOption), HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width, Int height), | ||
| 1228 | + file_upload (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int width), | ||
| 1229 | + selector (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List(String) choices), | ||
| 1230 | + selector (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List(String) choices, InitialValue selected), | ||
| 1179 | // List((String,String)) = List((code,name)) where : | 1231 | // List((String,String)) = List((code,name)) where : |
| 1180 | // code is the web-arg value | 1232 | // code is the web-arg value |
| 1181 | // name appears in selector | 1233 | // name appears in selector |
| 1182 | - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices), | ||
| 1183 | - selector_c (List(InputAttrs), String label_text, HtmlId id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected), | ||
| 1184 | - radio_button (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1185 | - radio_button_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1186 | - check_box (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1187 | - check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), | 1234 | + selector_c (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices), |
| 1235 | + selector_c (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected), | ||
| 1236 | + radio_button (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1237 | + radio_button_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1238 | + check_box (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1239 | + check_box_r (List(CoreAttrs), HTML_Label label, HTML_Id id, WebArgName name, WebArgValue value, Bool checked), | ||
| 1188 | div (List(CoreAttrs), HTML_In_Form content), | 1240 | div (List(CoreAttrs), HTML_In_Form content), |
| 1189 | div_empty (List(CoreAttrs)), | 1241 | div_empty (List(CoreAttrs)), |
| 1190 | - hidden (HtmlId id, WebArgName name, WebArgValue value), | 1242 | + hidden (HTML_Id id, WebArgName name, WebArgValue value), |
| 1191 | partial (HTML_Partial_Content), | 1243 | partial (HTML_Partial_Content), |
| 1192 | br, | 1244 | br, |
| 1193 | progress (List(CoreAttrs), Int value, Int max), | 1245 | progress (List(CoreAttrs), Int value, Int max), |
| @@ -1244,7 +1296,7 @@ public define HTML_In_Form | @@ -1244,7 +1296,7 @@ public define HTML_In_Form | ||
| 1244 | Int width, | 1296 | Int width, |
| 1245 | Int height | 1297 | Int height |
| 1246 | ) = | 1298 | ) = |
| 1247 | - text_area([], "", htmlId(""), name,init,width,height). | 1299 | + text_area([], no_label, html_Id(""), name,init,width,height). |
| 1248 | 1300 | ||
| 1249 | public define HTML_In_Form | 1301 | public define HTML_In_Form |
| 1250 | text_area | 1302 | text_area |
| @@ -1255,7 +1307,7 @@ public define HTML_In_Form | @@ -1255,7 +1307,7 @@ public define HTML_In_Form | ||
| 1255 | Int width, | 1307 | Int width, |
| 1256 | Int height | 1308 | Int height |
| 1257 | ) = | 1309 | ) = |
| 1258 | - text_area(options, "", htmlId(""), name,init,width,height). | 1310 | + text_area(options, no_label, html_Id(""), name,init,width,height). |
| 1259 | 1311 | ||
| 1260 | public define HTML_In_Form | 1312 | public define HTML_In_Form |
| 1261 | table | 1313 | table |
| @@ -1317,29 +1369,29 @@ public define HTML_In_Form | @@ -1317,29 +1369,29 @@ public define HTML_In_Form | ||
| 1317 | text([],s). | 1369 | text([],s). |
| 1318 | 1370 | ||
| 1319 | public define HTML_In_Form | 1371 | public define HTML_In_Form |
| 1320 | - radio_button (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) | ||
| 1321 | - = radio_button (options, label_text, htmlId(n.name), n, value, checked). | 1372 | + radio_button (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) |
| 1373 | + = radio_button (options, label, html_Id(n.name), n, value, checked). | ||
| 1322 | 1374 | ||
| 1323 | public define HTML_In_Form | 1375 | public define HTML_In_Form |
| 1324 | - radio_button_r (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) | ||
| 1325 | - = radio_button_r (options, label_text, htmlId(n.name), n, value, checked). | 1376 | + radio_button_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) |
| 1377 | + = radio_button_r (options, label, html_Id(n.name), n, value, checked). | ||
| 1326 | 1378 | ||
| 1327 | public define HTML_In_Form | 1379 | public define HTML_In_Form |
| 1328 | - check_box (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) | ||
| 1329 | - = check_box (options, label_text, htmlId(n.name), n, value, checked). | 1380 | + check_box (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) |
| 1381 | + = check_box (options, label, html_Id(n.name), n, value, checked). | ||
| 1330 | 1382 | ||
| 1331 | public define HTML_In_Form | 1383 | public define HTML_In_Form |
| 1332 | - check_box_r (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked) | ||
| 1333 | - = check_box_r (options, label_text, htmlId(n.name), n, value, checked). | 1384 | + check_box_r (List(CoreAttrs) options, HTML_Label label, WebArgName n, WebArgValue value, Bool checked) |
| 1385 | + = check_box_r (options, label, html_Id(n.name), n, value, checked). | ||
| 1334 | 1386 | ||
| 1335 | public define HTML_In_Form | 1387 | public define HTML_In_Form |
| 1336 | - file_upload (WebArgName name, Int width) | ||
| 1337 | - = file_upload([], "", htmlId(""), name, width). | 1388 | + file_upload (WebArgName n, Int width) |
| 1389 | + = file_upload([], no_label, html_Id(n.name), n, width). | ||
| 1338 | 1390 | ||
| 1339 | public define HTML_In_Form | 1391 | public define HTML_In_Form |
| 1340 | hidden (WebArgName name, WebArgValue value) | 1392 | hidden (WebArgName name, WebArgValue value) |
| 1341 | = | 1393 | = |
| 1342 | - hidden(htmlId(""), name, value). | 1394 | + hidden(html_Id(""), name, value). |
| 1343 | 1395 | ||
| 1344 | public type HTML_Body:... | 1396 | public type HTML_Body:... |
| 1345 | 1397 | ||
| @@ -1373,11 +1425,11 @@ public type HTML_Off_Form: | @@ -1373,11 +1425,11 @@ public type HTML_Off_Form: | ||
| 1373 | private_download (String abs_path, String name, String extra_ext, | 1425 | private_download (String abs_path, String name, String extra_ext, |
| 1374 | Maybe((String,List((String,String)))) action), | 1426 | Maybe((String,List((String,String)))) action), |
| 1375 | label (String name), | 1427 | label (String name), |
| 1376 | - form (HtmlId form_id, List(CoreAttrs), HTML_In_Form content), | ||
| 1377 | - form (HtmlId form_id, List(CoreAttrs), | 1428 | + form (HTML_Id form_id, List(CoreAttrs), HTML_In_Form content), |
| 1429 | + form (HTML_Id form_id, List(CoreAttrs), | ||
| 1378 | String action_name, List((String,String)) extra_ops, | 1430 | String action_name, List((String,String)) extra_ops, |
| 1379 | HTML_In_Form content), | 1431 | HTML_In_Form content), |
| 1380 | - in_form (HtmlId form_id, HTML_In_Form content), | 1432 | + in_form (HTML_Id form_id, HTML_In_Form content), |
| 1381 | div (List(CoreAttrs), HTML_Off_Form content), | 1433 | div (List(CoreAttrs), HTML_Off_Form content), |
| 1382 | div (List(CoreAttrs), HTML_Partial_Content p_content), | 1434 | div (List(CoreAttrs), HTML_Partial_Content p_content), |
| 1383 | div_empty (List(CoreAttrs)), | 1435 | div_empty (List(CoreAttrs)), |
| @@ -1408,7 +1460,7 @@ public define HTML_Off_Form | @@ -1408,7 +1460,7 @@ public define HTML_Off_Form | ||
| 1408 | List(CoreAttrs) options, | 1460 | List(CoreAttrs) options, |
| 1409 | HTML_In_Form content | 1461 | HTML_In_Form content |
| 1410 | ) = | 1462 | ) = |
| 1411 | - form(htmlId(form_name), options, content). | 1463 | + form(html_Id(form_name), options, content). |
| 1412 | 1464 | ||
| 1413 | public define HTML_Off_Form | 1465 | public define HTML_Off_Form |
| 1414 | form | 1466 | form |
| @@ -1419,7 +1471,7 @@ public define HTML_Off_Form | @@ -1419,7 +1471,7 @@ public define HTML_Off_Form | ||
| 1419 | List((String,String)) extra_ops, | 1471 | List((String,String)) extra_ops, |
| 1420 | HTML_In_Form content | 1472 | HTML_In_Form content |
| 1421 | ) = | 1473 | ) = |
| 1422 | - form(htmlId(form_name), options, action_name, extra_ops, content). | 1474 | + form(html_Id(form_name), options, action_name, extra_ops, content). |
| 1423 | 1475 | ||
| 1424 | 1476 | ||
| 1425 | public define HTML_Off_Form literal(Printable_tree t) = literal_pt(t). | 1477 | public define HTML_Off_Form literal(Printable_tree t) = literal_pt(t). |
| @@ -4155,16 +4207,96 @@ define Printable_tree | @@ -4155,16 +4207,96 @@ define Printable_tree | ||
| 4155 | 4207 | ||
| 4156 | // *** [5.8] Formating 'in form' elements. | 4208 | // *** [5.8] Formating 'in form' elements. |
| 4157 | 4209 | ||
| 4210 | + | ||
| 4211 | +public define Printable_tree | ||
| 4212 | + format | ||
| 4213 | + ( | ||
| 4214 | + HTML_tooltip tooltip | ||
| 4215 | + )= | ||
| 4216 | + if tooltip is | ||
| 4217 | + { | ||
| 4218 | + html_tooltip(title, keyword, width) then | ||
| 4219 | + ["<a id=\"help_",keyword,"\" class=\"jTipu jTip_help\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&tooltip_id=",keyword,(if width > 0 then ["&width=",width,"\""] else ["\""]), "></a>"], | ||
| 4220 | + | ||
| 4221 | + html_tooltip_ext(title, extend_type, class_suffix, ext_args) then | ||
| 4222 | + with extra_args = format_extra_operands(ext_args), | ||
| 4223 | + ["<a id=\"jTip\" class=\"jTipu jTip_",class_suffix,"\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&tooltip_ext=",extend_type+extra_args,"\"></a>"] | ||
| 4224 | + }. | ||
| 4225 | + | ||
| 4226 | +public define HTML_Off_Form | ||
| 4227 | + html_tooltip | ||
| 4228 | + ( | ||
| 4229 | + String title, | ||
| 4230 | + String keyword, | ||
| 4231 | + ) = | ||
| 4232 | + literal_pt(format(html_tooltip(title, keyword, 0))). | ||
| 4233 | + | ||
| 4234 | +public define HTML_In_Form | ||
| 4235 | + html_tooltip | ||
| 4236 | + ( | ||
| 4237 | + String title, | ||
| 4238 | + String keyword, | ||
| 4239 | + ) = | ||
| 4240 | + literal_pt(format(html_tooltip(title, keyword, 0))). | ||
| 4241 | + | ||
| 4242 | +public define HTML_Off_Form | ||
| 4243 | + html_tooltip | ||
| 4244 | + ( | ||
| 4245 | + String keyword, | ||
| 4246 | + Int size, | ||
| 4247 | + ) = | ||
| 4248 | + literal_pt(format(html_tooltip("", keyword, size))). | ||
| 4249 | + | ||
| 4250 | +public define HTML_In_Form | ||
| 4251 | + html_tooltip | ||
| 4252 | + ( | ||
| 4253 | + String keyword, | ||
| 4254 | + Int size, | ||
| 4255 | + ) = | ||
| 4256 | + literal_pt(format(html_tooltip("", keyword, size))). | ||
| 4257 | + | ||
| 4258 | +public define Printable_tree | ||
| 4259 | + format_help | ||
| 4260 | + ( | ||
| 4261 | + Printable_tree label, | ||
| 4262 | + HTML_Help _help | ||
| 4263 | + ) = | ||
| 4264 | + if _help is | ||
| 4265 | + { | ||
| 4266 | + no_help then label, | ||
| 4267 | + tooltip(html_tooltip, position) then | ||
| 4268 | + if position is | ||
| 4269 | + { | ||
| 4270 | + left then pt_pt(format(html_tooltip),label), | ||
| 4271 | + right then pt_pt(label, format(html_tooltip)) | ||
| 4272 | + } | ||
| 4273 | + }. | ||
| 4274 | + | ||
| 4275 | + | ||
| 4276 | + | ||
| 4277 | +public define HTML_Label | ||
| 4278 | + label | ||
| 4279 | + ( | ||
| 4280 | + String text | ||
| 4281 | + )= | ||
| 4282 | + label(text, no_help). | ||
| 4158 | 4283 | ||
| 4159 | 4284 | ||
| 4160 | -define Printable_tree | ||
| 4161 | - maybe_label | 4285 | +public define Printable_tree |
| 4286 | + format_label | ||
| 4162 | ( | 4287 | ( |
| 4163 | - String label_text, | ||
| 4164 | - HtmlId id | 4288 | + HTML_Label _label, |
| 4289 | + HTML_Id _id | ||
| 4165 | ) = | 4290 | ) = |
| 4166 | - if length(label_text) > 0 then ["<label for=\"",id,"\">",label_text,"</label>"] | ||
| 4167 | - else []. | 4291 | + if _label is |
| 4292 | + { | ||
| 4293 | + no_label then [], | ||
| 4294 | + label(text, help) then | ||
| 4295 | + format_help( | ||
| 4296 | + ["<label"+(if _id.id ="" then "" else " for=\""+_id.id+"\"")+">",text,"</label>"], | ||
| 4297 | + help | ||
| 4298 | + ) | ||
| 4299 | + }. | ||
| 4168 | 4300 | ||
| 4169 | 4301 | ||
| 4170 | define Printable_tree | 4302 | define Printable_tree |
| @@ -4218,50 +4350,50 @@ define Printable_tree | @@ -4218,50 +4350,50 @@ define Printable_tree | ||
| 4218 | private_download(url,name,extra,action) then | 4350 | private_download(url,name,extra,action) then |
| 4219 | format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https, action_count, head_tags), | 4351 | format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https, action_count, head_tags), |
| 4220 | text_input(options, label_text, id, name, i, w) then | 4352 | text_input(options, label_text, id, name, i, w) then |
| 4221 | - [ maybe_label(label_text, id), | 4353 | + [ format_label(label_text, id), |
| 4222 | "<input type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], | 4354 | "<input type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], |
| 4223 | text_input_ro(options, label_text, id, name,i,w) then | 4355 | text_input_ro(options, label_text, id, name,i,w) then |
| 4224 | - [ maybe_label(label_text, id), | 4356 | + [ format_label(label_text, id), |
| 4225 | "<input readonly=\"readonly\" type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], | 4357 | "<input readonly=\"readonly\" type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], |
| 4226 | password_input(options, label_text, id, name,i,w) then | 4358 | password_input(options, label_text, id, name,i,w) then |
| 4227 | - [ maybe_label(label_text, id), | 4359 | + [ format_label(label_text, id), |
| 4228 | "<input type=\"password\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], | 4360 | "<input type=\"password\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs([class("in") . options])," />"], |
| 4229 | text_area(options,label_text, id, n,i,w,h) then | 4361 | text_area(options,label_text, id, n,i,w,h) then |
| 4230 | - [ maybe_label(label_text, id), "<textarea ",format(options)," id=\"",id,"\" name=\"",n,"\" cols=\"",w,"\" rows=\"",h,"\">",i,"</textarea>"], | 4362 | + [ format_label(label_text, id), "<textarea ",format(options)," id=\"",id,"\" name=\"",n,"\" cols=\"",w,"\" rows=\"",h,"\">",i,"</textarea>"], |
| 4231 | file_upload(options, label, id, n, w) then | 4363 | file_upload(options, label, id, n, w) then |
| 4232 | - [ maybe_label(label, id), | 4364 | + [ format_label(label, id), |
| 4233 | "<input type=\"file\" id=\"",id,"\" size=\"",w,"\" name=\"",n,"\"",format_attrs([class("in") . options])," />"], | 4365 | "<input type=\"file\" id=\"",id,"\" size=\"",w,"\" name=\"",n,"\"",format_attrs([class("in") . options])," />"], |
| 4234 | selector(options, label, id, n,s,cs) then | 4366 | selector(options, label, id, n,s,cs) then |
| 4235 | - [ maybe_label(label, id), | 4367 | + [ format_label(label, id), |
| 4236 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs),"</select>"], | 4368 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs),"</select>"], |
| 4237 | selector(options, label, id, n,s,cs,sd) then | 4369 | selector(options, label, id, n,s,cs,sd) then |
| 4238 | - [ maybe_label(label, id), | 4370 | + [ format_label(label, id), |
| 4239 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs,sd),"</select>"], | 4371 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs,sd),"</select>"], |
| 4240 | selector_c(options, label, id, n,s,cs) then | 4372 | selector_c(options, label, id, n,s,cs) then |
| 4241 | - [ maybe_label(label, id), | 4373 | + [ format_label(label, id), |
| 4242 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs),"</select>"], | 4374 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs),"</select>"], |
| 4243 | selector_c(options, label, id, n,s,cs,sd) then | 4375 | selector_c(options, label, id, n,s,cs,sd) then |
| 4244 | - [ maybe_label(label, id), | 4376 | + [ format_label(label, id), |
| 4245 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs,sd),"</select>"], | 4377 | "<select id=\"",id,"\" name=\"",n,"\" size=\"",s,"\" ",format_attrs([class("in") . options]),">",format_choices(cs,sd),"</select>"], |
| 4246 | 4378 | ||
| 4247 | - radio_button(options, label_text, id, n, v, c) then | ||
| 4248 | - [ maybe_label(label_text, id), | 4379 | + radio_button(options, label, id, n, v, c) then |
| 4380 | + [ format_label(label, id), | ||
| 4249 | "<input type=\"radio\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\"" else ""),format_attrs([class("in") . options])," />"], | 4381 | "<input type=\"radio\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\"" else ""),format_attrs([class("in") . options])," />"], |
| 4250 | - radio_button_r(options, label_text, id, n, v, c) then | 4382 | + radio_button_r(options, label, id, n, v, c) then |
| 4251 | [ "<input type=\"radio\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\"" else ""),format_attrs([class("in") . options])," />", | 4383 | [ "<input type=\"radio\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\"" else ""),format_attrs([class("in") . options])," />", |
| 4252 | - maybe_label(label_text, id)], | ||
| 4253 | - check_box(options, label_text, id, n, v, c) then | ||
| 4254 | - [ maybe_label(label_text, id), | 4384 | + format_label(label, id)], |
| 4385 | + check_box(options, label, id, n, v, c) then | ||
| 4386 | + [ format_label(label, id), | ||
| 4255 | "<input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />"] | 4387 | "<input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />"] |
| 4256 | - check_box_r(options, label_text, id, n, v, c) then | 4388 | + check_box_r(options, label, id, n, v, c) then |
| 4257 | [ "<input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />", | 4389 | [ "<input type=\"checkbox\" name=\"",n,"\" id=\"",id,"\" value=\"",v,"\"",(if c then " checked=\"checked\" " else ""),format_attrs([class("in") . options])," />", |
| 4258 | - maybe_label(label_text, id)] | 4390 | + format_label(label, id)] |
| 4259 | div(options, e) then | 4391 | div(options, e) then |
| 4260 | format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https, action_count, head_tags), | 4392 | format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https, action_count, head_tags), |
| 4261 | div_empty(options) then | 4393 | div_empty(options) then |
| 4262 | format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https, action_count, head_tags), | 4394 | format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https, action_count, head_tags), |
| 4263 | hidden(_id, name, value) then | 4395 | hidden(_id, name, value) then |
| 4264 | - since _id is htmlId(id), | 4396 | + since _id is html_Id(id), |
| 4265 | ["<input type=\"hidden\"",(if id = "" then "" else " id=\""+id+"\"")," name=\"",name,"\" value=\"",value,"\" />"], | 4397 | ["<input type=\"hidden\"",(if id = "" then "" else " id=\""+id+"\"")," name=\"",name,"\" value=\"",value,"\" />"], |
| 4266 | partial(p_content) then | 4398 | partial(p_content) then |
| 4267 | if p_content is partial_content(tags, html_elements) then | 4399 | if p_content is partial_content(tags, html_elements) then |
| @@ -4444,7 +4576,7 @@ define Printable_tree | @@ -4444,7 +4576,7 @@ define Printable_tree | ||
| 4444 | "://",common_name,":",to_decimal(http_port),"/\">", | 4576 | "://",common_name,":",to_decimal(http_port),"/\">", |
| 4445 | // action is set dynamically by | 4577 | // action is set dynamically by |
| 4446 | // the actioner using JavaScript | 4578 | // the actioner using JavaScript |
| 4447 | - if fn is htmlId(id) then | 4579 | + if fn is html_Id(id) then |
| 4448 | format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), | 4580 | format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), |
| 4449 | "</form>" | 4581 | "</form>" |
| 4450 | ] | 4582 | ] |
| @@ -4462,12 +4594,12 @@ define Printable_tree | @@ -4462,12 +4594,12 @@ define Printable_tree | ||
| 4462 | // "://",common_name,":",http_port,"/\">", | 4594 | // "://",common_name,":",http_port,"/\">", |
| 4463 | // action is set dynamically by | 4595 | // action is set dynamically by |
| 4464 | // the actioner using JavaScript | 4596 | // the actioner using JavaScript |
| 4465 | - if fn is htmlId(id) then | 4597 | + if fn is html_Id(id) then |
| 4466 | format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), | 4598 | format(cinfo,id,sn,ic_v,c,is_https, action_count, head_tags), |
| 4467 | "</form>" | 4599 | "</form>" |
| 4468 | ], | 4600 | ], |
| 4469 | in_form(fn, content) then | 4601 | in_form(fn, content) then |
| 4470 | - if fn is htmlId(id) then | 4602 | + if fn is html_Id(id) then |
| 4471 | format(cinfo,id,sn,ic_v, content,is_https, action_count, head_tags), | 4603 | format(cinfo,id,sn,ic_v, content,is_https, action_count, head_tags), |
| 4472 | div(options, e) then | 4604 | div(options, e) then |
| 4473 | format(cinfo, sn, ic_v, any_div(options, e), format_element, is_https, action_count, head_tags), | 4605 | format(cinfo, sn, ic_v, any_div(options, e), format_element, is_https, action_count, head_tags), |
web/CXM_widgets.anubis
| @@ -14,23 +14,23 @@ read calexium_lib/web/CXM_making_a_web_site.anubis | @@ -14,23 +14,23 @@ read calexium_lib/web/CXM_making_a_web_site.anubis | ||
| 14 | public define HTML_In_Form | 14 | public define HTML_In_Form |
| 15 | ip_input | 15 | ip_input |
| 16 | ( | 16 | ( |
| 17 | - HtmlId the_id, | 17 | + HTML_Id the_id, |
| 18 | WebArgName wan_prefix, | 18 | WebArgName wan_prefix, |
| 19 | String ip | 19 | String ip |
| 20 | )= | 20 | )= |
| 21 | with ip_fields = split(ip, '.'), | 21 | with ip_fields = split(ip, '.'), |
| 22 | - if the_id is htmlId(id_str) then | 22 | + if the_id is html_Id(id_str) then |
| 23 | if wan_prefix is wan(field_prefix) then | 23 | if wan_prefix is wan(field_prefix) then |
| 24 | div([id(id_str)], | 24 | div([id(id_str)], |
| 25 | sequence( | 25 | sequence( |
| 26 | [ | 26 | [ |
| 27 | - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_0"), init(force_nth(0,ip_fields,"")), 3), | 27 | + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_0"), init(force_nth(0,ip_fields,"")), 3), |
| 28 | text("."), | 28 | text("."), |
| 29 | - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_1"), init(force_nth(1,ip_fields,"")), 3), | 29 | + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_1"), init(force_nth(1,ip_fields,"")), 3), |
| 30 | text("."), | 30 | text("."), |
| 31 | - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_2"), init(force_nth(2,ip_fields,"")), 3), | 31 | + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_2"), init(force_nth(2,ip_fields,"")), 3), |
| 32 | text("."), | 32 | text("."), |
| 33 | - text_input([class("ip_input")], "", htmlId(""), wan(field_prefix+"_3"), init(force_nth(3,ip_fields,"")), 3), | 33 | + text_input([class("ip_input")], no_label, html_Id(""), wan(field_prefix+"_3"), init(force_nth(3,ip_fields,"")), 3), |
| 34 | ])) | 34 | ])) |
| 35 | . | 35 | . |
| 36 | 36 | ||
| @@ -39,21 +39,21 @@ public define HTML_In_Form | @@ -39,21 +39,21 @@ public define HTML_In_Form | ||
| 39 | public define HTML_In_Form | 39 | public define HTML_In_Form |
| 40 | partial_ip_input | 40 | partial_ip_input |
| 41 | ( | 41 | ( |
| 42 | - HtmlId the_id, | 42 | + HTML_Id the_id, |
| 43 | WebArgName wan_prefix, | 43 | WebArgName wan_prefix, |
| 44 | List(String) ip_fixed_part, | 44 | List(String) ip_fixed_part, |
| 45 | String ip | 45 | String ip |
| 46 | )= | 46 | )= |
| 47 | with ip_fields = split(ip, '.'), | 47 | with ip_fields = split(ip, '.'), |
| 48 | - if the_id is htmlId(id_str) then | 48 | + if the_id is html_Id(id_str) then |
| 49 | if wan_prefix is wan(field_prefix) then | 49 | if wan_prefix is wan(field_prefix) then |
| 50 | with make_field = (Int index) | 50 | with make_field = (Int index) |
| 51 | |-> if index < length(ip_fixed_part) then | 51 | |-> if index < length(ip_fixed_part) then |
| 52 | text([], force_nth(index, ip_fixed_part, "")) | 52 | text([], force_nth(index, ip_fixed_part, "")) |
| 53 | else | 53 | else |
| 54 | text_input([class("ip_input")], | 54 | text_input([class("ip_input")], |
| 55 | - "", | ||
| 56 | - htmlId(""), | 55 | + no_label, |
| 56 | + html_Id(""), | ||
| 57 | wan(field_prefix + "_" + index), | 57 | wan(field_prefix + "_" + index), |
| 58 | init(force_nth(index, ip_fields, "")), | 58 | init(force_nth(index, ip_fields, "")), |
| 59 | 3), | 59 | 3), |
web/widgets/css_helper.anubis
| @@ -188,7 +188,7 @@ public define HTML_Partial_Content | @@ -188,7 +188,7 @@ public define HTML_Partial_Content | ||
| 188 | table([/*class("module"), */ attr("cellspacing","0")], make_changelist_rows(items, [], 1)))) | 188 | table([/*class("module"), */ attr("cellspacing","0")], make_changelist_rows(items, [], 1)))) |
| 189 | . | 189 | . |
| 190 | 190 | ||
| 191 | -public define HTML_Off_Form | 191 | + public define HTML_Off_Form |
| 192 | html_tooltip | 192 | html_tooltip |
| 193 | ( | 193 | ( |
| 194 | String title, | 194 | String title, |
| @@ -209,7 +209,7 @@ public define HTML_Off_Form | @@ -209,7 +209,7 @@ public define HTML_Off_Form | ||
| 209 | 209 | ||
| 210 | 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))], []). | 210 | 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))], []). |
| 211 | 211 | ||
| 212 | -public define HTML_In_Form | 212 | + public define HTML_In_Form |
| 213 | html_tooltip | 213 | html_tooltip |
| 214 | ( | 214 | ( |
| 215 | String title, | 215 | String title, |
web/widgets/fisheye_menu.anubis
| @@ -55,7 +55,7 @@ public define HTML_Partial_Content | @@ -55,7 +55,7 @@ public define HTML_Partial_Content | ||
| 55 | if entries is | 55 | if entries is |
| 56 | { | 56 | { |
| 57 | [] then partial_content([], literal("")), | 57 | [] then partial_content([], literal("")), |
| 58 | - [_ . _] then partial_content(jquery_animate(childs(htmlId("top_menu")), size_on_hover(64, 64, 350, 1420)), | 58 | + [_ . _] then partial_content(jquery_animate(childs(html_Id("top_menu")), size_on_hover(64, 64, 350, 1420)), |
| 59 | 59 | ||
| 60 | div([id("top_menu"), style("min-height:70px!important;vertical-align:top;display:table-row")], | 60 | div([id("top_menu"), style("min-height:70px!important;vertical-align:top;display:table-row")], |
| 61 | sequence([ | 61 | sequence([ |