adminpanel 3.2.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +2 -3
  4. data/Gemfile +1 -1
  5. data/adminpanel.gemspec +8 -7
  6. data/app/assets/javascripts/adminpanel/application.js +0 -2
  7. data/app/assets/javascripts/adminpanel/dropzone.js +81 -42
  8. data/app/assets/javascripts/adminpanel/filter-side-menu.coffee +1 -1
  9. data/app/assets/javascripts/adminpanel/gallery.js.coffee.erb +1 -1
  10. data/app/assets/javascripts/adminpanel/google_analytics_chart.js.coffee +1 -5
  11. data/app/assets/javascripts/adminpanel/jquery.dataTables.min.js +4 -4
  12. data/app/assets/javascripts/adminpanel/realm.js +2 -6
  13. data/app/assets/javascripts/adminpanel/sortable.js.coffee +1 -5
  14. data/app/assets/javascripts/adminpanel/spinner.js.coffee +3 -3
  15. data/app/assets/javascripts/adminpanel/tables.js +113 -108
  16. data/app/assets/stylesheets/adminpanel/alertify.css +4 -4
  17. data/app/assets/stylesheets/adminpanel/datepicker.min.css +1 -1
  18. data/app/assets/stylesheets/adminpanel/dropzone.css +2 -1
  19. data/app/assets/stylesheets/adminpanel/select2.css +8 -8
  20. data/app/assets/stylesheets/adminpanel/theme.css.scss.erb +1 -1
  21. data/app/assets/stylesheets/adminpanel/turbolinks_progress_load.css +4 -0
  22. data/app/controllers/concerns/adminpanel/gallery_actions.rb +3 -2
  23. data/app/helpers/adminpanel/adminpanel_form_builder.rb +9 -2
  24. data/app/helpers/adminpanel/shared_pages_helper.rb +3 -1
  25. data/app/models/adminpanel/section.rb +9 -16
  26. data/app/models/concerns/adminpanel/base.rb +1 -1
  27. data/app/models/concerns/adminpanel/sitemap.rb +2 -4
  28. data/app/views/adminpanel/form/_select.html.erb +2 -2
  29. data/config/routes.rb +8 -8
  30. data/lib/adminpanel/version.rb +1 -1
  31. data/lib/generators/adminpanel/gallery/templates/uploader.rb +1 -1
  32. data/lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb +4 -3
  33. data/test/dummy/.gitignore +1 -2
  34. data/test/dummy/app/models/adminpanel/galleryfile.rb +10 -0
  35. data/test/dummy/config/environments/test.rb +3 -2
  36. data/test/dummy/db/schema.rb +0 -4
  37. data/test/dummy/test/fixtures/adminpanel/galleries.yml +3 -3
  38. data/test/dummy/test/fixtures/adminpanel/images.yml +8 -8
  39. data/test/features/shared/concerns/sortable_gallery_ui_test.rb +2 -1
  40. data/test/features/shared/resource/show_test.rb +1 -1
  41. data/test/features/shared/ui/dropzone_element_generation_test.rb +1 -1
  42. data/test/helpers/shared_pages_helper_test.rb +2 -1
  43. data/test/models/adminpanel/section_test.rb +0 -3
  44. data/test/test_helper.rb +2 -1
  45. metadata +39 -26
  46. data/app/assets/stylesheets/adminpanel/turbolinks_progress_load.css.scss +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9021b26582599b25784424c0ccf153525ac6bab7
4
- data.tar.gz: 0f71842ba2dfa555b2e69b2bff447ba548ba39ae
3
+ metadata.gz: 7ba1a18640675f498cd05c8446d75845f5d9a697
4
+ data.tar.gz: 83fd84d421a3de764a2538bb2458ef22e74566fe
5
5
  SHA512:
6
- metadata.gz: 2d32120a47905223d4092f399c0f3b2b88b4bc55bbc736e7900cff51b04eae627de0d6f2623ed6243adf6590193a02c9adcad90374e67acb9f2b3e0a79368038
7
- data.tar.gz: b241bc313fad64da43882fbda6a6825f58f38e15626dad3fe99901c1af0fd83e5de64f4de6cb04ccea9b7e39828591bbec45b191c816d8a901990dbea5aa794b
6
+ metadata.gz: 996b5de93dba5b3589ebe2bcb236e276cefff019998fff3840f5441329b4d48b4f5a6d8bfdec84d18217150b16be58703a2ffd9b0947729f979eca34d0e622fd
7
+ data.tar.gz: 81a51d9fad96282b872568142308ee32b2b86fd1e3bd367e8074c61f2f60eabda7cfd70b67ff12547aa6dc12474bafef5fb04f65ab68679062813d666afdb226
data/.gitignore CHANGED
@@ -27,3 +27,4 @@
27
27
  Gemfile.lock
