Commit 095da71b9047328df7dc9476b35d0bc436fc704f

Authored by totoro
2 parents 6fe1d581 56fa599f

Merge branch 'release/ANUBIS_1_14' of ssh://gitlab.calexium.com:33022/calexium/c…

…alexium_lib into release/ANUBIS_1_14

Conflicts:
	web/CXM_form.anubis
database/db_types.anubis
@@ -35,6 +35,17 @@ public define String @@ -35,6 +35,17 @@ public define String
35 none then "none", 35 none then "none",
36 db_id(_idx) then abs_to_decimal(_idx) 36 db_id(_idx) then abs_to_decimal(_idx)
37 }. 37 }.
  38 +
  39 +public define Int
  40 + to_Int
  41 + (
  42 + DB_id idx
  43 + )=
  44 + if idx is
  45 + {
  46 + none then (Int)-1,
  47 + db_id(_idx) then _idx
  48 + }.
38 49
39 public define String 50 public define String
40 to_String 51 to_String
database/vtm/view_table_manager.anubis
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 */ 6 */
7 7
8 read tools/basis.anubis 8 read tools/basis.anubis
9 -read calexium_lib/database/vtm/view_table_types.anubis  
10 -read calexium_lib/database/vtm/view_table_manager_types.anubis 9 +transmit calexium_lib/database/vtm/view_table_types.anubis
  10 +transmit calexium_lib/database/vtm/view_table_manager_types.anubis
11 11
12 public define Maybe(VTM_view) 12 public define Maybe(VTM_view)
13 _vtm_get_view 13 _vtm_get_view
@@ -84,3 +84,28 @@ public define Maybe(TM_writer) @@ -84,3 +84,28 @@ public define Maybe(TM_writer)
84 TM_writer_list tm_wlist 84 TM_writer_list tm_wlist
85 ) = 85 ) =
86 _tm_get_writer(table_name, tm_wlist.list). 86 _tm_get_writer(table_name, tm_wlist.list).
  87 +
  88 +public define Maybe((SQLite3DataBase db, List(Int) l_int) -> Maybe(One))
  89 + _tm_get_delete
  90 + (
  91 + String table_name,
  92 + List(TM_delete) list
  93 + ) =
  94 + if list is
  95 + {
  96 + [] then failure,
  97 + [ h . t ] then
  98 + since h is tm_delete(tb_name, delete_func),
  99 + if tb_name = table_name then
  100 + success(delete_func)
  101 + else
  102 + _tm_get_delete(table_name, t)
  103 + }.
  104 +
  105 +public define Maybe((SQLite3DataBase db, List(Int) l_int) -> Maybe(One))
  106 + tm_get_delete
  107 + (
  108 + String table_name,
  109 + TM_delete_list tm_dlist
  110 + ) =
  111 + _tm_get_delete(table_name, tm_dlist.list).
database/vtm/view_table_manager_types.anubis
@@ -21,6 +21,11 @@ public type TM_writer: @@ -21,6 +21,11 @@ public type TM_writer:
21 public type TM_writer_list: 21 public type TM_writer_list:
22 tm_writer_list(List(TM_writer) list). 22 tm_writer_list(List(TM_writer) list).
23 23
  24 +public type TM_delete:
  25 + tm_delete(String table_name, (SQLite3DataBase db, List(Int) l_int) -> Maybe(One) delete).
  26 +
  27 +public type TM_delete_list:
  28 + tm_delete_list(List(TM_delete) list).
24 29
25 public type VTM_view: 30 public type VTM_view:
26 vtm_view(String table_name, (SQLite3DataBase db, String view_name) -> VT_view get_view). 31 vtm_view(String table_name, (SQLite3DataBase db, String view_name) -> VT_view get_view).
@@ -29,4 +34,7 @@ public type VTM_view_list: @@ -29,4 +34,7 @@ public type VTM_view_list:
29 vtm_view_list(List(VTM_view) list). 34 vtm_view_list(List(VTM_view) list).
30 35
31 public type VTM: 36 public type VTM:
32 - vtm(VTM_view_list view_list, VTM_edit_list edit_list, TM_writer_list writer_list). 37 + vtm(VTM_view_list view_list,
  38 + VTM_edit_list edit_list,
  39 + TM_writer_list writer_list,
  40 + TM_delete_list delete_list).
