Commit c2a999641f24ff21fa328e356e99e1eb380cf976
1 parent
07574089
rename head_tags alternative of type HTML to "partial_content". It's more compre…
…hensive about behavior of this altenative
Showing
16 changed files
with
96 additions
and
102 deletions
Show diff stats
web/dropzone.anubis
| ... | ... | @@ -23,7 +23,7 @@ public define HTML |
| 23 | 23 | List((String,String)) extra_ops, |
| 24 | 24 | ) = |
| 25 | 25 | with dropzone_form_id = to_lower(dropzone_form_name+"_"+generate_random_string(15)), |
| 26 | - head_tags( | |
| 26 | + partial_content( | |
| 27 | 27 | [ js(js_file("xlib/js/dropzone.js")), |
| 28 | 28 | css(css_file("xlib/css/dropzone.css")), |
| 29 | 29 | js_script(" | ... | ... |
web/frameworks/adminlte4/sidebar.anubis
| ... | ... | @@ -61,7 +61,7 @@ public define HTML |
| 61 | 61 | { |
| 62 | 62 | no_left_menu then empty, |
| 63 | 63 | left_menu(entries, selected) then |
| 64 | - head_tags([css(css_file("/css/left_menu.css"))], | |
| 64 | + partial_content([css(css_file("/css/left_menu.css"))], | |
| 65 | 65 | make_sidebar(_T, entries, selected, []) |
| 66 | 66 | ) |
| 67 | 67 | } | ... | ... |
web/jQuery/jq_animate.anubis
| ... | ... | @@ -343,7 +343,7 @@ define List(JsonValue) |
| 343 | 343 | }. |
| 344 | 344 | |
| 345 | 345 | public define List(HTML_Head_Tag) |
| 346 | - generate_head_tags | |
| 346 | + generate_partial_content | |
| 347 | 347 | ( |
| 348 | 348 | JQuerySelector jq_selector, |
| 349 | 349 | List(JQueryAnimation) anims |
| ... | ... | @@ -376,7 +376,7 @@ public define List(HTML_Head_Tag) |
| 376 | 376 | JQuerySelector jq_selector, |
| 377 | 377 | List(JQueryAnimation) anims |
| 378 | 378 | ) = |
| 379 | - generate_head_tags(jq_selector, anims). | |
| 379 | + generate_partial_content(jq_selector, anims). | |
| 380 | 380 | |
| 381 | 381 | public define HTML |
| 382 | 382 | jquery_animate |
| ... | ... | @@ -384,7 +384,7 @@ public define HTML |
| 384 | 384 | JQuerySelector jq_selector, |
| 385 | 385 | List(JQueryAnimation) anims |
| 386 | 386 | ) = |
| 387 | - partial_content(generate_head_tags(jq_selector, anims), literal("")). | |
| 387 | + partial_content(generate_partial_content(jq_selector, anims), literal("")). | |
| 388 | 388 | |
| 389 | 389 | public define List(HTML_Head_Tag) |
| 390 | 390 | jquery_animate |
| ... | ... | @@ -392,7 +392,7 @@ public define List(HTML_Head_Tag) |
| 392 | 392 | JQuerySelector jq_selector, |
| 393 | 393 | JQueryAnimation anim_type |
| 394 | 394 | ) = |
| 395 | - generate_head_tags(jq_selector, [ anim_type ]). | |
| 395 | + generate_partial_content(jq_selector, [ anim_type ]). | |
| 396 | 396 | |
| 397 | 397 | public define HTML |
| 398 | 398 | jquery_animate |
| ... | ... | @@ -400,5 +400,5 @@ public define HTML |
| 400 | 400 | JQuerySelector jq_selector, |
| 401 | 401 | JQueryAnimation anim_type |
| 402 | 402 | ) = |
| 403 | - partial_content(generate_head_tags(jq_selector, [ anim_type ]), literal("")). | |
| 403 | + partial_content(generate_partial_content(jq_selector, [ anim_type ]), literal("")). | |
| 404 | 404 | ... | ... |
web/jQuery/jq_button.anubis
| ... | ... | @@ -79,7 +79,7 @@ define HTML |
| 79 | 79 | if buttons is |
| 80 | 80 | { |
| 81 | 81 | [ ] then |
| 82 | - head_tags( | |
| 82 | + partial_content( | |
| 83 | 83 | reverse(html_tags), |
| 84 | 84 | sequence(reverse(html_buttons)) |
| 85 | 85 | ), |
| ... | ... | @@ -165,7 +165,7 @@ public define HTML |
| 165 | 165 | List(JQuery_button) buttons |
| 166 | 166 | ) |
| 167 | 167 | = |
| 168 | - head_tags( | |
| 168 | + partial_content( | |
| 169 | 169 | [ js_inline(jquery_ready("$('#"+buttons_container_id+"').buttonset();")) ], |
| 170 | 170 | div(id(buttons_container_id), _jquery_buttons(buttons, [], [])) |
| 171 | 171 | // sequence([ |
| ... | ... | @@ -188,7 +188,7 @@ public define HTML |
| 188 | 188 | btn_seq = (HTML)sequence([literal("<button class=\"cxm_button\" type=\""+to_String(bt_type)+"\" id=\""+id+"\" name=\""+name+"\">"+label+"</button>")]), |
| 189 | 189 | if jquery_icon_to_string(primary) = "" then |
| 190 | 190 | if jquery_icon_to_string(secondary) = "" then |
| 191 | - head_tags( | |
| 191 | + partial_content( | |
| 192 | 192 | [ |
| 193 | 193 | js_inline(jquery_ready("$('#"+id+"').button();")), |
| 194 | 194 | onclick_action |
| ... | ... | @@ -198,7 +198,7 @@ public define HTML |
| 198 | 198 | //literal("<button type=\""+to_String(bt_type)+"\" id=\""+id+"\" name=\""+name+"\">"+label+"</button>") |
| 199 | 199 | ) |
| 200 | 200 | else |
| 201 | - head_tags( | |
| 201 | + partial_content( | |
| 202 | 202 | [ |
| 203 | 203 | js_inline(jquery_ready("$('#"+id+"').button({icons:{secondary:'"+jquery_icon_to_string(secondary)+"'}});")), |
| 204 | 204 | onclick_action |
| ... | ... | @@ -208,7 +208,7 @@ public define HTML |
| 208 | 208 | ) |
| 209 | 209 | else |
| 210 | 210 | if jquery_icon_to_string(secondary) = "" then |
| 211 | - head_tags( | |
| 211 | + partial_content( | |
| 212 | 212 | [ |
| 213 | 213 | js_inline(jquery_ready("$('#"+id+"').button({icons:{primary:'"+jquery_icon_to_string(primary)+"'}});")), |
| 214 | 214 | onclick_action |
| ... | ... | @@ -217,7 +217,7 @@ public define HTML |
| 217 | 217 | //literal("<button type=\""+to_String(bt_type)+"\" id=\""+id+"\">"+label+"</button>") |
| 218 | 218 | ) |
| 219 | 219 | else |
| 220 | - head_tags( | |
| 220 | + partial_content( | |
| 221 | 221 | [ |
| 222 | 222 | js_inline(jquery_ready("$('#"+id+"').button({icons:{primary:'"+jquery_icon_to_string(primary)+"',secondary:'"+jquery_icon_to_string(secondary)+"'}});")), |
| 223 | 223 | onclick_action |
| ... | ... | @@ -264,7 +264,7 @@ public define HTML |
| 264 | 264 | generate_random_string(10) |
| 265 | 265 | else |
| 266 | 266 | button_id, |
| 267 | - head_tags( | |
| 267 | + partial_content( | |
| 268 | 268 | [ |
| 269 | 269 | jquery_button_get_onclick_action(button_id_str, actioner), |
| 270 | 270 | css(css_file("xlib/css/button.css")), |
| ... | ... | @@ -296,7 +296,7 @@ public define HTML |
| 296 | 296 | button_name = uid, |
| 297 | 297 | _actioner = jQuery_actioner(same, jqscript("Xlib.make_confirm_dialog(this, " /*+ to_js_string("/?a=" + url + format_extra_operands(extra_ops))+*/ + to_JS_String(jquery_button_get_onclick_action(actioner)) + ");")), |
| 298 | 298 | |
| 299 | - head_tags([ | |
| 299 | + partial_content([ | |
| 300 | 300 | js(js_file("xlib/js/xlib.js")), |
| 301 | 301 | css(css_file("xlib/css/button.css")), |
| 302 | 302 | js_inline(jquery_ready(js_data)) |
| ... | ... | @@ -330,7 +330,7 @@ public define HTML |
| 330 | 330 | _button_name = uid, |
| 331 | 331 | _actioner = jQuery_actioner(same, jqscript("Xlib.make_confirm_dialog(this, " + to_JS_String(jquery_button_get_onclick_action(actioner)) +");")), |
| 332 | 332 | |
| 333 | - head_tags([ | |
| 333 | + partial_content([ | |
| 334 | 334 | js(js_file("xlib/js/xlib.js")), |
| 335 | 335 | js_inline(jquery_ready(js_data)) |
| 336 | 336 | ], | ... | ... |
web/jQuery/jq_datatable.anubis
| ... | ... | @@ -66,7 +66,7 @@ public define HTML |
| 66 | 66 | HTML table |
| 67 | 67 | ) |
| 68 | 68 | = |
| 69 | - head_tags(jquery_datatables_1_10_init + | |
| 69 | + partial_content(jquery_datatables_1_10_init + | |
| 70 | 70 | [ js_inline(jquery_ready("$('#"+table_id+"').DataTable();")) ], |
| 71 | 71 | table |
| 72 | 72 | ) |
| ... | ... | @@ -81,7 +81,7 @@ public define HTML |
| 81 | 81 | ) |
| 82 | 82 | = |
| 83 | 83 | if enable_jqueryui then |
| 84 | - head_tags( jquery_datatables_1_10_init + | |
| 84 | + partial_content( jquery_datatables_1_10_init + | |
| 85 | 85 | [ js_inline(jquery_ready("$('#"+table_id+"').DataTable({\"jQueryUI\":true});")) ], |
| 86 | 86 | table |
| 87 | 87 | ) |
| ... | ... | @@ -108,7 +108,7 @@ public define HTML |
| 108 | 108 | String web_dir |
| 109 | 109 | ) |
| 110 | 110 | = |
| 111 | - head_tags( jquery_datatables_1_10_init + | |
| 111 | + partial_content( jquery_datatables_1_10_init + | |
| 112 | 112 | [ |
| 113 | 113 | js_inline(jquery_ready(" |
| 114 | 114 | $.fn.dataTable.ext.legacy.ajax = true; | ... | ... |
web/jQuery/jq_dialog.anubis
| ... | ... | @@ -88,18 +88,18 @@ $( \"#"+dlg_id+"\" ).dialog({ |
| 88 | 88 | if content is |
| 89 | 89 | { |
| 90 | 90 | empty then |
| 91 | - head_tags([js], div([id(dlg_id)], empty)), | |
| 91 | + partial_content([js], div([id(dlg_id)], empty)), | |
| 92 | 92 | p_content(pc) then |
| 93 | - if pc is head_tags(tags, html) then | |
| 94 | - head_tags( [js . tags ], div(id(dlg_id), html)) //html code of the dialog | |
| 93 | + if pc is partial_content(tags, html) then | |
| 94 | + partial_content( [js . tags ], div(id(dlg_id), html)) //html code of the dialog | |
| 95 | 95 | else |
| 96 | 96 | pc, |
| 97 | 97 | off_form(html) then |
| 98 | - head_tags(js, div(id(dlg_id), html)), //html code of the dialog | |
| 98 | + partial_content(js, div(id(dlg_id), html)), //html code of the dialog | |
| 99 | 99 | ajax(_url) then |
| 100 | 100 | with url = format_web_action_name(_url), |
| 101 | 101 | //println("jq_dialog_create : \njs_str ->"+js_str+"\nurl ->"+url); |
| 102 | - head_tags( [js], div([id(dlg_id), attr("ajax_url",url)])) | |
| 102 | + partial_content( [js], div([id(dlg_id), attr("ajax_url",url)])) | |
| 103 | 103 | }. |
| 104 | 104 | |
| 105 | 105 | public define HTML | ... | ... |
web/jQuery/jq_radio.anubis
web/load_content.anubis
| ... | ... | @@ -131,7 +131,7 @@ public define HTML |
| 131 | 131 | Bool replace, |
| 132 | 132 | Bool overlay |
| 133 | 133 | )= |
| 134 | - head_tags([ | |
| 134 | + partial_content([ | |
| 135 | 135 | js(js_file("xlib/js/xlib.js")), |
| 136 | 136 | js_inline(script("text/javascript","$(document).ready(function(){"+load_content(target, web_action, extra_args, replace, overlay)+"});")) |
| 137 | 137 | ]) | ... | ... |
web/making_a_web_site.anubis
| ... | ... | @@ -2120,13 +2120,13 @@ public define HTML |
| 2120 | 2120 | // partial_content([], sequence(content)). |
| 2121 | 2121 | // |
| 2122 | 2122 | public define HTML |
| 2123 | - add_head_tags | |
| 2123 | + add_partial_content | |
| 2124 | 2124 | ( |
| 2125 | 2125 | List(HTML_Head_Tag) tags, |
| 2126 | 2126 | HTML p_content |
| 2127 | 2127 | )= |
| 2128 | - if p_content is head_tags(_head_tags, html) then | |
| 2129 | - head_tags(tags + _head_tags, html) | |
| 2128 | + if p_content is partial_content(_partial_content, html) then | |
| 2129 | + partial_content(tags + _partial_content, html) | |
| 2130 | 2130 | else |
| 2131 | 2131 | p_content |
| 2132 | 2132 | . |
| ... | ... | @@ -2140,10 +2140,10 @@ define HTML |
| 2140 | 2140 | )= |
| 2141 | 2141 | if l_content is |
| 2142 | 2142 | { |
| 2143 | - [] then head_tags(so_far_tags, reverse(so_far_html)), | |
| 2143 | + [] then partial_content(so_far_tags, reverse(so_far_html)), | |
| 2144 | 2144 | [h . t] then |
| 2145 | 2145 | //extract resurgent type and symbols of h |
| 2146 | - if h is head_tags(tags, html) then | |
| 2146 | + if h is partial_content(tags, html) then | |
| 2147 | 2147 | list_to_pcontent(t, so_far_tags + tags, html + so_far_html) |
| 2148 | 2148 | else |
| 2149 | 2149 | list_to_pcontent(t, so_far_tags, [h . so_far_html]) |
| ... | ... | @@ -2206,10 +2206,10 @@ public define HTTP_Answer |
| 2206 | 2206 | html_page |
| 2207 | 2207 | ( |
| 2208 | 2208 | String title, |
| 2209 | - List(HTML_Head_Tag) head_tags, | |
| 2209 | + List(HTML_Head_Tag) partial_content, | |
| 2210 | 2210 | HTML_Body body |
| 2211 | 2211 | )= |
| 2212 | - html_page(http_ok, title, head_tags,[],[],[],body). | |
| 2212 | + html_page(http_ok, title, partial_content,[],[],[],body). | |
| 2213 | 2213 | |
| 2214 | 2214 | public define HTTP_Answer |
| 2215 | 2215 | web_controller_error_page |
| ... | ... | @@ -2441,7 +2441,7 @@ define Printable_tree |
| 2441 | 2441 | HTML element, |
| 2442 | 2442 | Bool is_https, |
| 2443 | 2443 | Var(Int) action_count, |
| 2444 | - Var(List(HTML_Head_Tag)) head_tags | |
| 2444 | + Var(List(HTML_Head_Tag)) partial_content | |
| 2445 | 2445 | ). |
| 2446 | 2446 | |
| 2447 | 2447 | public define String |
| ... | ... | @@ -3855,7 +3855,7 @@ define Printable_tree |
| 3855 | 3855 | // String state_name, |
| 3856 | 3856 | Var(Int) action_count, |
| 3857 | 3857 | Var(Int) ic_v, // 'idnum' counter variable |
| 3858 | - Var(List(HTML_Head_Tag)) head_tags | |
| 3858 | + Var(List(HTML_Head_Tag)) partial_content | |
| 3859 | 3859 | ) = |
| 3860 | 3860 | //if cinfo is info(common_name,http_port,https_port,site_dir,secret) then |
| 3861 | 3861 | with full_url = make_foreign_link_url(target,url), |
| ... | ... | @@ -3895,7 +3895,7 @@ define Printable_tree |
| 3895 | 3895 | html(options, html) then |
| 3896 | 3896 | [ |
| 3897 | 3897 | "<a href=\"", full_url,"\"", format_attrs(options), ">", |
| 3898 | - format(cinfo, ic_v, html, is_https, action_count, head_tags), | |
| 3898 | + format(cinfo, ic_v, html, is_https, action_count, partial_content), | |
| 3899 | 3899 | "</a>" |
| 3900 | 3900 | ] |
| 3901 | 3901 | }. |
| ... | ... | @@ -3914,7 +3914,7 @@ define Printable_tree |
| 3914 | 3914 | Bool is_https, |
| 3915 | 3915 | Var(Int) action_count, |
| 3916 | 3916 | Var(Int) ic_v, // 'idnum' counter variable |
| 3917 | - Var(List(HTML_Head_Tag)) head_tags | |
| 3917 | + Var(List(HTML_Head_Tag)) partial_content | |
| 3918 | 3918 | |
| 3919 | 3919 | ) = |
| 3920 | 3920 | |
| ... | ... | @@ -4047,7 +4047,7 @@ define Printable_tree |
| 4047 | 4047 | html(options, html) then |
| 4048 | 4048 | [ |
| 4049 | 4049 | "<a href=\"", url,"\"", format_attrs(options), ">", |
| 4050 | - format(cinfo, ic_v, html, is_https, action_count, head_tags), | |
| 4050 | + format(cinfo, ic_v, html, is_https, action_count, partial_content), | |
| 4051 | 4051 | "</a>" |
| 4052 | 4052 | ] |
| 4053 | 4053 | }. |
| ... | ... | @@ -4215,14 +4215,14 @@ define Printable_tree |
| 4215 | 4215 | $T -> Printable_tree format_element, // able to format a datum of type $T |
| 4216 | 4216 | Bool is_https, |
| 4217 | 4217 | Var(Int) action_count, |
| 4218 | - Var(List(HTML_Head_Tag)) head_tags | |
| 4218 | + Var(List(HTML_Head_Tag)) partial_content | |
| 4219 | 4219 | ) = |
| 4220 | 4220 | if cinfo is info(common_name,http_port,https_port,site_directory,secret) then |
| 4221 | 4221 | if element is |
| 4222 | 4222 | { |
| 4223 | 4223 | |
| 4224 | 4224 | any_foreign_link_new(target, aspect, url) then |
| 4225 | - format_foreign_link(target, aspect, url, is_https, cinfo, action_count, ic_v, head_tags), | |
| 4225 | + format_foreign_link(target, aspect, url, is_https, cinfo, action_count, ic_v, partial_content), | |
| 4226 | 4226 | |
| 4227 | 4227 | any_foreign_link(options,url) then |
| 4228 | 4228 | ["<a href=\"",url,"\" ", format_attrs(options), "></a>"], // IE7 doesn't support the form <a href="..." /> |
| ... | ... | @@ -4465,7 +4465,7 @@ define Printable_tree |
| 4465 | 4465 | List(HTML) elements, |
| 4466 | 4466 | Bool is_https, |
| 4467 | 4467 | Var(Int) action_count, |
| 4468 | - Var(List(HTML_Head_Tag)) head_tags | |
| 4468 | + Var(List(HTML_Head_Tag)) partial_content | |
| 4469 | 4469 | ). |
| 4470 | 4470 | |
| 4471 | 4471 | define Printable_tree |
| ... | ... | @@ -4476,10 +4476,10 @@ define Printable_tree |
| 4476 | 4476 | HTML element, |
| 4477 | 4477 | Bool is_https, |
| 4478 | 4478 | Var(Int) action_count, |
| 4479 | - Var(List(HTML_Head_Tag)) global_head_tags | |
| 4479 | + Var(List(HTML_Head_Tag)) global_partial_content | |
| 4480 | 4480 | ) = |
| 4481 | 4481 | if cinfo is info(common_name,http_port,https_port,site_directory,secret) then |
| 4482 | - with format_element = (HTML e) |-> format(cinfo, ic_v, e, is_https, action_count, global_head_tags), | |
| 4482 | + with format_element = (HTML e) |-> format(cinfo, ic_v, e, is_https, action_count, global_partial_content), | |
| 4483 | 4483 | if element is |
| 4484 | 4484 | { |
| 4485 | 4485 | a(opts, _href, _target, l) then ["<a ", format_attrs(opts), format_href(_href), format_target(_target), ">",flat(map(format_element,l)),"</a>\n"], |
| ... | ... | @@ -4495,38 +4495,38 @@ define Printable_tree |
| 4495 | 4495 | }, |
| 4496 | 4496 | actioner(c,t,a,an,eo,ja) then |
| 4497 | 4497 | //format(cinfo,ic_v, |
| 4498 | - format_actioner(cinfo,c,t,a,an,eo,ja,failure,is_https, action_count, ic_v, global_head_tags), | |
| 4499 | - // is_https, action_count, head_tags), | |
| 4498 | + format_actioner(cinfo,c,t,a,an,eo,ja,failure,is_https, action_count, ic_v, global_partial_content), | |
| 4499 | + // is_https, action_count, partial_content), | |
| 4500 | 4500 | |
| 4501 | 4501 | actioner(c,t,a,an,eo,ja,fn) then |
| 4502 | 4502 | //format(cinfo,ic_v, |
| 4503 | - format_actioner(cinfo,c,t,a,an,eo,ja,success(fn),is_https, action_count, ic_v, global_head_tags), | |
| 4504 | - // format_element,is_https, action_count, head_tags), | |
| 4503 | + format_actioner(cinfo,c,t,a,an,eo,ja,success(fn),is_https, action_count, ic_v, global_partial_content), | |
| 4504 | + // format_element,is_https, action_count, partial_content), | |
| 4505 | 4505 | |
| 4506 | 4506 | foreign_link_new(target, aspect, url) then |
| 4507 | 4507 | //format(cinfo,ic_v, |
| 4508 | - format_foreign_link(target, aspect, url, is_https, cinfo, action_count, ic_v, global_head_tags), | |
| 4509 | - //format_element,is_https, action_count, head_tags), | |
| 4508 | + format_foreign_link(target, aspect, url, is_https, cinfo, action_count, ic_v, global_partial_content), | |
| 4509 | + //format_element,is_https, action_count, partial_content), | |
| 4510 | 4510 | |
| 4511 | 4511 | |
| 4512 | 4512 | // foreign_link(options,url,name) then |
| 4513 | -// format(cinfo,ic_v,any_foreign_link(options,url,name),format_element,is_https, action_count, head_tags), | |
| 4513 | +// format(cinfo,ic_v,any_foreign_link(options,url,name),format_element,is_https, action_count, partial_content), | |
| 4514 | 4514 | private_download(url, name, extra, action) then |
| 4515 | 4515 | //format(cinfo,ic_v, |
| 4516 | 4516 | format_private_download(cinfo, url, name, extra, action), |
| 4517 | - //format_element,is_https, action_count, head_tags), | |
| 4517 | + //format_element,is_https, action_count, partial_content), | |
| 4518 | 4518 | |
| 4519 | 4519 | // div(options, p_content) then |
| 4520 | 4520 | // with html_elements = map((HTML pc) |-> |
| 4521 | 4521 | // since pc is partial_content(tags, html_elem), |
| 4522 | -// head_tags <- *head_tags + tags; //accumulate the tags | |
| 4522 | +// partial_content <- *partial_content + tags; //accumulate the tags | |
| 4523 | 4523 | // html_elem, //return the HTML element |
| 4524 | 4524 | // p_content), |
| 4525 | 4525 | // |
| 4526 | 4526 | // //format(cinfo, ic_v, |
| 4527 | 4527 | |
| 4528 | 4528 | // [format_div_option(options), flat(map((HTML e) |-> format_element(e), html_elements)),"</div>\n"], |
| 4529 | - //format_element, is_https, action_count, head_tags), | |
| 4529 | + //format_element, is_https, action_count, partial_content), | |
| 4530 | 4530 | // iframe(options, css_styles, css_files, js_files, body) then |
| 4531 | 4531 | // println("formating iframe"); |
| 4532 | 4532 | // if body is body(body_options,elem) then |
| ... | ... | @@ -4540,17 +4540,17 @@ define Printable_tree |
| 4540 | 4540 | // add_js_files(js_files), |
| 4541 | 4541 | // "</head>\n", |
| 4542 | 4542 | // "<body ", format_attrs(body_options), ">\n", // format body options |
| 4543 | -// format(cinfo,ic_v, elem ,is_https, action_count, head_tags), | |
| 4543 | +// format(cinfo,ic_v, elem ,is_https, action_count, partial_content), | |
| 4544 | 4544 | // "</body>\n", |
| 4545 | 4545 | // "</html>\n",])), |
| 4546 | 4546 | // |
| 4547 | 4547 | // "\"></iframe>\n", |
| 4548 | 4548 | // ], |
| 4549 | - head_tags(_head_tags, html_elements) then | |
| 4550 | - global_head_tags <- *global_head_tags + _head_tags; //accumulate the tags | |
| 4549 | + partial_content(_partial_content, html_elements) then | |
| 4550 | + global_partial_content <- *global_partial_content + _partial_content; //accumulate the tags | |
| 4551 | 4551 | // if p_content is partial_content(tags, html_elements) then |
| 4552 | -// head_tags <- *head_tags + tags; | |
| 4553 | -// format(cinfo, ic_v, html_elements, is_https, action_count, head_tags), | |
| 4552 | +// partial_content <- *partial_content + tags; | |
| 4553 | +// format(cinfo, ic_v, html_elements, is_https, action_count, partial_content), | |
| 4554 | 4554 | flat(map(format_element, html_elements)) |
| 4555 | 4555 | |
| 4556 | 4556 | |
| ... | ... | @@ -4567,11 +4567,11 @@ define Printable_tree |
| 4567 | 4567 | List(HTML) elements, |
| 4568 | 4568 | Bool is_https, |
| 4569 | 4569 | Var(Int) action_count, |
| 4570 | - Var(List(HTML_Head_Tag)) head_tags | |
| 4570 | + Var(List(HTML_Head_Tag)) partial_content | |
| 4571 | 4571 | ) = |
| 4572 | 4572 | if cinfo is info(common_name,http_port,https_port,site_directory,secret) then |
| 4573 | 4573 | flat(map((HTML element) |-> |
| 4574 | - format(cinfo, ic_v, element, is_https, action_count, head_tags), | |
| 4574 | + format(cinfo, ic_v, element, is_https, action_count, partial_content), | |
| 4575 | 4575 | elements)) |
| 4576 | 4576 | . |
| 4577 | 4577 | |
| ... | ... | @@ -4655,7 +4655,7 @@ define Printable_tree |
| 4655 | 4655 | }. |
| 4656 | 4656 | |
| 4657 | 4657 | define List(HTML_Head_Tag) |
| 4658 | - rebuild_html_head_tags | |
| 4658 | + rebuild_html_partial_content | |
| 4659 | 4659 | ( |
| 4660 | 4660 | List(HTML_Head_Tag) lwf, |
| 4661 | 4661 | List(HTML_Head_Tag) so_far |
| ... | ... | @@ -4664,7 +4664,7 @@ define Printable_tree |
| 4664 | 4664 | { |
| 4665 | 4665 | [] then so_far, |
| 4666 | 4666 | [h . t] then |
| 4667 | - rebuild_html_head_tags(t, append_once(so_far, h)) | |
| 4667 | + rebuild_html_partial_content(t, append_once(so_far, h)) | |
| 4668 | 4668 | }. |
| 4669 | 4669 | |
| 4670 | 4670 | define Printable_tree |
| ... | ... | @@ -4677,7 +4677,7 @@ define Printable_tree |
| 4677 | 4677 | Dictionary(String, Word32) js_dict |
| 4678 | 4678 | ) |
| 4679 | 4679 | = |
| 4680 | - //with lwf_ = rebuild_html_head_tags(lwf, []), | |
| 4680 | + //with lwf_ = rebuild_html_partial_content(lwf, []), | |
| 4681 | 4681 | if lwf is |
| 4682 | 4682 | { |
| 4683 | 4683 | [] then reverse(so_far), |
| ... | ... | @@ -4774,9 +4774,9 @@ public define HTML_ajax_content |
| 4774 | 4774 | CommonInfo cinfo |
| 4775 | 4775 | )= |
| 4776 | 4776 | //println("to_html_ajax_content(content_HTML, cinfo)"); |
| 4777 | - with p_content_head_tags = var((List(HTML_Head_Tag))[]), | |
| 4778 | - with content = format(cinfo, var((Int)0), content_HTML, false, var(0), p_content_head_tags), | |
| 4779 | - if sort_head_tag(*p_content_head_tags, "", [], []) is html_ajax_content(_, script, js_file, css_file) then | |
| 4777 | + with p_content_partial_content = var((List(HTML_Head_Tag))[]), | |
| 4778 | + with content = format(cinfo, var((Int)0), content_HTML, false, var(0), p_content_partial_content), | |
| 4779 | + if sort_head_tag(*p_content_partial_content, "", [], []) is html_ajax_content(_, script, js_file, css_file) then | |
| 4780 | 4780 | html_ajax_content(to_String(content), script, js_file, css_file). |
| 4781 | 4781 | |
| 4782 | 4782 | public define String |
| ... | ... | @@ -4786,8 +4786,8 @@ public define String |
| 4786 | 4786 | CommonInfo cinfo |
| 4787 | 4787 | )= |
| 4788 | 4788 | //println("to_html_ajax_content(content_HTML, cinfo)"); |
| 4789 | - with p_content_head_tags = var((List(HTML_Head_Tag))[]), | |
| 4790 | - with content = format(cinfo, var((Int)0), content_HTML, false, var(0), p_content_head_tags), | |
| 4789 | + with p_content_partial_content = var((List(HTML_Head_Tag))[]), | |
| 4790 | + with content = format(cinfo, var((Int)0), content_HTML, false, var(0), p_content_partial_content), | |
| 4791 | 4791 | to_String(content) |
| 4792 | 4792 | . |
| 4793 | 4793 | |
| ... | ... | @@ -4843,16 +4843,16 @@ public define AWP_Handler_Answer //Printable_tree |
| 4843 | 4843 | )= |
| 4844 | 4844 | if cinfo is info(common_name,http_port,https_port,site_directory,secret) then |
| 4845 | 4845 | with ic_v = var((Int)0), |
| 4846 | - p_content_head_tags = var((List(HTML_Head_Tag))[]), //list of heat_tags extracted from partial_content during format of body content | |
| 4846 | + p_content_partial_content = var((List(HTML_Head_Tag))[]), //list of heat_tags extracted from partial_content during format of body content | |
| 4847 | 4847 | if page is |
| 4848 | 4848 | { |
| 4849 | - html_page(status, head_tags, body) then | |
| 4849 | + html_page(status, partial_content, body) then | |
| 4850 | 4850 | if body is body(options,element) then |
| 4851 | 4851 | if format(status) is (status_string, status_headers) then |
| 4852 | 4852 | with |
| 4853 | 4853 | answer_body_body = (Printable_tree) |
| 4854 | 4854 | [ "<body ", format_attrs(options), ">", // format body options |
| 4855 | - format(cinfo,ic_v,element,is_https, var(0), p_content_head_tags), | |
| 4855 | + format(cinfo,ic_v,element,is_https, var(0), p_content_partial_content), | |
| 4856 | 4856 | "</body>\n", |
| 4857 | 4857 | |
| 4858 | 4858 | "</html>"], |
| ... | ... | @@ -4860,7 +4860,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 4860 | 4860 | [doctype_w3c_header, |
| 4861 | 4861 | // html_header, |
| 4862 | 4862 | |
| 4863 | - "<head>\n", format_html_head(cinfo, is_https, head_tags + *p_content_head_tags, charset),"</head>\n", | |
| 4863 | + "<head>\n", format_html_head(cinfo, is_https, partial_content + *p_content_partial_content, charset),"</head>\n", | |
| 4864 | 4864 | ], |
| 4865 | 4865 | printable_tree([ |
| 4866 | 4866 | "HTTP/1.1 " + status_string, crlf, |
| ... | ... | @@ -4873,13 +4873,13 @@ public define AWP_Handler_Answer //Printable_tree |
| 4873 | 4873 | answer_body_body |
| 4874 | 4874 | ]), |
| 4875 | 4875 | |
| 4876 | - html_page(status, title, head_tags, /*css_styles,*/ css_files, js_files, script, body) then | |
| 4876 | + html_page(status, title, partial_content, /*css_styles,*/ css_files, js_files, script, body) then | |
| 4877 | 4877 | if body is body(options,element) then |
| 4878 | 4878 | if format(status) is (status_string, status_headers) then |
| 4879 | 4879 | with |
| 4880 | 4880 | answer_body_body = (Printable_tree) |
| 4881 | 4881 | [ "<body ", format_attrs(options), ">", // format body options |
| 4882 | - format(cinfo, ic_v, element, is_https, var(0), p_content_head_tags), | |
| 4882 | + format(cinfo, ic_v, element, is_https, var(0), p_content_partial_content), | |
| 4883 | 4883 | "</body>\n", |
| 4884 | 4884 | "</html>" |
| 4885 | 4885 | ], |
| ... | ... | @@ -4893,7 +4893,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 4893 | 4893 | add_script(script), |
| 4894 | 4894 | "<link rel=\"shortcut icon\" href=\"favicon.ico\" />\n", |
| 4895 | 4895 | "<title>",title,"</title>\n", // put title |
| 4896 | - format_html_head(cinfo, is_https, head_tags + *p_content_head_tags, charset), | |
| 4896 | + format_html_head(cinfo, is_https, partial_content + *p_content_partial_content, charset), | |
| 4897 | 4897 | "</head>\n" |
| 4898 | 4898 | ], |
| 4899 | 4899 | printable_tree([ |
| ... | ... | @@ -4979,7 +4979,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 4979 | 4979 | |
| 4980 | 4980 | html_content(HTTP_Status status, HTML content_HTML) then |
| 4981 | 4981 | if format(status) is (status_string, status_headers) then |
| 4982 | - with content = format(cinfo, ic_v, content_HTML, is_https, var(0), p_content_head_tags), | |
| 4982 | + with content = format(cinfo, ic_v, content_HTML, is_https, var(0), p_content_partial_content), | |
| 4983 | 4983 | printable_tree([ |
| 4984 | 4984 | "HTTP/1.1 " + status_string, crlf, |
| 4985 | 4985 | format_headers(standard_headers), |
| ... | ... | @@ -4992,17 +4992,17 @@ public define AWP_Handler_Answer //Printable_tree |
| 4992 | 4992 | //HMTL content with some header |
| 4993 | 4993 | // HTML(HTTP_Status status, HTML p_content) then |
| 4994 | 4994 | // |
| 4995 | -// since p_content is partial_content(head_tags, html_content), | |
| 4995 | +// since p_content is partial_content(partial_content, html_content), | |
| 4996 | 4996 | // since format(status) is (status_string, status_headers), |
| 4997 | 4997 | // with |
| 4998 | 4998 | // answer_body = (Printable_tree) |
| 4999 | 4999 | // [ |
| 5000 | -// format(cinfo, ic_v, html_content, is_https, var(0), p_content_head_tags), | |
| 5000 | +// format(cinfo, ic_v, html_content, is_https, var(0), p_content_partial_content), | |
| 5001 | 5001 | // ], |
| 5002 | 5002 | // answer_header = (Printable_tree) |
| 5003 | 5003 | // [ |
| 5004 | 5004 | // // html_header, |
| 5005 | -// format_html_head(head_tags + *p_content_head_tags), | |
| 5005 | +// format_html_head(partial_content + *p_content_partial_content), | |
| 5006 | 5006 | // ], |
| 5007 | 5007 | // printable_tree([ |
| 5008 | 5008 | // "HTTP/1.1 " + status_string, crlf, | ... | ... |
web/types/making_a_web_site.anubis
| ... | ... | @@ -450,16 +450,16 @@ public type HTML: |
| 450 | 450 | //foreign_link (List(CoreAttrs), String url, String name), |
| 451 | 451 | private_download (String abs_path, String name, String extra_ext, |
| 452 | 452 | Maybe((String,List((String,String)))) action), |
| 453 | - head_tags (List(HTML_Head_Tag) heads, List(HTML) content), | |
| 453 | + partial_content (List(HTML_Head_Tag) heads, List(HTML) content), | |
| 454 | 454 | html_tag (String tag_name, List(CoreAttrs), List(HTML) content), |
| 455 | 455 | html_void_tag (String tag_name, List(CoreAttrs)) |
| 456 | 456 | . |
| 457 | 457 | |
| 458 | -public define HTML head_tags(List(HTML_Head_Tag) heads, HTML content) = head_tags(heads, [content]). | |
| 459 | -public define HTML head_tags(HTML_Head_Tag head, List(HTML) contents) = head_tags([head], contents). | |
| 460 | -public define HTML head_tags(HTML_Head_Tag head, HTML content) = head_tags([head], [content]). | |
| 461 | -public define HTML head_tags(List(HTML_Head_Tag) heads) = head_tags(heads, []). | |
| 462 | -public define HTML head_tags(HTML_Head_Tag head) = head_tags([head], []). | |
| 458 | +public define HTML partial_content(List(HTML_Head_Tag) heads, HTML content) = partial_content(heads, [content]). | |
| 459 | +public define HTML partial_content(HTML_Head_Tag head, List(HTML) contents) = partial_content([head], contents). | |
| 460 | +public define HTML partial_content(HTML_Head_Tag head, HTML content) = partial_content([head], [content]). | |
| 461 | +public define HTML partial_content(List(HTML_Head_Tag) heads) = partial_content(heads, []). | |
| 462 | +public define HTML partial_content(HTML_Head_Tag head) = partial_content([head], []). | |
| 463 | 463 | |
| 464 | 464 | |
| 465 | 465 | public type Rel_attr: |
| ... | ... | @@ -572,13 +572,7 @@ public type HTML_Head_Tag: |
| 572 | 572 | link(List(Link_attr) link_attrs) |
| 573 | 573 | . |
| 574 | 574 | |
| 575 | -//public type HTML: | |
| 576 | -// partial_content | |
| 577 | -// ( | |
| 578 | -// List(HTML_Head_Tag), | |
| 579 | -// HTML | |
| 580 | -// ) | |
| 581 | -//. | |
| 575 | + | |
| 582 | 576 | |
| 583 | 577 | public type HTML_Body: |
| 584 | 578 | body(List(CoreAttrs) attrs, List(HTML) content). | ... | ... |
web/widgets/button.anubis
| ... | ... | @@ -276,7 +276,7 @@ public define HTML |
| 276 | 276 | )= |
| 277 | 277 | with uid = generate_random_string(20), |
| 278 | 278 | |
| 279 | - head_tags([js(js_file("xlib/js/xlib.js")), js_inline(jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)))], | |
| 279 | + partial_content([js(js_file("xlib/js/xlib.js")), js_inline(jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)))], | |
| 280 | 280 | img(img_button_confirm_image_attrs(core_attrs, uid, actioner), img_path)). |
| 281 | 281 | |
| 282 | 282 | public define HTML |
| ... | ... | @@ -352,7 +352,7 @@ public define HTML |
| 352 | 352 | with uid = generate_random_string(20), |
| 353 | 353 | //with event_click = (CoreAttrs)event(onclick, "Xlib.jq_query("+format_web_action_name_to_js(web_action, extra_ops)+")"), |
| 354 | 354 | |
| 355 | - head_tags([js(js_file("xlib/js/xlib.js")), js_inline(jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)))], | |
| 355 | + partial_content([js(js_file("xlib/js/xlib.js")), js_inline(jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)))], | |
| 356 | 356 | img(img_button_confirm_image_attrs(core_attrs, uid, web_action, extra_ops, load_content_target, call_back), img_path)) |
| 357 | 357 | . |
| 358 | 358 | ... | ... |
web/widgets/css_helper.anubis
| ... | ... | @@ -165,7 +165,7 @@ public define HTML |
| 165 | 165 | ( |
| 166 | 166 | List(ChangeListItem) items |
| 167 | 167 | )= |
| 168 | - head_tags([css(css_file("xlib/css/changelists.css"))], | |
| 168 | + partial_content([css(css_file("xlib/css/changelists.css"))], | |
| 169 | 169 | div(class("changelist"), |
| 170 | 170 | table([/*class("module"), */ attr("cellspacing","0")], make_changelist_rows(items, [], 1)))) |
| 171 | 171 | . | ... | ... |
web/widgets/left_menu_html.anubis
| ... | ... | @@ -58,7 +58,7 @@ public define HTML |
| 58 | 58 | { |
| 59 | 59 | no_left_menu then empty, |
| 60 | 60 | left_menu(entries, selected) then |
| 61 | - head_tags([css(css_file("/css/left_menu.css"))], | |
| 61 | + partial_content([css(css_file("/css/left_menu.css"))], | |
| 62 | 62 | make_left_menu(_T, entries, selected, [])) |
| 63 | 63 | }. |
| 64 | 64 | ... | ... |
web/widgets/menu.anubis
| ... | ... | @@ -223,7 +223,7 @@ public define HTML |
| 223 | 223 | { |
| 224 | 224 | no_menu then empty, |
| 225 | 225 | menu(items) then |
| 226 | - head_tags([css(css_file("xlib/css/menu.css"))], | |
| 226 | + partial_content([css(css_file("xlib/css/menu.css"))], | |
| 227 | 227 | //partial_content([css(css_file("/css/admin_theme.css"))], |
| 228 | 228 | make_menu(_T, items, _direction)) |
| 229 | 229 | } | ... | ... |
web/widgets/pager.anubis
web_controllers/language/language_management.anubis
| ... | ... | @@ -191,7 +191,7 @@ public define HTML |
| 191 | 191 | else |
| 192 | 192 | language_line(lang_code, self_name(lang_info)), |
| 193 | 193 | |
| 194 | - head_tags([ | |
| 194 | + partial_content([ | |
| 195 | 195 | css(css_file("/xlib/css/flags_menu.css")), |
| 196 | 196 | js(js_file("/xlib/js/xlib.js")) |
| 197 | 197 | ], |
| ... | ... | @@ -255,7 +255,7 @@ public define HTML |
| 255 | 255 | else |
| 256 | 256 | language_line_bs(lang_code, self_name(lang_info)), |
| 257 | 257 | |
| 258 | - head_tags([ | |
| 258 | + partial_content([ | |
| 259 | 259 | css(css_file("/xlib/css/flags_menu.css")), |
| 260 | 260 | //js(js_file("/xlib/js/xlib.js")) |
| 261 | 261 | ], |
| ... | ... | @@ -317,7 +317,7 @@ public define HTML |
| 317 | 317 | else |
| 318 | 318 | language_line(lang_code, self_name(lang_info), action), |
| 319 | 319 | |
| 320 | - head_tags([ | |
| 320 | + partial_content([ | |
| 321 | 321 | css(css_file("/xlib/css/flags_menu.css")), |
| 322 | 322 | js(js_file("/xlib/js/xlib.js")) |
| 323 | 323 | ], |
| ... | ... | @@ -412,7 +412,7 @@ public define HTML |
| 412 | 412 | else |
| 413 | 413 | dd_language_line(lang_code, self_name(lang_info), action), |
| 414 | 414 | |
| 415 | - head_tags([ | |
| 415 | + partial_content([ | |
| 416 | 416 | css(css_file("/xlib/css/flags_menu.css")), |
| 417 | 417 | js(js_file("/xlib/js/xlib.js")) |
| 418 | 418 | ], | ... | ... |