28
28
  .ruby-version
29
29
  .ruby-gemset
30
+ .DS_Store
data/.travis.yml CHANGED
@@ -1,12 +1,11 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.1
4
+ - 2.2.3
5
5
 
6
6
  sudo: false
7
7
 
8
8
  cache: bundler
9
9
 
10
10
  env:
11
- - RAILS=4.2.0
12
- - RAILS=4.2.4
11
+ - RAILS=5.0.0.1
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec development_group: :test
3
+ gemspec
data/adminpanel.gemspec CHANGED
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib', 'app/assets']
21
21
 
22
- spec.required_ruby_version = '>= 2.0.0'
22
+ spec.required_ruby_version = '>= 2.2.3'
23
23
 
24
24
  spec.requirements << 'imagemagick installed'
25
25
 
26
- spec.add_runtime_dependency 'rails', '>= 4.2.0', '< 5.0.0'
26
+ spec.add_runtime_dependency 'rails', '>= 5.0', '< 5.1'
27
27
  spec.add_runtime_dependency 'mini_magick', '4.3.6'
28
28
  spec.add_runtime_dependency 'bcrypt', '~> 3.1', '>= 3.1.7'
29
29
  spec.add_runtime_dependency 'carrierwave', '~> 0.10', '>= 0.10.0'
@@ -38,21 +38,22 @@ Gem::Specification.new do |spec|
38
38
  spec.add_runtime_dependency 'twitter', '5.14.0' # Twitter
39
39
 
40
40
  # Asset dependencies
41
- spec.add_runtime_dependency 'coffee-rails', '~> 4.1.0', '>= 4.1.0'
41
+ spec.add_runtime_dependency 'coffee-rails', '~> 4.2', '>= 4.2.0'
42
42
  spec.add_runtime_dependency 'font-awesome-rails', '~> 4.2', '>= 4.2.0'
43
- spec.add_runtime_dependency 'jquery-rails', '~> 4.0.4', '>= 4.0.4'
43
+ spec.add_runtime_dependency 'jquery-rails', '~> 4.2', '>= 4.2.0'
44
44
  spec.add_runtime_dependency 'jquery-ui-rails', '~> 5.0.5', '>= 5.0.5'
45
45
  spec.add_runtime_dependency 'sass-rails', '~> 5.0.0', '>= 5.0.0'
46
- spec.add_runtime_dependency 'turbolinks', '~> 2.5.0', '>= 2.5.2'
46
+ spec.add_runtime_dependency 'turbolinks', '~> 5', '>= 5'
47
47
 
48
48
  # Development dependencies
49
49
  spec.add_runtime_dependency 'faker', '~> 1.3', '>= 1.3.0'
50
50
 
51
51
  # Test dependencies
52
- spec.add_development_dependency 'minitest', '>= 5.4.0', '<= 6.0.0'
52
+ spec.add_development_dependency 'minitest', '>= 5.7.0', '<= 6.0.0'
53
53
  spec.add_development_dependency 'minitest-emoji', '2.0.0'
54
+ spec.add_development_dependency 'capybara', '> 2.10.0'
54
55
  spec.add_development_dependency 'minitest-capybara','0.7.1'
55
56
  spec.add_development_dependency 'poltergeist'
56
- spec.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.10'
57
+ spec.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.12'
57
58
  spec.add_development_dependency 'byebug'
58
59
  end
@@ -19,5 +19,3 @@
19
19
  //= require turbolinks
20
20
  //= require adminpanel/bootstrap
21
21
  //= require_tree .
22
- Turbolinks.enableTransitionCache();
23
- Turbolinks.enableProgressBar();
@@ -111,7 +111,7 @@
111
111
  dropzone.on("dragEnter", function() { });
112
112
  */
113
113
 
114
- Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
114
+ Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
115
115
 
116
116
  Dropzone.prototype.defaultOptions = {
117
117
  url: null,
@@ -127,7 +127,6 @@
127
127
  thumbnailHeight: 120,
128
128
  filesizeBase: 1000,
129
129
  maxFiles: null,
130
- filesizeBase: 1000,
131
130
  params: {},
132
131
  clickable: true,
133
132
  ignoreHiddenFiles: true,
@@ -137,7 +136,9 @@
137
136
  autoQueue: true,
138
137
  addRemoveLinks: false,
139
138
  previewsContainer: null,
139
+ hiddenInputContainer: "body",
140
140
  capture: null,
141
+ renameFilename: null,
141
142
  dictDefaultMessage: "Drop files here to upload",
142
143
  dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
143
144
  dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
@@ -174,7 +175,11 @@
174
175
  }