database/vtm/view_table_renderer.anubis
@@ -20,13 +20,16 @@ read system/convert.anubis @@ -20,13 +20,16 @@ read system/convert.anubis
20 //read utils.anubis 20 //read utils.anubis
21 read locale/L3LanguageInfo.anubis 21 read locale/L3LanguageInfo.anubis
22 read calexium_lib/web/CXM_common.anubis 22 read calexium_lib/web/CXM_common.anubis
  23 +read calexium_lib/web/CXM_web_arg_utils.anubis
23 read calexium_lib/web/CXM_making_a_web_site.anubis 24 read calexium_lib/web/CXM_making_a_web_site.anubis
24 read calexium_lib/web/CXM_multihost_http_server.anubis 25 read calexium_lib/web/CXM_multihost_http_server.anubis
25 read calexium_lib/web/jQuery/CXM_jquery_datatable.anubis 26 read calexium_lib/web/jQuery/CXM_jquery_datatable.anubis
26 read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis 27 read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis
  28 +read calexium_lib/web/jQuery/CXM_jquery_dialog.anubis
27 read calexium_lib/web/jQuery/ui-addon/datetimepicker.anubis 29 read calexium_lib/web/jQuery/ui-addon/datetimepicker.anubis
28 read calexium_lib/web/CXM_form.anubis 30 read calexium_lib/web/CXM_form.anubis
29 read calexium_lib/web/widgets/css_helper.anubis 31 read calexium_lib/web/widgets/css_helper.anubis
  32 +read calexium_lib/web/widgets/button.anubis
30 33
31 define CXM_Form_Field 34 define CXM_Form_Field
32 help_line 35 help_line
@@ -76,9 +79,9 @@ public define List(CXM_Form_Field) @@ -76,9 +79,9 @@ public define List(CXM_Form_Field)
76 integer(s_name, c_name, value, help) then 79 integer(s_name, c_name, value, help) then
77 [input(_T(s_name), wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)], 80 [input(_T(s_name), wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)],
78 date(s_name, c_name, value, help) then 81 date(s_name, c_name, value, help) then
79 - [input([class("datepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), narrow, non_mandatory), help_line(help, _T)], 82 + [input([class("datepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), small, non_mandatory), help_line(help, _T)],
80 datetime(s_name, c_name, value, help) then 83 datetime(s_name, c_name, value, help) then
81 - [input([class("datetimepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), narrow, mandatory), help_line(help, _T)], 84 + [input([class("datetimepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), small, mandatory), help_line(help, _T)],
82 }, 85 },
83 edit_form_lines(db, _T, t, reverse(line)+so_far) 86 edit_form_lines(db, _T, t, reverse(line)+so_far)
84 }. 87 }.
@@ -92,15 +95,13 @@ public define HTML_Partial_Content @@ -92,15 +95,13 @@ public define HTML_Partial_Content
92 List(Web_arg) lwa, 95 List(Web_arg) lwa,
93 VT_edit vt_elist 96 VT_edit vt_elist
94 ) = 97 ) =
95 - //if tb is tool_box(lang, _T, _, _, db, _) then  
96 - with table_name = vt_elist.table_name, 98 + with table_name = vt_elist.table_name,
  99 + with button_name = if get_String(lwa, "id","none") = "none" then _T("CREATE") else _T("UPDATE"),
97 partial_content(jq_datetimepicker_init(lang), 100 partial_content(jq_datetimepicker_init(lang),
98 - partial(html_wave_box(  
99 - _T(to_upper(table_name)),  
100 cxm_form( table_name, htmlId(table_name), lwa, 101 cxm_form( table_name, htmlId(table_name), lwa,
101 edit_form_lines(db, _T, vt_elist.list, [])+ 102 edit_form_lines(db, _T, vt_elist.list, [])+
102 - [ submit("create", failure, _T("CREATE"), [("table_name", table_name)]) ]  
103 - )))). 103 + [ submit("create", failure, button_name, [("table_name", table_name)]) ]
  104 + )).
