From c247833f84f1ae3ca557fbd7489da75f22b860cf Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Fri, 14 Sep 2007 16:02:11 +0000 Subject: [PATCH] Not a very nice patch allowing to remove javascript from web forms --- calexium_lib/web/CXM_making_a_web_site.anubis | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+), 0 deletions(-) diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 9c5d48f..3999bcf 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -1032,6 +1032,14 @@ public define HTML_In_Form ) = actioner(conn,targ,asp,action_name,extra_ops,[]). +public define HTML_In_Form + actioner + ( + Actioner_Connection conn, + Actioner_Target targ, + Actioner_Aspect asp, + ) = + actioner(conn, targ, asp, "", [], []). public define HTML_In_Form @@ -1144,6 +1152,9 @@ public type HTML_Off_Form: Maybe((String,List((String,String)))) action), label (String name), form (String form_name, List(CoreAttrs), HTML_In_Form content), + form (String form_name, List(CoreAttrs), + String action_name, List((String,String)) extra_ops, + HTML_In_Form content), div (List(CoreAttrs), HTML_Off_Form content), div_empty (List(CoreAttrs)). @@ -3101,6 +3112,10 @@ define Printable_tree text, "" ], javascript(s,h) then + if action_name = "" then // special case where URL (so the action_name) is provided by the form itself + // so javascript isn't needed. This is the standard HMTL way. + [""] + else [s,""] } ], @@ -3928,6 +3943,23 @@ define Printable_tree format(cinfo,fn,sn,ic_v,c,is_https), "" ] + form(fn,attributs, action_name, extra_ops, c) then + with url = make_actioner_url(cinfo, same, same, + sn, action_name, extra_ops, is_https), + [ + "
", +// " action=\"http", +// if is_https then "s" else "", +// "://",common_name,":",http_port,"/\">", + // action is set dynamically by + // the actioner using JavaScript + format(cinfo,fn,sn,ic_v,c,is_https), + "
" + ] 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