175
176
  span = messageElement.getElementsByTagName("span")[0];
176
177
  if (span) {
177
- span.textContent = this.options.dictFallbackMessage;
178
+ if (span.textContent != null) {
179
+ span.textContent = this.options.dictFallbackMessage;
180
+ } else if (span.innerText != null) {
181
+ span.innerText = this.options.dictFallbackMessage;
182
+ }
178
183
  }
179
184
  return this.element.appendChild(this.getFallbackForm());
180
185
  },
@@ -255,7 +260,7 @@
255
260
  _ref = file.previewElement.querySelectorAll("[data-dz-name]");
256
261
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
257
262
  node = _ref[_i];
258
- node.textContent = file.name;
263
+ node.textContent = this._renameFilename(file.name);
259
264
  }
260
265
  _ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
261
266
  for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
@@ -387,6 +392,7 @@
387
392
  maxfilesexceeded: noop,
388
393
  maxfilesreached: noop,
389
394
  queuecomplete: noop,
395
+ addedfiles: noop,
390
396
  previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>"
391
397
  };
392
398
 
@@ -508,6 +514,10 @@
508
514
  return this.getFilesWithStatus(Dropzone.UPLOADING);
509
515
  };
510
516
 
517
+ Dropzone.prototype.getAddedFiles = function() {
518
+ return this.getFilesWithStatus(Dropzone.ADDED);
519
+ };
520
+
511
521
  Dropzone.prototype.getActiveFiles = function() {
512
522
  var file, _i, _len, _ref, _results;
513
523
  _ref = this.files;
@@ -533,7 +543,7 @@
533
543
  setupHiddenFileInput = (function(_this) {
534
544
  return function() {
535
545
  if (_this.hiddenFileInput) {
536
- document.body.removeChild(_this.hiddenFileInput);
546
+ _this.hiddenFileInput.parentNode.removeChild(_this.hiddenFileInput);
537
547
  }
538
548
  _this.hiddenFileInput = document.createElement("input");
539
549
  _this.hiddenFileInput.setAttribute("type", "file");
@@ -553,7 +563,7 @@
553
563
  _this.hiddenFileInput.style.left = "0";
554
564
  _this.hiddenFileInput.style.height = "0";
555
565
  _this.hiddenFileInput.style.width = "0";
556
- document.body.appendChild(_this.hiddenFileInput);
566
+ document.querySelector(_this.options.hiddenInputContainer).appendChild(_this.hiddenFileInput);
557
567
  return _this.hiddenFileInput.addEventListener("change", function() {
558
568
  var file, files, _i, _len;
559
569
  files = _this.hiddenFileInput.files;
@@ -563,6 +573,7 @@
563
573
  _this.addFile(file);
564
574
  }
565
575
  }
576
+ _this.emit("addedfiles", files);
566
577
  return setupHiddenFileInput();
567
578
  });
568
579
  };
@@ -592,7 +603,7 @@
592
603
  })(this));
593
604
  this.on("complete", (function(_this) {
594
605
  return function(file) {
595
- if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
606
+ if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
596
607
  return setTimeout((function() {
597
608
  return _this.emit("queuecomplete");
598
609
  }), 0);
@@ -659,8 +670,9 @@
659
670
  events: {
660
671
  "click": function(evt) {
661
672
  if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
662
- return _this.hiddenFileInput.click();
673
+ _this.hiddenFileInput.click();
663
674
  }
675
+ return true;
664
676
  }
665
677
  }
666
678
  });
@@ -709,6 +721,13 @@
709
721
  }
710
722
  };
711
723
 
