Commit 853e7a2c58b3ee50bc214a4df53f3a5b11ee1491

Authored by Cédric RICARD
1 parent 3d16bf3e

Renaming 'tooltip' attribute to 'title' to make it more 'HTML compliant'

Fix HTML code generated by CXM_dojo.anubis to be more W3C compliant.
calexium_lib/web/CXM_dojo.anubis
@@ -40,26 +40,35 @@ public define HTML_Off_Form @@ -40,26 +40,35 @@ public define HTML_Off_Form
40 dojo_dialog 40 dojo_dialog
41 ( 41 (
42 String name, 42 String name,
43 - String id, 43 + String dialog_id,
44 String execute, 44 String execute,
45 ) 45 )
46 = 46 =
47 sequence[ 47 sequence[
48 - dojo_button(name,"dijit.byId('"+id+"').show()", "dialog_id"),  
49 - literal("  
50 - <div dojoType=\"dijit.Dialog\" id=\""+id+"\" title=\""+name+"\"  
51 - execute=\""+execute+"\">  
52 - <table>  
53 - <tr>  
54 - <td><input dojoType=dijit.form.TextBox type=\"text\" name=\"name\" id=\"name_"+id+"\"></td>  
55 - </tr>  
56 -  
57 - <tr>  
58 - <td colspan=\"2\" align=\"center\">  
59 - <button dojoType=dijit.form.Button type=\"submit\">OK</button></td>  
60 - </tr>  
61 - </table>  
62 -</div></br>") 48 + dojo_button(name,"dijit.byId('"+dialog_id+"').show()", "dialog_id"),
  49 + div([attr("dojoType", "dijit.Dialog"), id(dialog_id), title(name), attr("execute", execute)],
  50 + table([],
  51 + empty,
  52 + [
  53 + row([], [cell([], literal("<input dojoType=dijit.form.TextBox type=\"text\" name=\"name\" id=\"name_"+dialog_id+"\" />"))]),
  54 + row([], [cell([columns(2), h_center], literal("<button dojoType=dijit.form.Button type=\"submit\">OK</button>"))]),
  55 + ],
  56 + empty)),
  57 + literal("<br/>"),
  58 +// literal("
  59 +// <div dojoType=\"dijit.Dialog\" id=\""+id+"\" title=\""+name+"\"
  60 +// execute=\""+execute+"\">
  61 +// <table>
  62 +// <tr>
  63 +// <td><input dojoType=dijit.form.TextBox type=\"text\" name=\"name\" id=\"name_"+id+"\"></td>
  64 +// </tr>
  65 +//
  66 +// <tr>
  67 +// <td colspan=\"2\" align=\"center\">
  68 +// <button dojoType=dijit.form.Button type=\"submit\">OK</button></td>
  69 +// </tr>
  70 +// </table>
  71 +// </div><br />")
63 ] 72 ]
64 . 73 .
65 74
@@ -74,7 +83,7 @@ public define HTML_Off_Form @@ -74,7 +83,7 @@ public define HTML_Off_Form
74 Bool can_edit 83 Bool can_edit
75 ) 84 )
76 = 85 =
77 - literal("<script> 86 + literal("<script type=\"text/javascript\">
78 dojo.addOnLoad(function(){ 87 dojo.addOnLoad(function(){
79 init_dojo_grid(\""+colum1+"\",\""+colum2+"\", \""+colum3+"\", \""+colum4+"\", "+ (if can_edit then "1" else "0")+"); 88 init_dojo_grid(\""+colum1+"\",\""+colum2+"\", \""+colum3+"\", \""+colum4+"\", "+ (if can_edit then "1" else "0")+");
80 } 89 }
@@ -92,13 +101,13 @@ public define HTML_Off_Form @@ -92,13 +101,13 @@ public define HTML_Off_Form
92 ) 101 )
93 = 102 =
94 sequence([ 103 sequence([
95 - literal("</br>"), 104 + literal("<br/>"),
96 div([class("message_box")], 105 div([class("message_box")],
97 sequence([ 106 sequence([
98 div([id("node3"), class("box nopad hidden")], name1), 107 div([id("node3"), class("box nopad hidden")], name1),
99 div([id("node4"), class("box two nopad")], name2), 108 div([id("node4"), class("box two nopad")], name2),
100 ])), 109 ])),
101 - literal("</br>"), 110 + literal("<br/>"),
102 ]). 111 ]).
103 112
104 113
calexium_lib/web/CXM_making_a_web_site.anubis
@@ -649,7 +649,10 @@ public type Text_Option: @@ -649,7 +649,10 @@ public type Text_Option:
649 class(String), //CSS class 649 class(String), //CSS class
650 id(String), 650 id(String),
651 style(String), 651 style(String),
652 - tooltip(String). 652 + title(String).
  653 +
  654 +public define Text_Option
  655 + tooltip(String s) = title(s).
653 656
654 A list of 'Text_Option' must be given with each text you want to put in your page. 657 A list of 'Text_Option' must be given with each text you want to put in your page.
655 658
@@ -723,7 +726,7 @@ public type CoreAttrs: @@ -723,7 +726,7 @@ public type CoreAttrs:
723 id (String), 726 id (String),
724 class (String), 727 class (String),
725 style (String), 728 style (String),
726 - tooltip (String), 729 + title (String),
727 lang (String), 730 lang (String),
728 dir (Reading_Way), 731 dir (Reading_Way),
729 accesskey (Word8), 732 accesskey (Word8),
@@ -734,7 +737,7 @@ public type CoreAttrs: @@ -734,7 +737,7 @@ public type CoreAttrs:
734 public type InputAttrs: 737 public type InputAttrs:
735 class (String), 738 class (String),
736 style (String), 739 style (String),
737 - tooltip (String), 740 + title (String),
738 lang (String), 741 lang (String),
739 dir (Reading_Way), 742 dir (Reading_Way),
740 accesskey (Word8), 743 accesskey (Word8),
@@ -742,6 +745,11 @@ public type InputAttrs: @@ -742,6 +745,11 @@ public type InputAttrs:
742 attr (String, String), 745 attr (String, String),
743 event (HtmlEvents, String). 746 event (HtmlEvents, String).
744 747
  748 +public define CoreAttrs
  749 + tooltip(String s) = title(s).
  750 +public define InputAttrs
  751 + tooltip(String s) = title(s).
  752 +
745 public type I18n: 753 public type I18n:
746 lang (String), 754 lang (String),
747 dir (Reading_Way). 755 dir (Reading_Way).
@@ -1474,6 +1482,8 @@ public type HTTP_Answer: @@ -1474,6 +1482,8 @@ public type HTTP_Answer:
1474 String content), 1482 String content),
1475 custom_binary(String mime_type, 1483 custom_binary(String mime_type,
1476 ByteArray content), 1484 ByteArray content),
  1485 + custom_tree(String mime_type,
  1486 + Printable_tree content),