104 105
105 public define Maybe(HTML_Partial_Content) 106 public define Maybe(HTML_Partial_Content)
106 edit_table_content 107 edit_table_content
@@ -125,41 +126,48 @@ public define Maybe(HTML_Partial_Content) @@ -125,41 +126,48 @@ public define Maybe(HTML_Partial_Content)
125 // View table part 126 // View table part
126 define HTML_Row(HTML_Off_Form) make_line 127 define HTML_Row(HTML_Off_Form) make_line
127 ( 128 (
128 - //ToolBox tb,  
129 String table_name, 129 String table_name,
130 String action_name, //default is "edit_table", but can be surcharged for own use 130 String action_name, //default is "edit_table", but can be surcharged for own use
131 List(VT_view_entry) entries, 131 List(VT_view_entry) entries,
132 - List(HTML_Cell(HTML_Off_Form)) so_far,  
133 - Int odd_even 132 + List(HTML_Cell(HTML_Off_Form)) so_far
134 )= 133 )=
135 if entries is 134 if entries is
136 { 135 {
137 - [] then  
138 - with line = if odd_even = 0 then "tr_even" else "tr_odd",  
139 - row( [core_attrs([class(line)])], reverse(so_far)), 136 + [] then row( [], reverse(so_far)),
140 [h . t] then 137 [h . t] then
141 with cell = if h is 138 with cell = if h is
142 { 139 {
143 text(string) then cell((HTML_Off_Form)text(string)), 140 text(string) then cell((HTML_Off_Form)text(string)),
144 - link(id, string) then cell((HTML_Off_Form)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])), 141 +// link(id, string) then cell((HTML_Off_Form)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])),
  142 + link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(action_name+"_dlg_ajax"), "'id="+id+"'"))),
145 icon(icon_path) then cell((HTML_Off_Form)image([], icon_path, "")) 143 icon(icon_path) then cell((HTML_Off_Form)image([], icon_path, ""))
146 }, 144 },
147 - make_line(table_name, action_name, t, [cell . so_far], odd_even) 145 + make_line(table_name, action_name, t, [cell . so_far])
148 }. 146 }.
149 147
150 -define List(HTML_Row(HTML_Off_Form)) make_lines 148 +define List(HTML_Row(HTML_Off_Form))
  149 + make_lines
151 ( 150 (
152 -// ToolBox tb, 151 + (String) -> String _T, //translator
153 String table_name, 152 String table_name,
154 String action_name, 153 String action_name,
155 List(VT_view_row) entries, 154 List(VT_view_row) entries,
156 - List(HTML_Row(HTML_Off_Form)) so_far,  
157 - Int odd_even 155 + List(HTML_Row(HTML_Off_Form)) so_far
158 )= 156 )=
159 if entries is 157 if entries is
160 { 158 {
161 [] then reverse(so_far), 159 [] then reverse(so_far),
162 - [h . t] then make_lines(table_name, action_name, t, [make_line(table_name, action_name, h.list, [], odd_even). so_far], 1 - odd_even ) 160 + [h . t] then
  161 + //compute each line
  162 + //prepare here the first cell for actioner
  163 + with actions_cell = (HTML_Cell(HTML_Off_Form))
  164 + cell([],
  165 + sequence([
  166 + partial(img_button_confirm(icn16_cross, _T("CONFIRMATION_REQUEST"), _T("CONFIRM_LINE_DELETION") , _T("OK"), _T("CANCEL"), jQuery_actioner(same, jqlink, "hk_del_row" + format_extra_operands([("table_name", table_name),("id",to_String(h.db_id))])))),
  167 + partial(img_button(icn16_edit, [event(onclick, jq_dialog_open(dialog_id(action_name+"_dlg_ajax"), "'id="+to_String(h.db_id)+"'"))], "", [])),
  168 + ])
  169 + ),
  170 + make_lines(_T, table_name, action_name, t, [make_line(table_name, action_name, h.list, [actions_cell]). so_far] )
163 }. 171 }.
164 172
165 // View table part 173 // View table part
@@ -170,7 +178,6 @@ define HTML_Header_Row(HTML_Off_Form) @@ -170,7 +178,6 @@ define HTML_Header_Row(HTML_Off_Form)
170 List(VT_view_entry) entries, 178 List(VT_view_entry) entries,
171 List(HTML_Header_Cell(HTML_Off_Form)) so_far 179 List(HTML_Header_Cell(HTML_Off_Form)) so_far
172 )= 180 )=
173 - //if tb is tool_box(lang, _T, _, _, db, _) then  
174 if entries is 181 if entries is
175 { 182 {
176 [] then header_row( [], reverse(so_far)), 183 [] then header_row( [], reverse(so_far)),
@@ -184,20 +191,26 @@ define HTML_Header_Row(HTML_Off_Form) @@ -184,20 +191,26 @@ define HTML_Header_Row(HTML_Off_Form)
184 make_header(_T, t, [cell . so_far]) 191 make_header(_T, t, [cell . so_far])
185 }. 192 }.
186 193
  194 +