724
+ Dropzone.prototype._renameFilename = function(name) {
725
+ if (typeof this.options.renameFilename !== "function") {
726
+ return name;
727
+ }
728
+ return this.options.renameFilename(name);
729
+ };
730
+
712
731
  Dropzone.prototype.getFallbackForm = function() {
713
732
  var existingFallback, fields, fieldsString, form;
714
733
  if (existingFallback = this.getExistingFallback()) {
@@ -814,18 +833,21 @@
814
833
 
815
834
  Dropzone.prototype.filesize = function(size) {
816
835
  var cutoff, i, selectedSize, selectedUnit, unit, units, _i, _len;
817
- units = ['TB', 'GB', 'MB', 'KB', 'b'];
818
- selectedSize = selectedUnit = null;
819
- for (i = _i = 0, _len = units.length; _i < _len; i = ++_i) {
820
- unit = units[i];
821
- cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
822
- if (size >= cutoff) {
823
- selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
824
- selectedUnit = unit;
825
- break;
836
+ selectedSize = 0;
837
+ selectedUnit = "b";
838
+ if (size > 0) {
839
+ units = ['TB', 'GB', 'MB', 'KB', 'b'];
840
+ for (i = _i = 0, _len = units.length; _i < _len; i = ++_i) {
841
+ unit = units[i];
842
+ cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
843
+ if (size >= cutoff) {
844
+ selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
845
+ selectedUnit = unit;
846
+ break;
847
+ }
826
848
  }
849
+ selectedSize = Math.round(10 * selectedSize) / 10;
827
850
  }
828
- selectedSize = Math.round(10 * selectedSize) / 10;
829
851
  return "<strong>" + selectedSize + "</strong> " + selectedUnit;
830
852
  };
831
853
 
@@ -847,6 +869,7 @@
847
869
  }
848
870
  this.emit("drop", e);
849
871
  files = e.dataTransfer.files;
872
+ this.emit("addedfiles", files);
850
873
  if (files.length) {
851
874
  items = e.dataTransfer.items;
852
875
  if (items && items.length && (items[0].webkitGetAsEntry != null)) {
@@ -906,30 +929,37 @@
906
929
  };
907
930
 
908
931
  Dropzone.prototype._addFilesFromDirectory = function(directory, path) {
909
- var dirReader, entriesReader;
932
+ var dirReader, errorHandler, readEntries;
910
933
  dirReader = directory.createReader();
911
- entriesReader = (function(_this) {
912
- return function(entries) {
913
- var entry, _i, _len;
914
- for (_i = 0, _len = entries.length; _i < _len; _i++) {
915
- entry = entries[_i];
916
- if (entry.isFile) {
917
- entry.file(function(file) {
918
- if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
919
- return;
934
+ errorHandler = function(error) {
935
+ return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0;
936
+ };
937
+ readEntries = (function(_this) {
938
+ return function() {
939
+ return dirReader.readEntries(function(entries) {
940
+ var entry, _i, _len;
941
+ if (entries.length > 0) {
942
+ for (_i = 0, _len = entries.length; _i < _len; _i++) {
943
+ entry = entries[_i];
944
+ if (entry.isFile) {
945
+ entry.file(function(file) {
946
+ if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
947
+ return;
948
+ }
949
+ file.fullPath = "" + path + "/" + file.name;
950
+ return _this.addFile(file);
951
+ });
952
+ } else if (entry.isDirectory) {
953
+ _this._addFilesFromDirectory(entry, "" + path + "/" + entry.name);
920
954
  }
921
- file.fullPath = "" + path + "/" + file.name;
922
- return _this.addFile(file);
923
- });
924
- } else if (entry.isDirectory) {
925
- _this._addFilesFromDirectory(entry, "" + path + "/" + entry.name);
955
+ }
956
+ readEntries();
926
957
  }
927
- }
958
+ return null;
959
+ }, errorHandler);
928
960
  };
929
961
  })(this);
930
- return dirReader.readEntries(entriesReader, function(error) {
931
- return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0;
932
- });
962
+ return readEntries();
933
963
  };
934
964
 
935
965
  Dropzone.prototype.accept = function(file, done) {
@@ -1067,9 +1097,12 @@
1067
1097
  return fileReader.readAsDataURL(file);
1068
1098
  };
1069
1099
 
1070
- Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback) {
1100
+ Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback, crossOrigin) {
1071
1101
  var img;
1072
1102
  img = document.createElement("img");
1103
+ if (crossOrigin) {
1104
+ img.crossOrigin = crossOrigin;
1105
+ }
1073
1106
  img.onload = (function(_this) {
1074
1107
  return function() {
1075
1108
  var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3;
@@ -1305,7 +1338,9 @@
1305
1338
  }
1306
1339
  for (headerName in headers) {
1307
1340
  headerValue = headers[headerName];
1308
- xhr.setRequestHeader(headerName, headerValue);
1341
+ if (headerValue) {
1342
+ xhr.setRequestHeader(headerName, headerValue);
1343
+ }
1309
1344
  }
1310
1345
  formData = new FormData();
1311
1346
  if (this.options.params) {
@@ -1342,8 +1377,12 @@
1342
1377
  }
1343
1378
  }
1344
1379
  for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) {
1345
- formData.append(this._getParamName(i), files[i], files[i].name);
1380
+ formData.append(this._getParamName(i), files[i], this._renameFilename(files[i].name));
1346
1381
  }
1382
+ return this.submitRequest(xhr, formData, files);
1383
+ };
1384
+
1385
+ Dropzone.prototype.submitRequest = function(xhr, formData, files) {
1347
1386
  return xhr.send(formData);
1348
1387
  };
1349
1388
 
@@ -1385,7 +1424,7 @@
1385
1424
 
1386
1425
  })(Emitter);
1387
1426
 
1388
- Dropzone.version = "4.0.1";
1427
+ Dropzone.version = "4.3.0";
1389
1428
 
1390
1429
  Dropzone.options = {};
1391
1430
 
@@ -1725,4 +1764,4 @@
1725
1764
 
1726
1765
  contentLoaded(window, Dropzone._autoDiscoverFunction);
1727
1766
 
1728
- }).call(this);
1767
+ }).call(this);
@@ -1,4 +1,4 @@
1
- $(document).on 'page:load ready', ->
1
+ $(document).on 'turbolinks:load', ->
2
2
  $('#search-modules').domFilter
