From 779844312939348ec5e8185c8978c680d04e2bb0 Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Sat, 22 Mar 2008 21:34:20 +0000 Subject: [PATCH] improved 'image' tag --- calexium_lib/web/CXM_making_a_web_site.anubis | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index d8b92cc..35d4a7e 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -985,8 +985,8 @@ public type HTML_In_Form: text (List(Text_Option), String the_text), preformated (List(Text_Option), String), paragraph (List(Text_Option), HTML_In_Form content), - image (String url), - image (String url, Int32 width, Int32 height), + image (List(CoreAttrs), String url, String alternate), + image (List(CoreAttrs), String url, String alternate, Int32 width, Int32 height), table (List(Table_Option), HTML_Header_Row(HTML_In_Form), List(HTML_Row(HTML_In_Form)), HTML_Footer_Row(HTML_In_Form)), center (HTML_In_Form), mail_to (String email, HTML_In_Form element), @@ -1027,6 +1027,10 @@ public type HTML_In_Form: public define HTML_In_Form literal(Printable_tree t) = literal_pt(t). +public define HTML_In_Form image(String url) = image([], url, url). + +public define HTML_In_Form image(String url, Int32 width, Int32 height) = image([], url, url, width, height). + public define HTML_In_Form foreign_link ( @@ -1165,8 +1169,8 @@ public type HTML_Off_Form: text (List(Text_Option), String the_text), preformated (List(Text_Option), String), paragraph (List(Text_Option), HTML_Off_Form content), - image (String url), - image (String url, Int32 width, Int32 height), + image (List(CoreAttrs), String url, String alternate), + image (List(CoreAttrs), String url, String alternate, Int32 width, Int32 height), table (List(Table_Option), HTML_Header_Row(HTML_Off_Form), List(HTML_Row(HTML_Off_Form)), HTML_Footer_Row(HTML_Off_Form)), center (HTML_Off_Form), mail_to (String email, HTML_Off_Form element), @@ -1197,6 +1201,10 @@ public type HTML_Off_Form: 'HTML_Off_Form' defines all the elements you may put outside any form. +public define HTML_Off_Form image(String url) = image([], url, url). + +public define HTML_Off_Form image(String url, Int32 width, Int32 height) = image([], url, url, width, height). + public define HTML_Off_Form form ( @@ -2417,8 +2425,8 @@ type HTML_Any($T): any_text (List(Text_Option), String the_text), any_preformated (List(Text_Option), String), any_paragraph (List(Text_Option), $T content), - any_image (String url), - any_image (String url, Int32 width, Int32 height), + any_image (List(CoreAttrs), String url, String alternate), + any_image (List(CoreAttrs), String url, String alternate, Int32 width, Int32 height), any_table (List(Table_Option), HTML_Header_Row($T), List(HTML_Row($T)), HTML_Footer_Row($T)), any_center ($T), any_mail_to (String email, $T element), @@ -3759,10 +3767,10 @@ define Printable_tree //["
",s,"
"], any_paragraph(opts,e) then ["

",format_element(e),"

\n"], - any_image(url) then - ["\"",url,"\""], - any_image(url,w,h) then - ["\"",url,"\""], + any_image(opts, url, alt) then + ["\"",alt,"\""], + any_image(opts, url, alt, w, h) then + ["\"",alt,"\""], any_table(opts,h_row, rows, f_row) then ["", format(h_row, format_element), @@ -3843,12 +3851,12 @@ define Printable_tree format(cinfo,sn,ic_v,any_text(opts,t),format_element,is_https), preformated(o,s) then format(cinfo,sn,ic_v,any_preformated(o,s),format_element,is_https), - paragraph(opts,t) then + paragraph(opts,t) then format(cinfo,sn,ic_v,any_paragraph(opts,t),format_element,is_https), - image(url) then - format(cinfo,sn,ic_v,any_image(url),format_element,is_https), - image(url,w,h) then - format(cinfo,sn,ic_v,any_image(url,w,h),format_element,is_https), + image(opts, url, alt) then + format(cinfo,sn,ic_v,any_image(opts, url, alt),format_element,is_https), + image(opts, url, alt, w, h) then + format(cinfo,sn,ic_v,any_image(opts, url, alt, w, h),format_element,is_https), table(opts,header_row,rows,footer_row) then format(cinfo,sn,ic_v,any_table(opts, header_row, rows, footer_row),format_element,is_https), center(e) then @@ -3967,8 +3975,8 @@ define Bool text(o,t) then false, preformated(o,s) then false, paragraph(o,t) then false, - image(u) then false, - image(u,w,h) then false, + image(o,u,a) then false, + image(o,u,a,w,h) then false, table(o,_,rows,f_row) then if mapor(contains_an_upload,rows) then true else contains_an_upload(f_row), center(e) then contains_an_upload(e), @@ -4030,10 +4038,10 @@ define Printable_tree format(cinfo,sn,ic_v,any_preformated(o,s),format_element,is_https), paragraph(opts,t) then format(cinfo,sn,ic_v,any_paragraph(opts,t),format_element,is_https), - image(url) then - format(cinfo,sn,ic_v,any_image(url),format_element,is_https), - image(url,w,h) then - format(cinfo,sn,ic_v,any_image(url,w,h),format_element,is_https), + image(opts,url,alt) then + format(cinfo,sn,ic_v,any_image(opts,url,alt),format_element,is_https), + image(opts,url,alt,w,h) then + format(cinfo,sn,ic_v,any_image(opts,url,alt,w,h),format_element,is_https), table(opts,header_row, rows, footer_row) then format(cinfo,sn,ic_v,any_table(opts,header_row, rows, footer_row),format_element,is_https), center(e) then -- libgit2 0.21.4