Commit e9a18d8aa326a50190a21453bafef38c513a6c4e
1 parent
12cf42eb
[+] add CommonInfo and https Bool as arguments into format_html_head which it's …
…need for formatting the HTML output
Showing
1 changed file
with
24 additions
and
30 deletions
Show diff stats
web/making_a_web_site.anubis
| ... | ... | @@ -4609,11 +4609,11 @@ define Printable_tree |
| 4609 | 4609 | } |
| 4610 | 4610 | . |
| 4611 | 4611 | |
| 4612 | -define Printable_tree // c'est le nôtre et c'est meilleur | |
| 4613 | - format | |
| 4614 | - ( | |
| 4615 | - HTML_Meta m, | |
| 4616 | - ) = | |
| 4612 | + define Printable_tree // c'est le nôtre et c'est meilleur | |
| 4613 | + format | |
| 4614 | + ( | |
| 4615 | + HTML_Meta m, | |
| 4616 | + ) = | |
| 4617 | 4617 | if m is |
| 4618 | 4618 | { |
| 4619 | 4619 | keywords(l) then ["<meta name=\"keywords\" content=\"",format_keywords(l),"\" />\n"], |
| ... | ... | @@ -4663,6 +4663,8 @@ define Printable_tree |
| 4663 | 4663 | define Printable_tree |
| 4664 | 4664 | _format_html_head |
| 4665 | 4665 | ( |
| 4666 | + CommonInfo cinfo, | |
| 4667 | + Bool is_https, | |
| 4666 | 4668 | List(HTML_Head_Tag) lwf, |
| 4667 | 4669 | Printable_tree so_far, |
| 4668 | 4670 | Dictionary(String, Word32) js_dict |
| ... | ... | @@ -4676,35 +4678,35 @@ define Printable_tree |
| 4676 | 4678 | if h is |
| 4677 | 4679 | { |
| 4678 | 4680 | meta(meta) then |
| 4679 | - [format(meta) . _format_html_head(t, so_far, js_dict)], | |
| 4681 | + [format(cinfo, meta, is_https) . _format_html_head(cinfo, is_https, t, so_far, js_dict)], | |
| 4680 | 4682 | title(title) then |
| 4681 | - ["<title>"+title+"</title>\n" . _format_html_head(t, so_far, js_dict)], | |
| 4683 | + ["<title>"+title+"</title>\n" . _format_html_head(cinfo, is_https, t, so_far, js_dict)], | |
| 4682 | 4684 | js(jsf) then |
| 4683 | 4685 | since jsf is js_file(filename, _), |
| 4684 | 4686 | if js_dict.get(filename) is |
| 4685 | 4687 | { |
| 4686 | 4688 | failure then |
| 4687 | 4689 | forget(js_dict.insert(filename, 0)); |
| 4688 | - [add_js_files([jsf]) . _format_html_head(t, so_far, js_dict)], | |
| 4690 | + [add_js_files([jsf]) . _format_html_head(cinfo, is_https, t, so_far, js_dict)], | |
| 4689 | 4691 | |
| 4690 | 4692 | success(_) then |
| 4691 | - _format_html_head(t, so_far, js_dict), | |
| 4693 | + _format_html_head(cinfo, is_https, t, so_far, js_dict), | |
| 4692 | 4694 | } |
| 4693 | 4695 | js_inline(jsi) then |
| 4694 | 4696 | if jsi is |
| 4695 | 4697 | { |
| 4696 | 4698 | script(type, _) then |
| 4697 | - ["<script type=\"" + type + "\">"+content(jsi)+"</script>\n" . _format_html_head(t, so_far, js_dict)], | |
| 4699 | + ["<script type=\"" + type + "\">"+content(jsi)+"</script>\n" . _format_html_head(cinfo, is_https, t, so_far, js_dict)], | |
| 4698 | 4700 | } |
| 4699 | 4701 | css(cssf) then |
| 4700 | 4702 | since cssf is css_file(file_name, media), |
| 4701 | - ["<link rel=\"stylesheet\" type=\"text/css\" href=\""+file_name+"\" media=\""+to_String(media)+"\" />\n" . _format_html_head(t, so_far, js_dict)], | |
| 4703 | + ["<link rel=\"stylesheet\" type=\"text/css\" href=\""+file_name+"\" media=\""+to_String(media)+"\" />\n" . _format_html_head(cinfo, is_https, t, so_far, js_dict)], | |
| 4702 | 4704 | |
| 4703 | 4705 | css_inline(cssi) then |
| 4704 | - ["<style>"+cssi+"</style>\n" . _format_html_head(t, so_far, js_dict)] | |
| 4706 | + ["<style>"+cssi+"</style>\n" . _format_html_head(cinfo, is_https, t, so_far, js_dict)] | |
| 4705 | 4707 | |
| 4706 | 4708 | link(link_attrs) then |
| 4707 | - ["<link " + to_String(link_attrs) + " />\n" . _format_html_head(t, so_far, js_dict)] | |
| 4709 | + ["<link " + to_String(link_attrs) + " />\n" . _format_html_head(cinfo, is_https, t, so_far, js_dict)] | |
| 4708 | 4710 | } |
| 4709 | 4711 | } |
| 4710 | 4712 | . |
| ... | ... | @@ -4712,19 +4714,23 @@ define Printable_tree |
| 4712 | 4714 | public define Printable_tree |
| 4713 | 4715 | format_html_head |
| 4714 | 4716 | ( |
| 4717 | + CommonInfo cinfo, | |
| 4718 | + Bool is_https, | |
| 4715 | 4719 | List(HTML_Head_Tag) lwf, |
| 4716 | 4720 | String charset |
| 4717 | 4721 | ) |
| 4718 | 4722 | = |
| 4719 | - _format_html_head((List(HTML_Head_Tag))[ meta(http_equiv("content-type", "text/html; charset="+charset)) . lwf], [], make_dictionary((Word32)0, dictionaryComparerString)). | |
| 4723 | + _format_html_head(cinfo, is_https, (List(HTML_Head_Tag))[ meta(http_equiv("content-type", "text/html; charset="+charset)) . lwf], [], make_dictionary((Word32)0, dictionaryComparerString)). | |
| 4720 | 4724 | |
| 4721 | 4725 | public define Printable_tree |
| 4722 | 4726 | format_html_head |
| 4723 | 4727 | ( |
| 4728 | + CommonInfo cinfo, | |
| 4729 | + Bool is_https, | |
| 4724 | 4730 | List(HTML_Head_Tag) lwf |
| 4725 | 4731 | ) |
| 4726 | 4732 | = |
| 4727 | - _format_html_head(lwf, [], make_dictionary((Word32)0, dictionaryComparerString)). | |
| 4733 | + _format_html_head(cinfo, is_https, lwf, [], make_dictionary((Word32)0, dictionaryComparerString)). | |
| 4728 | 4734 | |
| 4729 | 4735 | |
| 4730 | 4736 | public type HTML_ajax_content: |
| ... | ... | @@ -4847,7 +4853,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 4847 | 4853 | [doctype_w3c_header, |
| 4848 | 4854 | // html_header, |
| 4849 | 4855 | |
| 4850 | - "<head>\n", format_html_head(head_tags + *p_content_head_tags, charset),"</head>\n", | |
| 4856 | + "<head>\n", format_html_head(cinfo, is_https, head_tags + *p_content_head_tags, charset),"</head>\n", | |
| 4851 | 4857 | ], |
| 4852 | 4858 | printable_tree([ |
| 4853 | 4859 | "HTTP/1.1 " + status_string, crlf, |
| ... | ... | @@ -4866,7 +4872,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 4866 | 4872 | with |
| 4867 | 4873 | answer_body_body = (Printable_tree) |
| 4868 | 4874 | [ "<body ", format_attrs(options), ">", // format body options |
| 4869 | - format(cinfo,ic_v,element,is_https, var(0), p_content_head_tags), | |
| 4875 | + format(cinfo, ic_v, element, is_https, var(0), p_content_head_tags), | |
| 4870 | 4876 | "</body>\n", |
| 4871 | 4877 | "</html>" |
| 4872 | 4878 | ], |
| ... | ... | @@ -4879,20 +4885,8 @@ public define AWP_Handler_Answer //Printable_tree |
| 4879 | 4885 | add_js_files(js_files), |
| 4880 | 4886 | add_script(script), |
| 4881 | 4887 | "<link rel=\"shortcut icon\" href=\"favicon.ico\" />\n", |
| 4882 | - "<script type = \"text/javascript\" language=\"JavaScript\">", | |
| 4883 | - " function show_local_popup(divname,stvname) {", | |
| 4884 | - " if (document.layers) { var d = eval(document.divname); } else\n", | |
| 4885 | - " if (document.getElementById) { var d = eval(\"document.getElementById(divname)\"); } else\n", | |
| 4886 | - " if (document.all) { var d = eval(document.all.divname.style)};\n", | |
| 4887 | - // " alert(typeof(eval(stvname))); ", | |
| 4888 | - " var s = eval(stvname); ", | |
| 4889 | - " if (s[0]==0) ", | |
| 4890 | - " { s[0]=1; d.style.visibility = 'visible'; d.zIndex = 100; } else\n", | |
| 4891 | - " { s[0]=0; d.style.visibility = 'hidden'; }; }", | |
| 4892 | - "</script>\n", | |
| 4893 | 4888 | "<title>",title,"</title>\n", // put title |
| 4894 | - //format(cinfo,metas,is_https,charset), // format the metas | |
| 4895 | - format_html_head(head_tags + *p_content_head_tags, charset), | |
| 4889 | + format_html_head(cinfo, is_https, head_tags + *p_content_head_tags, charset), | |
| 4896 | 4890 | "</head>\n" |
| 4897 | 4891 | ], |
| 4898 | 4892 | printable_tree([ | ... | ... |