3
3
  input: '#search-input'
4
4
  selector: '.accordion-group'
@@ -76,4 +76,4 @@ DropzoneHandler =
76
76
 
77
77
 
78
78
 
79
- $(document).on('page:load ready', $.proxy(DropzoneHandler.init, DropzoneHandler))
79
+ $(document).on('turbolinks:load', $.proxy(DropzoneHandler.init, DropzoneHandler))
@@ -1,5 +1,4 @@
1
- drawGraphic = ->
2
-
1
+ $(document).on 'turbolinks:load', ->
3
2
  if $('#google-stats').length
4
3
  margin =
5
4
  top: 20
@@ -58,6 +57,3 @@ drawGraphic = ->
58
57
  .datum data
59
58
  .attr "class", "line"
60
59
  .attr "d", line
61
-
62
- $(document).on 'page:load', drawGraphic
63
- $(document).ready drawGraphic
@@ -3,16 +3,16 @@
3
3
  * Version: 1.9.4
4
4
  * Author: Allan Jardine (www.sprymedia.co.uk)
5
5
  * Info: www.datatables.net
6
- *
6
+ *
7
7
  * Copyright 2008-2012 Allan Jardine, all rights reserved.
8
8
  *
9
9
  * This source file is free software, under either the GPL v2 license or a
10
10
  * BSD style license, available at:
11
11
  * http://datatables.net/license_gpl2
12
12
  * http://datatables.net/license_bsd
13
- *
14
- * This source file is distributed in the hope that it will be useful, but
15
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
+ *
14
+ * This source file is distributed in the hope that it will be useful, but
15
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
16
  * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
17
17
  */
18
18
  (function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
@@ -1,4 +1,4 @@
1
- var ready = function(){
1
+ $(document).on('turbolinks:load', function(){
2
2
 
3
3
  // toggle arrow on menu items
4
4
  // $('.accordion-heading .accordion-toggle').click(function(){
@@ -56,11 +56,7 @@ var ready = function(){
56
56
 
57
57
  $('.datepicker-basic').datepicker();
58
58
 
59
- };
60
-
61
- $(document).ready(ready);
62
- $(document).on('page:load', ready);
63
-
59
+ });
64
60
 
65
61
  //----- Side menu functions -----
66
62
 
@@ -1,4 +1,4 @@
1
- ready = ->
1
+ $(document).on 'turbolinks:load', ->
2
2
  $('tbody#sortable').sortable
3
3
  update: (event, ui) ->
4
4
  position = 1
@@ -21,7 +21,3 @@ ready = ->
21
21
  else
22
22
  position++
23
23
  $('tbody#sortable').disableSelection
24
-
25
-
26
- $(document).ready(ready)
27
- $(document).on('page:load', ready)
@@ -1,11 +1,11 @@
1
1
  $(document).on 'click', 'a.spinner-link', ->
2
- $( @ ).attr 'data-clicked', true
2
+ $(@).attr 'data-clicked', true
3
3
 
4
- $(document).on 'page:fetch', ->
4
+ $(document).on 'turbolinks:click', ->
5
5
  $('a.spinner-link[data-clicked="true"]').children('i:first').toggleClass('hidden')
6
6
  $('a.spinner-link[data-clicked="true"]').prepend '<i class="fa fa-spinner fa-spin"></i>'
7
7
 
8
- $(document).on 'page:restore', ->
8
+ $(document).on 'turbolinks:render', ->
9
9
  $('a.spinner-link[data-clicked="true"]').children('i:first').remove()
10
10
  $('a.spinner-link[data-clicked="true"]').children('i:first').toggleClass('hidden')
11
11
  $('a.spinner-link[data-clicked="true"]').attr 'data-clicked', false