187 195
188 -public define HTML_Partial_Content view_table_form 196 +public define HTML_Partial_Content
  197 + view_table_form
189 ( 198 (
190 (String) -> String _T, 199 (String) -> String _T,
191 String action_name, 200 String action_name,
192 VT_view rows 201 VT_view rows
193 )= 202 )=
194 - //if tb is tool_box(_, _T, _, _, db, _) then  
195 - partial_content(div( [class("tableau")], 203 + with action_header_cell = header_cell((HTML_Off_Form)text(_T("ACTION"))),
  204 + partial_content(
  205 + div( [/*class("tableau")*/],
196 sequence( 206 sequence(
197 [ actioner(same,same, link([class("my_button")],_T("NEW")),"edit_table",[("table_name", rows.table_name)]), 207 [ actioner(same,same, link([class("my_button")],_T("NEW")),"edit_table",[("table_name", rows.table_name)]),
198 - table([core_attrs([id("table_view"), class("display compact nowrap")])],  
199 - make_header(_T, rows.header.list, []),  
200 - make_lines(rows.table_name, action_name, rows.list, [], 0)) 208 + //dialog used by datatable entries
  209 + partial(jq_dialog_create(dialog_id("edit_table_dlg_ajax"), ajax("?a=ajax_edit_table&table_name="+rows.table_name))),
  210 +
  211 + table([core_attrs([id("table_view"), class("tableau display compact nowrap")])],
  212 + make_header(_T, rows.header.list, [action_header_cell]),
  213 + make_lines(_T, rows.table_name, action_name, rows.list, []))
201 ] 214 ]
202 ) 215 )
203 )) 216 ))
@@ -216,9 +229,9 @@ public define HTML_Partial_Content @@ -216,9 +229,9 @@ public define HTML_Partial_Content
216 // if tb is tool_box(lang, _T, _, _, db, _) then 229 // if tb is tool_box(lang, _T, _, _, db, _) then
217 // println("view_table_page - lang : "+lang); 230 // println("view_table_page - lang : "+lang);
218 // println("view_table_page - web_site_directory : "+web_site_directory); 231 // println("view_table_page - web_site_directory : "+web_site_directory);
219 - partial_content(  
220 - [html_wave_box_wide(_T(to_upper(rows.table_name)),  
221 - jquery_datatable("table_view", view_table_form(_T, action_name, rows), true, false, jq_dt_pt_full_numbers, scrollY(500), true, true, true, lang, no_extra, web_site_directory))]). 232 + partial_content(jq_dialog_init + jq_datetimepicker_init(lang),
  233 + [partial(html_wave_box_wide(_T(to_upper(rows.table_name)),
  234 + jquery_datatable("table_view", view_table_form(_T, action_name, rows), true, false, jq_dt_pt_full_numbers, scrollY(500), true, true, true, lang, no_extra, web_site_directory)))]).
