Advertisement
Guest User

Untitled

a guest
Jul 7th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element
  2.  
  3.             // The configuration we've talked about above
  4.             autoProcessQueue: false,
  5.             uploadMultiple: true,
  6.             parallelUploads: 100,
  7.             maxFiles: 100,
  8.             paramName: "thumbs",
  9.             addRemoveLinks: true,
  10.             dictRemoveFile: 'Удалить',
  11.             url: "{{ url('dashboard/files/edit',$gallery['id']) }}",
  12.  
  13.             // The setting up of the dropzone
  14.             init: function() {
  15.                 var myDropzone = this;
  16.  
  17.                 // First change the button to actually tell Dropzone to process the queue.
  18.                 this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
  19.                     // Make sure that the form isn't actually being sent.
  20.                     e.preventDefault();
  21.                     e.stopPropagation();
  22.                     myDropzone.processQueue();
  23.                 });
  24.  
  25.                 // Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
  26.                 // of the sending event because uploadMultiple is set to true.
  27.                 this.on("sendingmultiple", function() {
  28.                     // Gets triggered when the form is actually being sent.
  29.                     // Hide the success button or the complete form.
  30.                 });
  31.                 this.on("successmultiple", function(files, response) {
  32.                     // Gets triggered when the files have successfully been sent.
  33.                     // Redirect user or notify of success.
  34.                     swal({
  35.                         title: "Готово!",
  36.                         text: "Все сделали, все загрузили и создали! Добавим еще, что - то?",
  37.                         type: "success",
  38.                         showCancelButton: false,
  39.                         closeOnConfirm: true,
  40.                         animation: "slide-from-top",
  41.                         inputPlaceholder: "Write something"
  42.                     });
  43.                     //window.location = "/dashboard/files/list";
  44.                 });
  45.                 this.on("errormultiple", function(files, response) {
  46.                     // Gets triggered when there was an error sending the files.
  47.                     // Maybe show form again, and notify user of error
  48.                     swal({
  49.                         title: "Готово!",
  50.                         text: "Все сделали, все загрузили и создали! Добавим еще, что - то?",
  51.                         type: "error",
  52.                         showCancelButton: false,
  53.                         closeOnConfirm: true,
  54.                         animation: "slide-from-top",
  55.                         inputPlaceholder: "Write something"
  56.                     });
  57.                 });
  58.             }
  59.  
  60.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement