thecore_ui_commons 2.2.6 → 2.2.7

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: '044692e50388d2be1a07d5ecf256cb590bbaa227d78ad32e0885fc8859dac137'
4
- data.tar.gz: 739c924a0eed89d69e51361edd060dee8b0af722565c21b09b3f07d55e18a05e
3
+ metadata.gz: 1773c485e9a7cc05938d28da606198382b7070dd18df29b233e6b77e58f2ded7
4
+ data.tar.gz: 5204a76b9aaf067feef9e06bc23e1980888ad099331fba90d647516d0ba82e83
5
5
  SHA512:
6
- metadata.gz: bea19b48bc818c37da1df3be6d1d230dc1f20f929e89953c597219f3eb2ded0c5ddc8bb7de724e8f426407f84b0c07c8f63b490eeafc9ef43ce331c9281322af
7
- data.tar.gz: 9ba335b796d5e6fc25d52ab5e1704597b32108f575ae1c6027b31001aea02b0685405dafc75c1705e57c0086f9015218a45992af5dba64ec9c34d089eb28aeb2
6
+ metadata.gz: 14e4c40f8f9b144a4c04e6905457d074275491a557c150ccab410623216896affeb83141b159bfd80523274b3ed7519f71aad92ed69fb5a984f2bb8fbc82c6eb
7
+ data.tar.gz: e145a22345c62517201c2cbf8ac86598e7cc760189ae034438646809368413238663f31be2e7c3363d0c5e921ed2027971ca9975d411034d53eb6d621c9e46bc
@@ -12,26 +12,32 @@
12
12
  =end%>
13
13
 
14
14
  <style>
15
- /* layout.css Style */
16
15
  .upload-drop-zone {
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
17
19
  height: 200px;
18
20
  border-width: 2px;
19
- margin-bottom: 20px;
20
- }
21
-
22
- /* skin.css Style*/
23
- .upload-drop-zone {
24
- color: #ccc;
21
+ /* margin-bottom: 20px; */
22
+ color: #bbb;
25
23
  border-style: dashed;
26
24
  border-color: #ccc;
27
- line-height: 200px;
28
- text-align: center
25
+ /* line-height: 200px; */
26
+ text-align: center
27
+ }
28
+ .upload-drop-zone i {
29
+ font-size: 8em
29
30
  }
30
31
 
31
32
  .upload-drop-zone.drop {
32
33
  color: #222;
33
34
  border-color: #222;
34
35
  }
36
+
37
+ .upload-drop-zone.disabledDnD {
38
+ background-color: darkred;
39
+ color: white;
40
+ }
35
41
  </style>
36
42
 
37
43
  <div class="panel panel-default">
@@ -46,7 +52,7 @@
46
52
 
47
53
  <!-- Drop Zone -->
48
54
  <div class="upload-drop-zone" id="<%=target%>">
49
- <%=I18n.t :please_drag_and_drop_here%>
55
+
50
56
  </div>
51
57
 
52
58
  <div id="upload-status">
@@ -55,12 +61,24 @@
55
61
  </div>
56
62
 
57
63
  <script>
64
+ // Enable D&D beahviour
65
+ function dndOn() {
66
+ $('#<%=target%>').on("drop", this.ondrop);
67
+ $('#<%=target%>').on("dragover", this.ondragover);
68
+ $('#<%=target%>').on("dragleave", this.ondragleave);
69
+ $('#<%=target%>').removeClass('disabledDnD');
70
+ $('#<%=target%>').html('<div><i class="fa fa-cloud-upload"></i><br/><span><%=I18n.t :please_drag_and_drop_here%></span></div>')
71
+ }
72
+ // Disable D&D beahviour
73
+ function dndOff() {
74
+ $('#<%=target%>').addClass('disabledDnD');
75
+ $('#<%=target%>').html('<div><i class="fa fa-ban"></i><br/><span><%=I18n.t :dont_leve_or_drag_here%></span></div>')
76
+ $('#<%=target%>').off("drop", this.ondrop);
77
+ $('#<%=target%>').off("dragover", this.ondragover);
78
+ $('#<%=target%>').off("dragleave", this.ondragleave);
79
+ }
58
80
  var fileupload = {
59
- init: function () {
60
- $('#<%=target%>').on("drop", this.ondrop);
61
- $('#<%=target%>').on("dragover", this.ondragover);
62
- $('#<%=target%>').on("dragleave", this.ondragleave);
63
- },
81
+ init: dndOn,
64
82
 
65
83
  beforeSuccess: function(){
66
84
  console.log("beforeSuccess");
@@ -69,6 +87,7 @@
69
87
  ondrop: function (e) {
70
88
  // console.log(e)
71
89
  e.preventDefault();
90
+ dndOff();
72
91
  $('#<%=target%>').removeClass('drop');
73
92
  $("#<%=target%>-upload-drop-zone-feedback").html("<i class='fa fa-spinner fa-spin '></i>");
74
93
 
@@ -87,9 +106,11 @@
87
106
  success: function () {
88
107
  fileupload.beforeSuccess();
89
108
  $("#<%=target%>-upload-drop-zone-feedback").html($('<i class="fa fa-check-square-o" aria-hidden="true"></i>').delay(3000).fadeOut(400));
109
+ fileupload.init();
90
110
  },
91
111
  error: function () {
92
112
  $("#<%=target%>-upload-drop-zone-feedback").html($('<i class="fa fa-exclamation-circle" aria-hidden="true"></i>').delay(3000).fadeOut(400));
113
+ fileupload.init();
93
114
  }
94
115
  });
95
116
  // startUpload(e.dataTransfer.files)
@@ -1,6 +1,7 @@
1
1
  en:
2
2
  file_upload: Upload description, please add a translation for the element called file_upload in your translation file.
3
3
  file_upload_subtitle: Descrizione aggiuntiva, prego aggiungere una traduzione per file_upload_subtitle al tuo file delle traduzioni.
4
+ dont_leve_or_drag_here: Uploading, please don't leave this page or Drag & Drop other files.
4
5
  loading: Caricamento
5
6
  please_drag_and_drop_here: Drag and Drop here the files to import
6
7
  import_success: Import Successful!
@@ -1,6 +1,7 @@
1
1
  it:
2
2
  file_upload: Descrizione della procedura, prego aggiungere una traduzione per file_upload al tuo file delle traduzioni.
3
3
  file_upload_subtitle: Descrizione aggiuntiva, prego aggiungere una traduzione per file_upload_subtitle al tuo file delle traduzioni.
4
+ dont_leve_or_drag_here: Upload in corso, si prega di non lasciare la pagina o trascinare qui altri file.
4
5
  loading: Caricamento
5
6
  run_import: Forza l'importazione
6
7
  please_drag_and_drop_here: Trascinare qui i file da importare
@@ -3,6 +3,8 @@ require 'thecore_background_jobs' # This brings backend commons also.
3
3
  require 'serviceworker-rails'
4
4
  require "groupdate"
5
5
  require "apexcharts"
6
+ require "poppler"
7
+ require "image_processing"
6
8
 
7
9
  require 'concerns/thecore_ui_commons_user'
8
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-08 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_background_jobs
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: poppler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: image_processing
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.2'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.2'
69
97
  description: Engine to serve configurations and rails module useful for all the UIs.
70
98
  email:
71
99
  - gabriele.tassoni@gmail.com