Commit c75d15f95e568ad2ccb04ce933b1c2753803aa5c

Authored by Steve MARECHAL
1 parent 758138e4

text_input and hidden use WebArgName and not Maybe(WebArgName)

Showing 1 changed file with 6 additions and 23 deletions   Show diff stats
calexium_lib/web/CXM_making_a_web_site.anubis
@@ -1037,7 +1037,7 @@ public type HTML_In_Form: @@ -1037,7 +1037,7 @@ public type HTML_In_Form:
1037 foreign_link (List(Text_Option), String url, String name), 1037 foreign_link (List(Text_Option), String url, String name),
1038 private_download (String abs_path, String name, String extra_ext, 1038 private_download (String abs_path, String name, String extra_ext,
1039 Maybe((String,List((String,String)))) action), 1039 Maybe((String,List((String,String)))) action),
1040 - text_input (List(InputAttrs), String label_text, HtmlId id, Maybe(WebArgName) name, InitialValue init, Int width), 1040 + text_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1041 text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), 1041 text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1042 password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width), 1042 password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width),
1043 text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height), 1043 text_area (List(TextAreaOption), String label_text, HtmlId id, WebArgName name, InitialValue init, Int width, Int height),
@@ -1055,7 +1055,7 @@ public type HTML_In_Form: @@ -1055,7 +1055,7 @@ public type HTML_In_Form:
1055 check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked), 1055 check_box_r (List(InputAttrs), String label_text, HtmlId id, WebArgName name, WebArgValue value, Bool checked),
1056 div (List(CoreAttrs), HTML_In_Form content), 1056 div (List(CoreAttrs), HTML_In_Form content),
1057 div_empty (List(CoreAttrs)), 1057 div_empty (List(CoreAttrs)),
1058 - hidden (HtmlId id, Maybe(WebArgName) name, InitialValue init). 1058 + hidden (HtmlId id, WebArgName name, InitialValue init).
1059 1059
1060 1060
1061 'HTML_In_Form' defines all the elements you may put within a form. We define a 1061 'HTML_In_Form' defines all the elements you may put within a form. We define a
@@ -1198,14 +1198,8 @@ public define HTML_In_Form @@ -1198,14 +1198,8 @@ public define HTML_In_Form
1198 = file_upload([], "", htmlId(""), name, width). 1198 = file_upload([], "", htmlId(""), name, width).
1199 1199
1200 public define HTML_In_Form 1200 public define HTML_In_Form
1201 - hidden (Maybe(WebArgName) name, InitialValue init)  
1202 - = with web_name =  
1203 - if name is  
1204 - {  
1205 - failure then "",  
1206 - success(w_name) then  
1207 - if w_name is wan(the_w_name) then the_w_name  
1208 - }, 1201 + hidden (WebArgName name, InitialValue init)
  1202 + = if name is wan(web_name) then
1209 hidden(htmlId(web_name), name, init). 1203 hidden(htmlId(web_name), name, init).
1210 1204
1211 public type HTML_Body:... 1205 public type HTML_Body:...
@@ -3976,13 +3970,7 @@ define Printable_tree @@ -3976,13 +3970,7 @@ define Printable_tree
3976 format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https), 3970 format(cinfo,sn,ic_v,any_private_download(url,name,extra,action),format_element,is_https),
3977 text_input(options, label_text, id, name, i, w) then 3971 text_input(options, label_text, id, name, i, w) then
3978 [ maybe_label(label_text, id), 3972 [ maybe_label(label_text, id),
3979 - "<input type=\"text\"", if name is  
3980 - {  
3981 - failure then [""],  
3982 - success(the_name) then [" name=\"",the_name,"\""]  
3983 - },  
3984 - " id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs(options)," />"],  
3985 - 3973 + "<input type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs(options)," />"],
3986 text_input_ro(options, label_text, id, name,i,w) then 3974 text_input_ro(options, label_text, id, name,i,w) then
3987 [ maybe_label(label_text, id), 3975 [ maybe_label(label_text, id),
3988 "<input readonly=\"readonly\" type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs(options)," />"], 3976 "<input readonly=\"readonly\" type=\"text\" name=\"",name,"\" id=\"",id,"\" size=\"",w,"\" value=\"",i,"\"",format_attrs(options)," />"],
@@ -4024,12 +4012,7 @@ define Printable_tree @@ -4024,12 +4012,7 @@ define Printable_tree
4024 div_empty(options) then 4012 div_empty(options) then
4025 format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https), 4013 format(cinfo,sn,ic_v,any_div_empty(options),format_element,is_https),
4026 hidden(id, name, value) then 4014 hidden(id, name, value) then
4027 - ["<input type=\"hidden\" id=\"",id,"\"",  
4028 - if name is  
4029 - {  
4030 - failure then [""],  
4031 - success(the_name) then [" name=\"",the_name,"\""]  
4032 - }, " value=\"",value,"\" />"], 4015 + ["<input type=\"hidden\" id=\"",id,"\" name=\"",name,"\" value=\"",value,"\" />"],
4033 4016
4034 }. 4017 }.
4035 4018