222 235
223 public define Maybe(HTML_Partial_Content) 236 public define Maybe(HTML_Partial_Content)
224 view_table_content 237 view_table_content
database/vtm/view_table_types.anubis
@@ -38,12 +38,15 @@ public type VT_view_entry: @@ -38,12 +38,15 @@ public type VT_view_entry:
38 text(String text), 38 text(String text),
39 link(String id, String text), 39 link(String id, String text),
40 icon(String icon_path). 40 icon(String icon_path).
  41 +
  42 +public type VT_view_row_header:
  43 + vt_view_row_header(List(VT_view_entry) list).
41 44
42 public type VT_view_row: 45 public type VT_view_row:
43 - vt_view_row(List(VT_view_entry) list). 46 + vt_view_row(Int db_id, List(VT_view_entry) list).
44 47
45 public type VT_view: 48 public type VT_view:
46 - vt_view(String table_name, String view_name, VT_view_row header, List(VT_view_row) list). 49 + vt_view(String table_name, String view_name, VT_view_row_header header, List(VT_view_row) list).
47 50
48 51
49 public type VT_action: 52 public type VT_action:
mail/send_mail.anubis
@@ -210,7 +210,7 @@ public define Result(SmtpClientResult, One) @@ -210,7 +210,7 @@ public define Result(SmtpClientResult, One)
210 ) = 210 ) =
211 send_mail(conn, 211 send_mail(conn,
212 param, 212 param,
213 - (SmtpClientSession sm_session, Send_Param param) |-> ok(param), 213 + (SmtpClientSession sm_session, Send_Param parameter) |-> ok(parameter),
214 handle_result 214 handle_result
215 ). 215 ).
216 216
web/CXM_common.anubis
@@ -2,12 +2,15 @@ @@ -2,12 +2,15 @@
2 *Project* The Anubis Project 2 *Project* The Anubis Project
3 *Title* Some common stuff for the web. 3 *Title* Some common stuff for the web.
4 4
5 - *Copyright* Copyright (c) Alain Prouté 2003. 5 + *Copyright*
  6 + Copyright (c) Alain Prouté 2003~2007.
  7 + © Calexium 2007~2016
6 8
7 9
8 -  
9 - *Author* Alain Prouté  
10 - 10 + *Authors:*
  11 + Alain Prouté
  12 + David René
  13 +
11 *Public* 14 *Public*
12 *Name* HTTP_header 15 *Name* HTTP_header
13 *Description* 16 *Description*
web/CXM_form.anubis
@@ -142,6 +142,14 @@ public type CXM_Form_Field: @@ -142,6 +142,14 @@ public type CXM_Form_Field:
142 WebArgValue web_arg_value, 142 WebArgValue web_arg_value,
143 Bool checked, 143 Bool checked,
144 Mandatory mandatory), 144 Mandatory mandatory),
  145 + //radio_button_hide_show
  146 + radio_button_hide_show(
  147 + List(InputAttrs) options,
  148 + String label,
  149 + WebArgName web_arg_name,
  150 + WebArgValue web_arg_value,
  151 + Bool checked,
  152 + List(CXM_Form_Field) fields),
145 // the same one, but with the tag on the right of the radio_button 153 // the same one, but with the tag on the right of the radio_button
146 radio_buttonr (List(InputAttrs) options, 154 radio_buttonr (List(InputAttrs) options,
147 String label, 155 String label,
@@ -408,12 +416,19 @@ public define HTML_In_Form @@ -408,12 +416,19 @@ public define HTML_In_Form
408 checkbox_hide_show(options, label, wan, val, checked, fields) then 416 checkbox_hide_show(options, label, wan, val, checked, fields) then
409 with div_id = generate_random_string(15), 417 with div_id = generate_random_string(15),
410 sequence([ 418 sequence([
411 - check_box([event(onclick, "checkbox_hide_show_element('"+div_id+"', this);")], label, htmlId(""), wan, val, get_Bool(lwa, wan.name, checked)), 419 + check_box([class("in"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], label, htmlId(""), wan, val, get_Bool(lwa, wan.name, checked)),
412 div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], cxm_format_form_field(ff2, lwa)),fields))) 420 div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], cxm_format_form_field(ff2, lwa)),fields)))
413 ]), 421 ]),
414 422
415 radio_button(options, label, id, wan, val, checked, mand) then 423 radio_button(options, label, id, wan, val, checked, mand) then
416 - radio_button([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), 424 + radio_button([class("in"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)),
  425 +
  426 + radio_button_hide_show(options, label, wan, val, checked, fields) then
  427 + with div_id = generate_random_string(15),
  428 + sequence([
  429 + radio_button([data("show_id", div_id), class("in"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);")], label, htmlId(""), wan, val, get_Bool(lwa, wan.name, checked)),
  430 + div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], cxm_format_form_field(ff2, lwa)),fields)))
  431 + ]),
