Commit 44fe5cf143c518b1fe914d60202b58558ef2c5d9
1 parent
314a5090
add CXM_dropzone.anubis
Showing
1 changed file
with
36 additions
and
0 deletions
Show diff stats
| 1 | + Make use of the DropzoneJS library (www.dropzonejs.com) to build highly customizable dropzones that provides drag’n’drop file uploads with image previews | |
| 2 | + | |
| 3 | + TODO: | |
| 4 | + Complete dropzone options and features binding | |
| 5 | + | |
| 6 | + Author: Julien Verneuil (06/04/2016) | |
| 7 | + | |
| 8 | +read tools/basis.anubis | |
| 9 | + | |
| 10 | +read calexium_lib/web/CXM_making_a_web_site.anubis | |
| 11 | + | |
| 12 | +public define HTML_Partial_Content | |
| 13 | + dropzone | |
| 14 | + ( | |
| 15 | + String dropzone_form_name, | |
| 16 | + String dict_default_message, | |
| 17 | + String dict_file_too_big, | |
| 18 | + String param_name, | |
| 19 | + String submit_action_name | |
| 20 | + ) = | |
| 21 | + with dropzone_form_id = generate_random_string(15), | |
| 22 | + partial_content([], sequence([ | |
| 23 | + literal(" | |
| 24 | + <script type=\"text/javascript\"> | |
| 25 | + $(document).ready(function () { | |
| 26 | + Dropzone.options." + dropzone_form_id + " = { | |
| 27 | + dictDefaultMessage : \"" + dict_default_message + "\", | |
| 28 | + dictFileTooBig : \"" + dict_file_too_big + "\", | |
| 29 | + paramName : \"" + param_name + "\" | |
| 30 | + }; | |
| 31 | + }); | |
| 32 | + </script>"), | |
| 33 | + partial(partial_content( | |
| 34 | + [js(js_file("js/dropzone.js")), css(css_file("css/dropzone.css"))], | |
| 35 | + form(dropzone_form_id, [class("dropzone")], submit_action_name, [], empty) | |
| 36 | + ))])). | ... | ... |