thecore_ui_partial_snippets 1.1.14 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13b60dd93240a3031e6899871cfc8988bb821419570bca55b108d9ebbf872da7
|
4
|
+
data.tar.gz: 96df5ac94d1c5a04d862911729b89d57b1225f243c58b82840fa8d891ec1ccf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 526ab718cd30db793b2f9c3fc9e2b28db0e7b4023d11849d5a5edb77467568146024489a9f607e9b285fe10950f3b27776757281eabf0fd384215dec1b634bf5
|
7
|
+
data.tar.gz: 5675d75fb6aaa0d6a56efc2caf673e8a00b32fcd5c9e7ccab752c545196eaae0786cf5ae87a1fd6d83bfab91d6ad11cefcd9f05c47fd2ca02ff0a8125691bc4e
|
@@ -22,8 +22,12 @@
|
|
22
22
|
</style>
|
23
23
|
|
24
24
|
<div class="panel panel-default">
|
25
|
-
<div class="panel-heading"
|
25
|
+
<div class="panel-heading">
|
26
|
+
<strong><%=I18n.t :file_upload%></strong>
|
26
27
|
<small><%=I18n.t :file_upload_subtitle, extension: Settings.ns(:xls_item_codes_importer).extension%></small>
|
28
|
+
<div class="pull-right" id="<%=target%>-upload-drop-zone-feedback">
|
29
|
+
|
30
|
+
</div>
|
27
31
|
</div>
|
28
32
|
<div class="panel-body">
|
29
33
|
|
@@ -39,45 +43,45 @@
|
|
39
43
|
|
40
44
|
<script>
|
41
45
|
var fileupload = {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
this.dropZone.ondragover = this.ondragover;
|
47
|
-
this.dropZone.ondragleave = this.ondragleave;
|
48
|
-
|
46
|
+
init: function () {
|
47
|
+
$('#<%=target%>').on("drop", this.ondrop);
|
48
|
+
$('#<%=target%>').on("dragover", this.ondragover);
|
49
|
+
$('#<%=target%>').on("dragleave", this.ondragleave);
|
49
50
|
},
|
50
51
|
|
51
|
-
success: function(response) {console.log('file uploaded');},
|
52
|
-
failure: function(error) {console.log('file not uploaded');},
|
53
|
-
|
54
52
|
ondrop: function (e) {
|
53
|
+
// console.log(e)
|
55
54
|
e.preventDefault();
|
56
|
-
|
55
|
+
$('#<%=target%>').removeClass('drop');
|
56
|
+
$("#<%=target%>-upload-drop-zone-feedback").html("<i class='fa fa-spinner fa-spin '></i>");
|
57
57
|
|
58
|
-
console.log(e.dataTransfer.files);
|
58
|
+
// console.log(e.dataTransfer.files);
|
59
59
|
var fd = new FormData();
|
60
|
-
$.each(e.dataTransfer.files, function (i, file) {
|
60
|
+
$.each(e.originalEvent.dataTransfer.files, function (i, file) {
|
61
61
|
fd.append('files[]', file);
|
62
62
|
});
|
63
63
|
|
64
64
|
$.ajax({
|
65
65
|
url: '<%=url%>',
|
66
|
-
type: 'post',
|
67
66
|
data: fd,
|
67
|
+
processData: false,
|
68
68
|
contentType: false,
|
69
|
-
|
70
|
-
|
69
|
+
type: 'POST',
|
70
|
+
success: function () {
|
71
|
+
|
72
|
+
$("#<%=target%>-upload-drop-zone-feedback").html($("<span><%=I18n.t :upload_ok%></span>").delay(3000).fadeOut(400));
|
73
|
+
}
|
74
|
+
});
|
71
75
|
// startUpload(e.dataTransfer.files)
|
72
76
|
},
|
73
77
|
|
74
78
|
ondragover: function () {
|
75
|
-
|
79
|
+
$('#<%=target%>').addClass('drop');
|
76
80
|
return false;
|
77
81
|
},
|
78
82
|
|
79
83
|
ondragleave: function () {
|
80
|
-
|
84
|
+
$('#<%=target%>').removeClass('drop');
|
81
85
|
return false;
|
82
86
|
}
|
83
87
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_partial_snippets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
@@ -36,6 +36,8 @@ files:
|
|
36
36
|
- Rakefile
|
37
37
|
- app/views/thecore_utils/_drag_drop_uploader.html.erb
|
38
38
|
- app/views/thecore_utils/_html_helpers.html.erb
|
39
|
+
- config/locales/thecore_ui_partial_snippets.en.yml
|
40
|
+
- config/locales/thecore_ui_partial_snippets.it.yml
|
39
41
|
- lib/thecore_ui_partial_snippets.rb
|
40
42
|
- lib/thecore_ui_partial_snippets/engine.rb
|
41
43
|
- lib/thecore_ui_partial_snippets/version.rb
|