417 432
418 radio_buttonr(options, label, id, wan, val, checked, mand) then 433 radio_buttonr(options, label, id, wan, val, checked, mand) then
419 radio_button_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)), 434 radio_button_r([class("in") . options], label + star(mand), id, wan, val, get_Bool(lwa, wan.name, checked)),
web/CXM_making_a_web_site.anubis
@@ -753,6 +753,7 @@ public type CoreAttrs: @@ -753,6 +753,7 @@ public type CoreAttrs:
753 public define CoreAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false"). 753 public define CoreAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false").
754 754
755 public type InputAttrs: 755 public type InputAttrs:
  756 + id (String),
756 class (String), 757 class (String),
757 style (String), 758 style (String),
758 title (String), 759 title (String),
@@ -761,7 +762,9 @@ public type InputAttrs: @@ -761,7 +762,9 @@ public type InputAttrs:
761 accesskey (Word8), 762 accesskey (Word8),
762 tabindex (Int), 763 tabindex (Int),
763 attr (String, String), 764 attr (String, String),
764 - event (HtmlEvents, String). 765 + event (HtmlEvents, String),
  766 + //HTML5
  767 + data (String name, String value).
765 768
766 public define InputAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false"). 769 public define InputAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false").
767 770
@@ -3225,6 +3228,8 @@ define String @@ -3225,6 +3228,8 @@ define String
3225 [h . t] then 3228 [h . t] then
3226 with current = if h is 3229 with current = if h is
3227 { 3230 {
  3231 + id(id_name) then
  3232 + " id=\"" + id_name + "\"",
3228 class(class_name) then 3233 class(class_name) then
3229 format_attrs(t, [class_name. classes], styles), 3234 format_attrs(t, [class_name. classes], styles),
3230 style(style_string) then 3235 style(style_string) then
@@ -3251,6 +3256,8 @@ define String @@ -3251,6 +3256,8 @@ define String
3251 3256
3252 event(e, value) then 3257 event(e, value) then
3253 " " + event_name(e) + "=\"" + value + "\"", 3258 " " + event_name(e) + "=\"" + value + "\"",
  3259 + data(name, value) then
  3260 + " data-" + to_lower(name) + "=\"" + value + "\"",
3254 }, 3261 },
3255 current + format_attrs(t, classes, styles) 3262 current + format_attrs(t, classes, styles)
3256 }. 3263 }.
@@ -3457,10 +3464,17 @@ define Printable_tree @@ -3457,10 +3464,17 @@ define Printable_tree
3457 "</a>" 3464 "</a>"
3458 ], 3465 ],
3459 img_link(options, img, alt_text) then 3466 img_link(options, img, alt_text) then
3460 - [  
3461 - "<a href=\"", url,"\"", format_attrs(options),"><img src=\"", img,  
3462 - "\" alt=\"" + alt_text + "\" border=\"0\"></a>"  
3463 - ], 3467 + //if action name is empty, format options on image because maybe there onclick action
  3468 + if action_name ="" then
  3469 + [
  3470 + "<img src=\"", img,"\"",
  3471 + format_attrs(options)," alt=\"" + alt_text + "\" border=\"0\">"
  3472 + ]
  3473 + else
  3474 + [
  3475 + "<a href=\"", url,"\"", format_attrs(options),"><img src=\"", img,
  3476 + "\" alt=\"" + alt_text + "\" border=\"0\"></a>"
  3477 + ],
