diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 64f3e73..e573756 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -3092,7 +3092,7 @@ define Printable_tree { link(opt, text, mb_name) then - with name_tag = if mb_name is success(n) then " name=\" " + n + "\"" else "", + with name_tag = if mb_name is success(n) then " name=\"" + n + "\"" else "", [ "", text, @@ -3519,10 +3519,8 @@ define Printable_tree "", "", "", - "", - "", + "", + "", "", "
\"sroll
\"scroll
\"sroll
\"scroll
", "", @@ -3534,10 +3532,8 @@ define Printable_tree "", "", "", - "", - "", + "", + "", "", "", "
\"scroll\"scroll\"scroll\"scroll
", @@ -3548,64 +3544,7 @@ define Printable_tree "" ]. - -/* - define Printable_tree - popup_topbar - ( - CommonInfo cinfo, - String title, - RGB color, - Int32 width, - ) = - if cinfo is info(common_name,http_port,https_port,site_directory,secret) then - with xxxx = web_arg_encode(sha1((title,color,width))), - path = site_directory+"/public/buttons/t"+xxxx+".jpg", - result = (Printable_tree)["\"button\""], - if file_exists(path) then result else - with col = to_rgba(color), - bg = create_button_background(col,width,20), - very_light_color = lighten(col,70), - dark_color = darken(col,40), - title_width = printed_text_width(font,title), - draw_button_text(bg,title,title_width,very_light_color,dark_color,font); - forget(write_image_to_JPEG_file(to_JPEG(bg),path,100)); - result. - - - define Printable_tree - popup_close_button - ( - CommonInfo cinfo, - RGB color, - String div_name, - String state_var_name, - ) = - if cinfo is info(common_name,http_port,https_port,site_directory,secret) then - with xxxx = web_arg_encode(sha1(color)), - path_on = site_directory+"/public/buttons/c"+xxxx+"_on.jpg", - path_off = site_directory+"/public/buttons/c"+xxxx+"_off.jpg", - result = (Printable_tree)["\"button\""], - if file_exists(path_on) then result else - with col = to_rgba(color), - title = "x", - title_width = printed_text_width(font,title), - bg_on = create_button_background(lighten(col,30),20,20), - bg_off = create_button_background(col,20,20), - very_light_color = lighten(col,70), - dark_color = darken(col,40), - draw_button_text(bg_on,title,title_width,very_light_color,dark_color,font); - draw_button_text(bg_off,title,title_width,very_light_color,dark_color,font); - forget(write_image_to_JPEG_file(to_JPEG(bg_on),path_on,100)); - forget(write_image_to_JPEG_file(to_JPEG(bg_off),path_off,100)); - result. - - -*/ - + // The function below formats a datum of type 'HTML_Any($T)'. @@ -3676,7 +3615,14 @@ define Printable_tree // *** [5.8] Formating 'in form' elements. - +define Printable_tree + maybe_label + ( + String label_text, + HtmlId id + ) = + if length(label_text) > 0 then [""] + else []. define Printable_tree @@ -3723,44 +3669,44 @@ define Printable_tree private_download(url,name,extra,action) then format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https), text_input(options, label_text, id, name, i, w) then - [if length(label_text) > 0 then [""] else [], + [ maybe_label(label_text, id), ""], text_input_ro(options, label_text, id, name,i,w) then - [if length(label_text) > 0 then [""] else [], + [ maybe_label(label_text, id), ""], password_input(options, label_text, id, name,i,w) then - [if length(label_text) > 0 then [""] else [], + [ maybe_label(label_text, id), ""], text_area(opts,n,i,w,h) then [""], file_upload(label, id, n, w) then - ["", + [ maybe_label(label, id), ""], selector(opts, label, id, n,s,cs) then - ["", + [ maybe_label(label, id), ""], selector(opts, label, id, n,s,cs,sd) then - ["", + [ maybe_label(label, id), ""], selector_c(opts, label, id, n,s,cs) then - ["", + [ maybe_label(label, id), ""], selector_c(opts, label, id, n,s,cs,sd) then - ["", + [ maybe_label(label, id), ""], radio_button(options, label_text, id, n, v, c) then - [ "", + [ maybe_label(label_text, id), ""], radio_button_r(options, label_text, id, n, v, c) then [ "", - ""], + maybe_label(label_text, id)], check_box(options, label_text, id, n, v, c) then - [ if length(label_text) > 0 then [""] else [""], + [ maybe_label(label_text, id), ""] check_box_r(options, label_text, id, n, v, c) then [ "", - if length(label_text) > 0 then [""] else [""] ] + maybe_label(label_text, id)] div(options, e) then format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https), div_empty(options) then -- libgit2 0.21.4