Commit 98449484785de8f4ebcb9bff5a0df11cac1e07fe
1 parent
9d0e15c5
add some helpers for fieldset
Showing
2 changed files
with
35 additions
and
9 deletions
Show diff stats
web/CXM_form.anubis
| @@ -202,6 +202,7 @@ public type CXM_Form_Field: | @@ -202,6 +202,7 @@ public type CXM_Form_Field: | ||
| 202 | HTML_In_Form input), | 202 | HTML_In_Form input), |
| 203 | div (List(CoreAttrs), HTML_In_Form content), | 203 | div (List(CoreAttrs), HTML_In_Form content), |
| 204 | partial (HTML_Partial_Content p_content), | 204 | partial (HTML_Partial_Content p_content), |
| 205 | + br, | ||
| 205 | input_with_help (CXM_Form_Field field, | 206 | input_with_help (CXM_Form_Field field, |
| 206 | Maybe(String) help_title, | 207 | Maybe(String) help_title, |
| 207 | String help_text, | 208 | String help_text, |
| @@ -540,7 +541,7 @@ public define HTML_In_Form | @@ -540,7 +541,7 @@ public define HTML_In_Form | ||
| 540 | div(options, e) then div(options, e), | 541 | div(options, e) then div(options, e), |
| 541 | 542 | ||
| 542 | partial(p_content) then partial(p_content), | 543 | partial(p_content) then partial(p_content), |
| 543 | - | 544 | + br then br, |
| 544 | input_with_help(input, help_title, help_text, width) then | 545 | input_with_help(input, help_title, help_text, width) then |
| 545 | sequence([ | 546 | sequence([ |
| 546 | format_CXM_Form_Field(input, lwa), | 547 | format_CXM_Form_Field(input, lwa), |
| @@ -583,6 +584,31 @@ public define HTML_In_Form | @@ -583,6 +584,31 @@ public define HTML_In_Form | ||
| 583 | )= | 584 | )= |
| 584 | sequence( map((CXM_Form_Field ff) |-> div([class("form_field aligned")], format_CXM_Form_Field(ff, lwa)), fields) ). | 585 | sequence( map((CXM_Form_Field ff) |-> div([class("form_field aligned")], format_CXM_Form_Field(ff, lwa)), fields) ). |
| 585 | 586 | ||
| 587 | +public define HTML_In_Form | ||
| 588 | + fieldset | ||
| 589 | + ( | ||
| 590 | + List(Web_arg) lwa, | ||
| 591 | + List(CXM_Form_Field) fields, | ||
| 592 | + )= | ||
| 593 | + sequence( map((CXM_Form_Field ff) |-> div([class("form_field aligned")], format_CXM_Form_Field(ff, lwa)), fields) ). | ||
| 594 | + | ||
| 595 | +public define HTML_In_Form | ||
| 596 | + fieldset | ||
| 597 | + ( | ||
| 598 | + List(Web_arg) lwa, | ||
| 599 | + CXM_Form_Field field, | ||
| 600 | + )= | ||
| 601 | + div([class("form_field aligned")], format_CXM_Form_Field(field, lwa)). | ||
| 602 | + | ||
| 603 | + | ||
| 604 | +public define HTML_In_Form | ||
| 605 | + fieldset | ||
| 606 | + ( | ||
| 607 | + List(CXM_Form_Field) fields | ||
| 608 | + )= | ||
| 609 | + sequence( map((CXM_Form_Field ff) |-> div([class("form_field aligned")], format_CXM_Form_Field(ff, [])), fields) ). | ||
| 610 | + | ||
| 611 | + | ||
| 586 | public define HTML_Off_Form | 612 | public define HTML_Off_Form |
| 587 | cxm_form | 613 | cxm_form |
| 588 | ( | 614 | ( |
web/CXM_xml_rpc_parser.anubis
| @@ -81,9 +81,9 @@ define Maybe(String) | @@ -81,9 +81,9 @@ define Maybe(String) | ||
| 81 | if b = '<' then //just found the begin bracket, | 81 | if b = '<' then //just found the begin bracket, |
| 82 | if read_byte(stream) is | 82 | if read_byte(stream) is |
| 83 | { | 83 | { |
| 84 | - failure then failure, //can't read on stream !! | ||
| 85 | - success(b) then | ||
| 86 | - if b = '/' then //can't find / => syntax error | 84 | + failure then failure, //can't read on stream !! |
| 85 | + success(_b) then | ||
| 86 | + if _b = '/' then //can't find / => syntax error | ||
| 87 | _xml_tag_content(stream, tag, [], content, false, false, true) | 87 | _xml_tag_content(stream, tag, [], content, false, false, true) |
| 88 | else | 88 | else |
| 89 | failure | 89 | failure |
| @@ -93,9 +93,9 @@ define Maybe(String) | @@ -93,9 +93,9 @@ define Maybe(String) | ||
| 93 | else if in_last_token then | 93 | else if in_last_token then |
| 94 | if b = '>' then //just found the end of bracket, so we return the token in LOWER case | 94 | if b = '>' then //just found the end of bracket, so we return the token in LOWER case |
| 95 | if to_lower(implode(reverse(so_far))) = tag then | 95 | if to_lower(implode(reverse(so_far))) = tag then |
| 96 | - with content = implode(reverse(content)), | ||
| 97 | - println("Tag ["+tag+"] content found ["+content+"]"); | ||
| 98 | - success(content) | 96 | + with _content = implode(reverse(content)), |
| 97 | + println("Tag ["+tag+"] content found ["+_content+"]"); | ||
| 98 | + success(_content) | ||
| 99 | else | 99 | else |
| 100 | failure | 100 | failure |
| 101 | else | 101 | else |
| @@ -470,8 +470,8 @@ public define Maybe(XML_RPC_response) | @@ -470,8 +470,8 @@ public define Maybe(XML_RPC_response) | ||
| 470 | if next_xml_token(stream) is | 470 | if next_xml_token(stream) is |
| 471 | { | 471 | { |
| 472 | none then failure | 472 | none then failure |
| 473 | - token(tok) then | ||
| 474 | - if tok = "methodresponse" then | 473 | + token(_tok) then |
| 474 | + if _tok = "methodresponse" then | ||
| 475 | in_params(stream) | 475 | in_params(stream) |
| 476 | else | 476 | else |
| 477 | failure | 477 | failure |