3464 push_button(options, text) then 3478 push_button(options, text) then
3465 [ 3479 [
3466 if action is 3480 if action is
web/CXM_multihost_http_server.anubis
@@ -3220,8 +3220,8 @@ define One @@ -3220,8 +3220,8 @@ define One
3220 3220
3221 if get_socket_from_connection(conn(connection)) is 3221 if get_socket_from_connection(conn(connection)) is
3222 { 3222 {
3223 - failure then println("can't get socket"),  
3224 - success(source) then 3223 + failure then println("can't get socket"),
  3224 + success(socket_type) then
3225 3225
3226 with tmp_body_file = "/temp/" + virtual_machine_id + "-" + now, 3226 with tmp_body_file = "/temp/" + virtual_machine_id + "-" + now,
3227 if (Maybe(RWStream))file(desc.site_directory + tmp_body_file, new) is 3227 if (Maybe(RWStream))file(desc.site_directory + tmp_body_file, new) is
@@ -3238,18 +3238,37 @@ define One @@ -3238,18 +3238,37 @@ define One
3238 { 3238 {
3239 failure then println("Can't flush the buffer"), 3239 failure then println("Can't flush the buffer"),
3240 success(_) then 3240 success(_) then
3241 - if copy_file(weaken(source), weaken(target), body_size - buffer_size) is copy_ok(read_size) then  
3242 -  
3243 - with duration = (UTime) unow - t0,  
3244 - println("Read body "+read_size+" duration: " + __utime_to_string(duration));  
3245 -  
3246 - multipart_form_data_answer(host_name, desc, connection.conn, ip_addr, rqline2, headers, desc.site_directory + tmp_body_file, generate_tt, s);  
3247 -  
3248 - //it's HTTP 1.1 keep-alive is default  
3249 - http_https_handler(sites, connection, is_https, dos, s)  
3250 -  
3251 - else  
3252 - println("Can't copy data from stream to temporary file ") 3241 + if socket_type is
  3242 + {
  3243 + tcp_socket(source) then
  3244 +
  3245 + if copy_file(weaken(source), weaken(target), body_size - buffer_size) is copy_ok(read_size) then
  3246 +
  3247 + with duration = (UTime) unow - t0,
  3248 + println("Read body "+read_size+" duration: " + __utime_to_string(duration));
  3249 +
  3250 + multipart_form_data_answer(host_name, desc, connection.conn, ip_addr, rqline2, headers, desc.site_directory + tmp_body_file, generate_tt, s);
  3251 +
  3252 + //it's HTTP 1.1 keep-alive is default
  3253 + http_https_handler(sites, connection, is_https, dos, s)
  3254 +
  3255 + else
  3256 + println("Can't copy data from stream to temporary file "),
  3257 +
  3258 + ssl_socket(source) then
  3259 + if copy_file(source, weaken(target), body_size - buffer_size) is copy_ok(read_size) then
  3260 +
  3261 + with duration = (UTime) unow - t0,
  3262 + println("Read body "+read_size+" duration: " + __utime_to_string(duration));
  3263 +
  3264 + multipart_form_data_answer(host_name, desc, connection.conn, ip_addr, rqline2, headers, desc.site_directory + tmp_body_file, generate_tt, s);
  3265 +
  3266 + //it's HTTP 1.1 keep-alive is default
  3267 + http_https_handler(sites, connection, is_https, dos, s)
  3268 +
  3269 + else
  3270 + println("Can't copy data from stream to temporary file ")
  3271 + }
3253 }}} 3272 }}}
3254 else 3273 else
3255 println("body_size = 0 !") 3274 println("body_size = 0 !")
web/CXM_web_arg_utils.anubis
@@ -30,6 +30,7 @@ public define DB_id @@ -30,6 +30,7 @@ public define DB_id
30 success(_value) then db_id(_value) 30 success(_value) then db_id(_value)
31 } 31 }
32 }. 32 }.
  33 +