1477 http_raw(Printable_tree). 1487 http_raw(Printable_tree).
1478 1488
1479 public define HTTP_Answer 1489 public define HTTP_Answer
@@ -2926,7 +2936,7 @@ define List(Text_Option) @@ -2926,7 +2936,7 @@ define List(Text_Option)
2926 get_text_options(t) 2936 get_text_options(t)
2927 else if h is style(_) then 2937 else if h is style(_) then
2928 get_text_options(t) 2938 get_text_options(t)
2929 - else if h is tooltip(_) then 2939 + else if h is title(_) then
2930 get_text_options(t) 2940 get_text_options(t)
2931 else 2941 else
2932 [ h . get_text_options(t) ] 2942 [ h . get_text_options(t) ]
@@ -2954,7 +2964,7 @@ define List(CoreAttrs) @@ -2954,7 +2964,7 @@ define List(CoreAttrs)
2954 [ id(name) . get_css_class(t) ] 2964 [ id(name) . get_css_class(t) ]
2955 else if h is style(the_style) then 2965 else if h is style(the_style) then
2956 [ style(the_style) . get_css_class(t) ] 2966 [ style(the_style) . get_css_class(t) ]
2957 - else if h is tooltip(name) then 2967 + else if h is title(name) then
2958 [ tooltip(name) . get_css_class(t) ] 2968 [ tooltip(name) . get_css_class(t) ]
2959 else 2969 else
2960 get_css_class(t) 2970 get_css_class(t)
@@ -2994,7 +3004,7 @@ public define String @@ -2994,7 +3004,7 @@ public define String
2994 style(style_string) then 3004 style(style_string) then
2995 " style=\"" + style_string + "\"", 3005 " style=\"" + style_string + "\"",
2996 3006
2997 - tooltip(title_string) then 3007 + title(title_string) then
2998 " title=\"" + title_string + "\"", 3008 " title=\"" + title_string + "\"",
2999 3009
3000 lang(lang) then 3010 lang(lang) then
@@ -3036,7 +3046,7 @@ define String @@ -3036,7 +3046,7 @@ define String
3036 style(style_string) then 3046 style(style_string) then
3037 " style=\"" + style_string + "\"", 3047 " style=\"" + style_string + "\"",
3038 3048
3039 - tooltip(title_string) then 3049 + title(title_string) then
3040 " title=\"" + title_string + "\"", 3050 " title=\"" + title_string + "\"",
3041 3051
3042 lang(lang) then 3052 lang(lang) then
@@ -3602,7 +3612,7 @@ define String @@ -3602,7 +3612,7 @@ define String
3602 class(class_name)then " class=\"" + class_name +"\"", 3612 class(class_name)then " class=\"" + class_name +"\"",
3603 id(id_name) then " id=\"" + id_name +"\"", 3613 id(id_name) then " id=\"" + id_name +"\"",
3604 style(style_string) then " style=\"" + style_string + "\"", 3614 style(style_string) then " style=\"" + style_string + "\"",
3605 - tooltip(title) then " title=\"" + title +"\"" 3615 + title(s) then " title=\"" + s +"\""
3606 } + if t is [ ] then "" else ("; "+format(t)) 3616 } + if t is [ ] then "" else ("; "+format(t))
3607 }. 3617 }.
3608 3618
@@ -4297,6 +4307,15 @@ define Printable_tree @@ -4297,6 +4307,15 @@ define Printable_tree
4297 content . (Printable_tree)[] 4307 content . (Printable_tree)[]
4298 ], 4308 ],
4299 4309
  4310 + custom_tree(String mime_type, Printable_tree content) then
  4311 + [ "HTTP/1.1 200 OK", crlf,
  4312 + format_headers(standard_headers),
  4313 + format_headers(standard_headers_for(mime_type, length(content), success(charset))),
  4314 + format_headers(additional_headers),
  4315 + crlf .
  4316 + content
  4317 + ],
  4318 +
4300 http_raw(Printable_tree content) then content 4319 http_raw(Printable_tree content) then content
4301 }. 4320 }.
4302 4321