diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 6007608..67d47ec 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -1007,6 +1007,10 @@ public type JS_File: js_file(String file_name, List(JS_Attribute) attributes). +public type Script: + script( String script_type, + String content). + public define JS_File js_file ( @@ -1497,6 +1501,7 @@ public type HTTP_Answer: List(CSS_Style) /*styles*/, List(CSS_File) /*css_files*/, List(JS_File) /*js_files*/, + List(Script) /*script*/, HTML_Body /*body*/), plain_text (HTTP_Status /*http_status*/, String /*text*/), @@ -1522,7 +1527,7 @@ public define HTTP_Answer List(HTML_Meta) metas, HTML_Body body ) = - html_page(http_ok, title,metas,[],[],[],body). + html_page(http_ok, title,metas,[],[],[],[],body). public define HTTP_Answer html_page @@ -1532,7 +1537,7 @@ public define HTTP_Answer List(CSS_Style) styles, HTML_Body body ) = - html_page(http_ok, title, metas, styles, [], [], body). + html_page(http_ok, title, metas, styles, [], [], [], body). 'HTTP_Answer' represents the final product of the construction of a web page. @@ -2861,12 +2866,6 @@ define String if connection is { same then "/", - /* - same then if is_https - then "https://"+common_name+":"+https_port+"/" - else "http://"+common_name+":"+https_port+"/", - */ - http then "http://"+common_name+":"+http_port+"/", https then "https://"+common_name+":"+https_port+"/", } + @@ -3825,6 +3824,17 @@ define Printable_tree }. define Printable_tree + add_script + ( + List(Script) l + ) = + if l is + { + [ ] then [ ], + [h . t] then [ "\n" . add_script(t) ] + }. + +define Printable_tree add_css_styles ( List(CSS_Style) css_styles @@ -4295,7 +4305,7 @@ define Printable_tree with ic_v = var((Int)0), if page is { - html_page(status, title, metas, css_styles, css_files, js_files, body) then + html_page(status, title, metas, css_styles, css_files, js_files, script, body) then if body is body(options,element) then if format(status) is (status_string, status_headers) then with answer_body = @@ -4305,6 +4315,7 @@ define Printable_tree add_css_styles(css_styles), add_css_files(css_files), add_js_files(js_files), + add_script(script), "\n", "