33 public define Maybe(DB_date) 34 public define Maybe(DB_date)
34 get_DB_date 35 get_DB_date
35 ( 36 (
@@ -225,10 +226,10 @@ public define Maybe(Word32) @@ -225,10 +226,10 @@ public define Maybe(Word32)
225 ) = 226 ) =
226 if get_Word32(lwa, name) is 227 if get_Word32(lwa, name) is
227 { 228 {
228 - failure then /*logDebug(debug_log, "Can't convert argument '" + name + "' to integer.");*/ failure 229 + failure then failure
229 success(value) then 230 success(value) then
230 if value +< min | value >+ max then 231 if value +< min | value >+ max then
231 - /*logDebug(debug_log, "The entered value (" + val + ")is out of boundaries [" + min + "," + max + "].");*/ failure 232 + failure
232 else 233 else
233 success(value) 234 success(value)
234 }. 235 }.
@@ -270,10 +271,10 @@ public define Maybe(Word8) @@ -270,10 +271,10 @@ public define Maybe(Word8)
270 ) = 271 ) =
271 if get_Word8(lwa, name) is 272 if get_Word8(lwa, name) is
272 { 273 {
273 - failure then /*logDebug(debug_log, "Can't convert argument '" + name + "' to integer.");*/ failure 274 + failure then failure
274 success(value) then 275 success(value) then
275 if value +< min | value >+ max then 276 if value +< min | value >+ max then
276 - /*logDebug(debug_log, "The entered value (" + val + ")is out of boundaries [" + min + "," + max + "].");*/ failure 277 + failure
277 else 278 else
278 success(value) 279 success(value)
279 }. 280 }.
web/jQuery/CXM_jquery_dialog.anubis
@@ -100,7 +100,25 @@ public define String @@ -100,7 +100,25 @@ public define String
100 String params 100 String params
101 )= 101 )=
102 _jq_dialog_open(success(html), dialog_id, params). 102 _jq_dialog_open(success(html), dialog_id, params).
103 - 103 +
  104 +public define HTML_Partial_Content
  105 + jq_dialog_open
  106 + (
  107 + String html,
  108 + JQuery_dialog_id dialog_id,
  109 + String params
  110 + )=
  111 + partial_content([],
  112 + literal(_jq_dialog_open(success(html), dialog_id, params))).
  113 +
  114 +public define String
  115 + jq_dialog_open
  116 + (
  117 + JQuery_dialog_id dialog_id,
  118 + String params
  119 + )=
  120 + _jq_dialog_open(failure, dialog_id, params).
  121 +
104 public define String 122 public define String
105 jq_dialog_open 123 jq_dialog_open
106 ( 124 (
web/widgets/button.anubis
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 */ 7 */
8 8
9 read calexium_lib/web/CXM_making_a_web_site.anubis 9 read calexium_lib/web/CXM_making_a_web_site.anubis
10 -read calexium_lib/web/CXM_jquery.anubis 10 +transmit calexium_lib/web/CXM_jquery.anubis
11 read calexium_lib/web/CXM_json.anubis 11 read calexium_lib/web/CXM_json.anubis
12 read calexium_lib/web/js_tools.anubis 12 read calexium_lib/web/js_tools.anubis
13 transmit calexium_lib/web/widgets/icons_set.anubis 13 transmit calexium_lib/web/widgets/icons_set.anubis
@@ -51,7 +51,7 @@ public define HTML_Partial_Content @@ -51,7 +51,7 @@ public define HTML_Partial_Content
51 String url, 51 String url,
52 List((String, String)) extra_ops 52 List((String, String)) extra_ops
53 )= 53 )=
54 - partial_content(actioner(same, same, img_link(core_attrs, img_path, ""), url, extra_ops)). 54 + partial_content(actioner(same, same, img_link(core_attrs+[style("cursor: pointer")], img_path, ""), url, extra_ops)).
55 55
56 public define HTML_Partial_Content 56 public define HTML_Partial_Content
57 img_button 57 img_button