Commit 7d4afbd6af9d06323e5570aa8a6b03988cfeb082

Authored by totoro
1 parent 56c44e4d

add narrow_small in predefined Width input size which correspond to 20 characters

add html_tooltip_ext without class suffix when we intend to use awesome font
Showing 2 changed files with 45 additions and 12 deletions   Show diff stats
web/CXM_form.anubis
@@ -22,9 +22,10 @@ public type Mandatory: // used to mark fields as mandatory. @@ -22,9 +22,10 @@ public type Mandatory: // used to mark fields as mandatory.
22 non_mandatory. 22 non_mandatory.
23 23
24 public type Width: 24 public type Width:
25 - small,  
26 - narrow,  
27 - wide, 25 + small, //10 char
  26 + narrow_small, //20 char
  27 + narrow, //50 char
  28 + wide, //70 char
28 custom(Int). 29 custom(Int).
29 30
30 public type FormFieldWidth: 31 public type FormFieldWidth:
@@ -421,10 +422,11 @@ public define HTML_In_Form @@ -421,10 +422,11 @@ public define HTML_In_Form
421 pixels = (Width width) |-> 422 pixels = (Width width) |->
422 if width is 423 if width is
423 { 424 {
424 - small then 10,  
425 - narrow then 50,  
426 - wide then 70,  
427 - custom(n) then n 425 + small then 10,
  426 + narrow_small then 20,
  427 + narrow then 50,
  428 + wide then 70,
  429 + custom(n) then n
428 }, 430 },
429 431
430 432
@@ -434,7 +436,7 @@ public define HTML_In_Form @@ -434,7 +436,7 @@ public define HTML_In_Form
434 empty, 436 empty,
435 437
436 title(t) then 438 title(t) then
437 - literal("<h2>" + t + "</h2>"), 439 + literal("<h3>" + t + "</h3>"),
438 440
439 message(t) then 441 message(t) then
440 literal(t), 442 literal(t),
web/CXM_making_a_web_site.anubis
@@ -962,8 +962,6 @@ public type Actioner_Aspect: @@ -962,8 +962,6 @@ public type Actioner_Aspect:
962 button (String url_off, String url_on), // rollover button 962 button (String url_off, String url_on), // rollover button
963 button (String url_off, String url_on, Int w, Int h), // idem with size 963 button (String url_off, String url_on, Int w, Int h), // idem with size
964 submit (List(CoreAttrs),String text), 964 submit (List(CoreAttrs),String text),
965 -// immediate_selector (List(CoreAttrs),WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices),  
966 -// immediate_selector (List(CoreAttrs),WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, InitialValue selected),  
967 immediate_selector (List(CoreAttrs),WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, Maybe(InitialValue) selected, String onchange_fn), 965 immediate_selector (List(CoreAttrs),WebArgName name, Int size, List((List(CoreAttrs),WebArgValue,String)) choices, Maybe(InitialValue) selected, String onchange_fn),
968 966
969 html (HTML_Off_Form). 967 html (HTML_Off_Form).
@@ -1135,6 +1133,12 @@ public type HTML_tooltip: @@ -1135,6 +1133,12 @@ public type HTML_tooltip:
1135 String extend_type, 1133 String extend_type,
1136 String class_suffix, 1134 String class_suffix,
1137 List((String, String)) ext_args 1135 List((String, String)) ext_args
  1136 + ),
  1137 + html_tooltip_ext //same without class suffix. This means we use awesome font
  1138 + (
  1139 + String title,
  1140 + String extend_type,
  1141 + List((String, String)) ext_args
1138 ). 1142 ).
1139 1143
1140 public define HTML_tooltip 1144 public define HTML_tooltip
@@ -1161,7 +1165,15 @@ public type HTML_Help: @@ -1161,7 +1165,15 @@ public type HTML_Help:
1161 no_help, //no help text available 1165 no_help, //no help text available
1162 tooltip(HTML_tooltip, 1166 tooltip(HTML_tooltip,
1163 HTML_Help_Position). 1167 HTML_Help_Position).
1164 - 1168 +
  1169 +public define HTML_Help
  1170 + tooltip
  1171 + (
  1172 + HTML_tooltip h_tooltip
  1173 + )=
  1174 + tooltip(h_tooltip, left)
  1175 +.
  1176 +
1165 public type HTML_Label: 1177 public type HTML_Label:
1166 no_label, 1178 no_label,
1167 label( 1179 label(
@@ -4280,6 +4292,21 @@ define Printable_tree @@ -4280,6 +4292,21 @@ define Printable_tree
4280 // *** [5.8] Formating 'in form' elements. 4292 // *** [5.8] Formating 'in form' elements.
4281 4293
4282 4294
  4295 +//public define Printable_tree
  4296 +// format
  4297 +// (
  4298 +// HTML_tooltip tooltip
  4299 +// )=
  4300 +// if tooltip is
  4301 +// {
  4302 +// html_tooltip(title, keyword, width) then
  4303 +// ["<a id=\"help_",keyword,"\" class=\"jTipu jTip_help\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id=",keyword,(if width > 0 then ["&width=",width,"\""] else ["\""]), "></a>"],
  4304 +//
  4305 +// html_tooltip_ext(title, extend_type, class_suffix, ext_args) then
  4306 +// with extra_args = format_extra_operands(ext_args),
  4307 +// ["<a id=\"jTip\" class=\"jTipu jTip_",class_suffix,"\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext=",extend_type+extra_args,"\"></a>"]
  4308 +// }.
  4309 +
4283 public define Printable_tree 4310 public define Printable_tree
4284 format 4311 format
4285 ( 4312 (
@@ -4288,11 +4315,15 @@ public define Printable_tree @@ -4288,11 +4315,15 @@ public define Printable_tree
4288 if tooltip is 4315 if tooltip is
4289 { 4316 {
4290 html_tooltip(title, keyword, width) then 4317 html_tooltip(title, keyword, width) then
4291 - ["<a id=\"help_",keyword,"\" class=\"jTipu jTip_help\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id=",keyword,(if width > 0 then ["&width=",width,"\""] else ["\""]), "></a>"], 4318 + ["<a id=\"help_",keyword,"\" class=\"jTipu \" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id=",keyword,(if width > 0 then ["&width=",width,"\""] else ["\""]), "><i class=\"fa fa-info\" aria-hidden=\"true\" style=\"color:#2e6da4\"></i></a>"],
4292 4319
4293 html_tooltip_ext(title, extend_type, class_suffix, ext_args) then 4320 html_tooltip_ext(title, extend_type, class_suffix, ext_args) then
4294 with extra_args = format_extra_operands(ext_args), 4321 with extra_args = format_extra_operands(ext_args),
4295 ["<a id=\"jTip\" class=\"jTipu jTip_",class_suffix,"\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext=",extend_type+extra_args,"\"></a>"] 4322 ["<a id=\"jTip\" class=\"jTipu jTip_",class_suffix,"\" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext=",extend_type+extra_args,"\"></a>"]
  4323 +
  4324 + html_tooltip_ext(title, extend_type, ext_args) then
  4325 + with extra_args = format_extra_operands(ext_args),
  4326 + ["<a id=\"jTip\" class=\"jTipu \" name=\"",title,"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext=",extend_type+extra_args,"\"><i class=\"fa fa-info\" aria-hidden=\"true\" style=\"color:#2e6da4\"></i></a>"]
4296 }. 4327 }.
4297 4328
4298 public define HTML_Off_Form 4329 public define HTML_Off_Form