button.anubis
4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
* Created by PyramIDE.
* User: フランスのトトロ & Juju
* Date: 18/04/2015
* Time: 20:46
* © Calexium
*/
read calexium_lib/web/CXM_making_a_web_site.anubis
read calexium_lib/web/CXM_jquery.anubis
read calexium_lib/web/js_tools.anubis
read tools/basis.anubis
public define String icn16_cross = "icons/16x16/cross.png".
public define String icn16_edit = "icons/16x16/edit.png".
public define String icn16_check = "icons/16x16/check.png".
public define String icn16_phone = "icons/16x16/phone.png".
public define String icn16_locked = "icons/16x16/locked.png".
public define HTML_Partial_Content
img_button_flink
(
String img_path,
Actioner_Target target,
String url
)=
partial_content(foreign_link_new(target, img_link(img_path, ""), url)).
public define HTML_Partial_Content
img_button_flink
(
String img_path,
String url
)=
img_button_flink(img_path, same, url).
public define HTML_Partial_Content
img_button
(
String img_path,
Actioner_Target target,
String url,
List((String, String)) extra_ops
)=
partial_content(actioner(same, same, img_link(img_path, ""), url, extra_ops)).
public define HTML_Partial_Content
img_button
(
String img_path,
String url
)=
img_button(img_path, same, url, []).
public define HTML_Partial_Content
img_button
(
String img_path,
String url,
List((String, String)) extra_ops
)=
img_button(img_path, same, url, extra_ops).
define inline String
img_button_confirm_js
(
String uid,
String dlg_title,
String dlg_text,
String dlg_ok,
String dlg_cancel
) =
"CalexiumToolBox.data.confirm_dialog[" + to_js_string(uid) + "] = " +
"{ title: " + to_js_string(dlg_title) +
", text: " + to_js_string(dlg_text) +
", ok : " + to_js_string(dlg_ok) +
", cancel: " + to_js_string(dlg_cancel) +
"};".
define List(CoreAttrs)
img_button_confirm_image_attrs
(
List(CoreAttrs) core_attrs,
String uid,
JQuery_Actioner actioner
) =
core_attrs + [id(uid), style("cursor: pointer"), event(onclick, "CalexiumToolBox.make_confirm_dialog(this, "/* + to_js_string("/?a=" + url + format_extra_operands(extra_ops))+*/+ to_js_string(jquery_button_get_onclick_action(actioner)) +");")].
public define HTML_Partial_Content
img_button_confirm
(
String img_path,
List(CoreAttrs) core_attrs,
String dlg_title,
String dlg_text,
String dlg_ok,
String dlg_cancel,
JQuery_Actioner actioner
)=
with uid = generate_random_string(20),
partial_content([js(js_file("js/cxm/cxm.js")), js_inline(jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)))],
image(img_button_confirm_image_attrs(core_attrs, uid, actioner), img_path, "")).
public define HTML_Partial_Content
img_button_confirm
(
String img_path,
String dlg_title,
String dlg_text,
String dlg_ok,
String dlg_cancel,
JQuery_Actioner actioner
)=
img_button_confirm(img_path, [], dlg_title, dlg_text, dlg_ok, dlg_cancel, actioner).
public define String
img_button_confirm
(
String img_path,
List(CoreAttrs) core_attrs,
String dlg_title,
String dlg_text,
String dlg_ok,
String dlg_cancel,
JQuery_Actioner actioner
) =
with uid = generate_random_string(20),
"<script type=\"text/javascript\">" + jquery_ready(img_button_confirm_js(uid, dlg_title, dlg_text, dlg_ok, dlg_cancel)) + "</script>" +
"<img " + format_attrs(img_button_confirm_image_attrs(core_attrs, uid, actioner)) + " src=\"" + img_path + "\"></img>".
public define String
img_button_confirm
(
String img_path,
String dlg_title,
String dlg_text,
String dlg_ok,
String dlg_cancel,
JQuery_Actioner actioner
)=
img_button_confirm(img_path, [], dlg_title, dlg_text, dlg_ok, dlg_cancel, actioner).