diff --git a/calexium_lib/web/CXM_dojo.anubis b/calexium_lib/web/CXM_dojo.anubis index 3c7ee13..329b8fc 100644 --- a/calexium_lib/web/CXM_dojo.anubis +++ b/calexium_lib/web/CXM_dojo.anubis @@ -805,5 +805,28 @@ public define Maybe(String) } } }. + +public define List(HTML_Head_Tag) + dojo_defaults + = + [ + // js(js_file("js/dojo/dojo.js", [attr("djConfig", "parseOnLoad: true, isDebug: " + (if debug_mode then "true" else "false") + ", usePlainJson: true")])), + js(js_file("js/dojo/dojo/dojo.js", [attr("djConfig", "parseOnLoad: true, isDebug: false, usePlainJson: true")])), + js(js_file("js/dojo/dijit/dijit.js")), + css(css_file("js/dojo/dojo/resources/dojo.css")) + ]. + - +public define List(HTML_Head_Tag) + dojo_init + ( + String web_dir, + String theme_name + ) + = + with theme_name = + if file_exists(web_dir+"js/dojo/dijit/themes/"+theme_name+"/"+theme_name+".css")then theme_name else "claro", + [ css(css_file("js/dojo/dijit/themes/"+theme_name+"/"+theme_name+".css")) . + [ css(css_file("js/dojo/dijit/themes/"+theme_name+"/"+theme_name+"_rtl.css")) . dojo_defaults ] + ] + . diff --git a/calexium_lib/web/CXM_jquery.anubis b/calexium_lib/web/CXM_jquery.anubis new file mode 100644 index 0000000..c23b708 --- /dev/null +++ b/calexium_lib/web/CXM_jquery.anubis @@ -0,0 +1,36 @@ +/* + * Created by PyramIDE. + * User: Jeremy + * Date: 21/08/2012 + * Time: 16:52 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +read calexium_lib/web/CXM_making_a_web_site.anubis +read tools/printable_tree.anubis +read tools/basis.anubis + +public define List(HTML_Head_Tag) + jquery_defaults + = + [ + js(js_file("js/jquery/jquery-1.8.0.min.js")), + js(js_file("js/jquery/jquery-ui-1.8.23.custom.min.js")), + ]. + +/* Initialize jQuery in compatiblity mode with jQueryUI */ +public define List(HTML_Head_Tag) + jquery_init + ( + String web_dir, + String theme_name + ) + = + if file_exists(web_dir+"/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css") then + [ css(css_file("css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] + else + [ css(css_file(web_dir+"/css/jquery/redmond/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] + . + + diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 2fb9b36..3df0cd8 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -1020,6 +1020,30 @@ public define JS_File ) = js_file(file_name, []). +public type HTML_Meta:... + +public type HTML_Off_Form:... + +public type HTML_Head_Tag: + meta(HTML_Meta), + title(String), + js(JS_File), + js_inline(Script), + css(CSS_File), + css_inline(String css_styles) /* Note: tags are not necessaries */ + . + + /* It contains + * - a List of HTML_Head_Tag representing necessaries head tags for the content. ex: jquery js files, js script, css specific styles, ... + * - a HTML_Off_Form representing the HTML code for the part of the page we want to display + */ +public type HTML_Partial_Content: + partial_content + ( + List(HTML_Head_Tag), + HTML_Off_Form + ) + . public type HTML_In_Form: literal_pt (Printable_tree), @@ -1498,6 +1522,9 @@ public type HTML_Body: public type HTTP_Answer: html_page (HTTP_Status /*http_status*/, + List(HTML_Head_Tag) /*html
tags*/, + HTML_Body /*body*/), + html_page (HTTP_Status /*http_status*/, String /*title*/, List(HTML_Meta) /*meta_tags*/, List(CSS_Style) /*styles*/, @@ -2228,7 +2255,7 @@ public define Printable_tree HTTP_Answer page, Bool is_https, String charset - ). + ). define Printable_tree @@ -4294,6 +4321,27 @@ define Printable_tree " />\n"], literal(s) then [s] }. + +define Printable_tree // c'est le nôtre et c'est meilleur + format + ( + HTML_Meta m, + ) = + if m is + { + keywords(l) then ["\n"], + refresh(co,ta,an,delay) then + [" "], // TODO + refresh(url,delay) then + ["\n"], + meta(n,c) then ["\n"], + http_equiv(n,c) then ["\n"], + generic_meta(l) then [" if p is (n,v) then [n,"=\"",v,"\" "], + l)), + " />\n"], + literal(s) then [s] + }. define Printable_tree @@ -4311,9 +4359,53 @@ define Printable_tree "text/html; charset="+charset),is_https)], [h . t] then [format(cinfo,state_name,h,is_https) . format(cinfo,state_name,t,is_https,charset)] - }. - + }. + +define Printable_tree + _format_html_head + ( + List(HTML_Head_Tag) lwf, + Printable_tree so_far + ) + = + if lwf is + { + [] then reverse(so_far), + [ h . t] then + if h is + { + meta(meta) then + [format(meta) . _format_html_head(t, so_far)], + title(title) then + ["