Commit 6ab65584aded997a514ba961511d85ea74b2ed9b

Authored by totoro
2 parents 561d357f cb05cfeb

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

…alexium_lib into release/ANUBIS_1_14
web/CXM_making_a_web_site.anubis
@@ -4640,7 +4640,10 @@ define Printable_tree @@ -4640,7 +4640,10 @@ define Printable_tree
4640 js(jsf) then 4640 js(jsf) then
4641 [add_js_files([jsf]) . _format_html_head(t, so_far)], 4641 [add_js_files([jsf]) . _format_html_head(t, so_far)],
4642 js_inline(jsi) then 4642 js_inline(jsi) then
4643 - ["<script>"+content(jsi)+"</script>\n" . _format_html_head(t, so_far)], 4643 + if jsi is
  4644 + {
  4645 + script(type, _) then ["<script type=\"" + type + "\">"+content(jsi)+"</script>\n" . _format_html_head(t, so_far)],
  4646 + }
4644 css(cssf) then 4647 css(cssf) then
4645 ["<link rel=\"stylesheet\" type=\"text/css\" href=\""+file_name(cssf)+"\" />\n" . _format_html_head(t, so_far)], 4648 ["<link rel=\"stylesheet\" type=\"text/css\" href=\""+file_name(cssf)+"\" />\n" . _format_html_head(t, so_far)],
4646 css_inline(cssi) then 4649 css_inline(cssi) then
web/js_tools.anubis
@@ -39,6 +39,14 @@ public define String @@ -39,6 +39,14 @@ public define String
39 implode(make_js_string(explode(str), [])). 39 implode(make_js_string(explode(str), [])).
40 40
41 public define String 41 public define String
  42 + to_js_string
  43 + (
  44 + String str
  45 + )
  46 + =
  47 + "'" + str + "'".
  48 +
  49 +public define String
42 format_js_function_call 50 format_js_function_call
43 ( 51 (
44 String name, 52 String name,
web/widgets/button.anubis
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
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
  11 +read calexium_lib/web/js_tools.anubis
10 read tools/basis.anubis 12 read tools/basis.anubis
11 13
12 public define HTML_Partial_Content 14 public define HTML_Partial_Content
@@ -38,12 +40,17 @@ public define HTML_Partial_Content @@ -38,12 +40,17 @@ public define HTML_Partial_Content
38 String url, 40 String url,
39 List((String, String)) extra_ops 41 List((String, String)) extra_ops
40 )= 42 )=
41 - partial_content([js(js_file("js/cxm/cxm.js"))],  
42 - image(core_attrs + [style("cursor: pointer"), event(onclick, "CalexiumToolBox.make_confirm_dialog('" + dlg_title + "',  
43 - '" + dlg_text + "',  
44 - '" + dlg_ok + "',  
45 - '" + dlg_cancel + "',  
46 - '/?a=" + url + format_extra_operands(extra_ops)+"');")], img_path, "")). 43 + with uid = generate_random_string(20),
  44 +
  45 + js_confirm_dialog_data_obj = "CalexiumToolBox.data.confirm_dialog[" + to_js_string(uid) + "]",
  46 + js_data = js_confirm_dialog_data_obj + " = {
  47 + title: " + to_js_string(dlg_title) + ",
  48 + text: " + to_js_string(dlg_text) + ",
  49 + ok : " + to_js_string(dlg_ok) + ",
  50 + cancel: " + to_js_string(dlg_cancel) + "};",
  51 +
  52 + partial_content([js(js_file("js/cxm/cxm.js")), js_inline(jquery_ready(js_data))],
  53 + image(core_attrs + [id(uid), style("cursor: pointer"), event(onclick, "CalexiumToolBox.make_confirm_dialog(this, " + to_js_string("/?a=" + url + format_extra_operands(extra_ops))+");")], img_path, "")).
47 54
48 public define HTML_Partial_Content 55 public define HTML_Partial_Content
49 img_button_confirm 56 img_button_confirm