dropzone.anubis
1.76 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
Make use of the DropzoneJS library (www.dropzonejs.com) to build highly customizable dropzones that provides drag’n’drop file uploads with image previews
TODO:
Complete dropzone options and features binding
Authors: Julien Verneuil (06/04/2016)
David René (2017/08/12)
read tools/basis.anubis
read system/string.anubis
read xlib/web/making_a_web_site.anubis
read xlib/web/jquery.anubis
public define HTML
dropzone
(
String dropzone_form_name,
String dict_default_message,
String dict_file_too_big,
String param_name,
String init,
WEB_Action_Name submit_action,
List((String,String)) extra_ops,
) =
with dropzone_form_id = to_lower(dropzone_form_name+"_"+generate_random_string(15)),
head_tags(
[ js(js_file("xlib/js/dropzone.js")),
css(css_file("xlib/css/dropzone.css")),
js_script("
Dropzone.options." + to_Camel_case(dropzone_form_id) + " = {
dictDefaultMessage : \"" + dict_default_message + "\",
dictFileTooBig : \"" + dict_file_too_big + "\",
timeout : 864000,
paramName : \"" + param_name +
( if init = "" then
"\""
else
"\",
init: "+init
)+"
};
$('#"+dropzone_form_id+"').dropzone(); "
)
],
form([id(dropzone_form_id), class("dropzone"), action(submit_action, extra_ops)])
)
.
public define HTML
dropzone
(
String dropzone_form_name,
String dict_default_message,
String dict_file_too_big,
String param_name,
WEB_Action_Name submit_action
)=
dropzone(dropzone_form_name, dict_default_message, dict_file_too_big, param_name, "", submit_action, [])
.