simple_form_attachments 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 32937e7bfd5b986371b84849e0978f6351f1483c
4
- data.tar.gz: 90721d27ee39824d4f6aeb3f6a8d32f84d15980a
3
+ metadata.gz: '09c87859edd0551646ccb8392ab947fbc0847e7d'
4
+ data.tar.gz: 397579728ac16875829619f4f0aef70d0e972a86
5
5
  SHA512:
6
- metadata.gz: 4faa06b6077c22c05011becf23da50daaaea0bc926097b8d3a2b13527050e538cb6d4c15d2a641fae850ff112b3d8000955e889abdf4bbf4934c3e263a9b0a8b
7
- data.tar.gz: b23ec5127609dd3b41a45c386e99ea12d24dddbab5a67f294d84e31d35eb4ade677ea83d8b56f950f6d8ca2522ecb4d5324e82ce8debda28f3b63ac99fdc3896
6
+ metadata.gz: 25d9431fe34ad7020c95fbb89d4e4d790b91aa60ac56964bb51e2131a973faf076dad247831693d535a4c6d5397db81883e6beb842a2b71e88f4ce3e615f6ec6
7
+ data.tar.gz: 2dcf8f4df947d7680e464b7f3a34d80c1e0c1034e4352caa815cb9ecc30c9f8868a7c74b073e948b7679c7f0b611f4a3da3632509ee5d1c7560dfb5d003f02a4
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_attachments (1.0.0)
4
+ simple_form_attachments (1.0.1)
5
5
  jquery-ui-rails
6
6
  mongoid (> 4.0)
7
7
  rails (>= 4.2)
8
8
  rails-assets-blueimp-file-upload (>= 9.6.0)
9
9
  rails-assets-handlebars
10
+ rails-assets-numeraljs
10
11
  simple_form (>= 3.0.2)
11
12
  slim
12
13
 
@@ -99,7 +100,7 @@ GEM
99
100
  loofah (2.0.3)
100
101
  nokogiri (>= 1.5.9)
101
102
  lumberjack (1.0.12)
102
- mail (2.6.5)
103
+ mail (2.6.6)
103
104
  mime-types (>= 1.16, < 4)
104
105
  method_source (0.8.2)
105
106
  mime-types (3.1)
@@ -143,7 +144,7 @@ GEM
143
144
  bundler (>= 1.3.0, < 2.0)
144
145
  railties (= 5.1.1)
145
146
  sprockets-rails (>= 2.0.0)
146
- rails-assets-blueimp-canvas-to-blob (3.7.0)
147
+ rails-assets-blueimp-canvas-to-blob (3.8.0)
147
148
  rails-assets-blueimp-file-upload (9.18.0)
148
149
  rails-assets-blueimp-canvas-to-blob (>= 2.1.1)
149
150
  rails-assets-blueimp-load-image (>= 1.13.0)
@@ -153,6 +154,7 @@ GEM
153
154
  rails-assets-blueimp-tmpl (3.8.0)
154
155
  rails-assets-handlebars (4.0.10)
155
156
  rails-assets-jquery (3.2.1)
157
+ rails-assets-numeraljs (2.0.6)
156
158
  rails-controller-testing (1.0.2)
157
159
  actionpack (~> 5.x, >= 5.0.1)
158
160
  actionview (~> 5.x, >= 5.0.1)
@@ -170,8 +172,8 @@ GEM
170
172
  thor (>= 0.18.1, < 2.0)
171
173
  rake (10.5.0)
172
174
  rb-fsevent (0.9.8)
173
- rb-inotify (0.9.8)
174
- ffi (>= 0.5.0)
175
+ rb-inotify (0.9.10)
176
+ ffi (>= 0.5.0, < 2)
175
177
  rb-readline (0.5.4)
176
178
  ruby_dep (1.5.0)
177
179
  shellany (0.0.1)
@@ -5,7 +5,7 @@ div class=SimpleFormAttachments.dom_class(:attachment)
5
5
  div class=SimpleFormAttachments.dom_class(:attachment, [:col, :file_info])
6
6
  div class=SimpleFormAttachments.dom_class(:attachment, :col, :file_info, :name) {{ name }}
7
7
  div class=SimpleFormAttachments.dom_class(:attachment, :col, :file_info, :mime_type) {{ mime_type }}
8
- div class=SimpleFormAttachments.dom_class(:attachment, :col, :file_info, :size) data-filesize='{{ size }}' {{ size }}
8
+ div class=SimpleFormAttachments.dom_class(:attachment, :col, :file_info, :size) data-filesize='{{ size }}' {{ size_human }}
9
9
 
10
10
  div class=SimpleFormAttachments.dom_class(:attachment, [:col, :progress])
11
11
  div class=SimpleFormAttachments.dom_class(:attachment, [:col, :progress, :container])
@@ -1,3 +1,5 @@
1
+ #= require numeraljs
2
+
1
3
  # https://github.com/zenorocha/jquery-boilerplate
2
4
  (($, window) ->
3
5
  pluginName = 'simple_form_attachments'
@@ -66,7 +68,8 @@
66
68
 
67
69
  for file in data.files
68
70
  properties = {
69
- size: @get_kb_from_bytes(file.size)
71
+ size: (file.size)
72
+ size_human: @get_size_human(file.size)
70
73
  mime_type: file.type
71
74
  multiple: @is_multiple()
72
75
  thumb_url: URL.createObjectURL(file)
@@ -157,7 +160,7 @@
157
160
  get_relation_name: -> @$element.data('relation-name')
158
161
  get_relation_key: -> @$element.data('relation-key')
159
162
 
160
- get_kb_from_bytes: (bytes) -> parseInt(parseInt(bytes)/1024)
163
+ get_size_human: (bytes) -> numeral(bytes).format('0.0 b')
161
164
 
162
165
  get_attachment_template: (file) =>
163
166
  template = Handlebars.compile(@$element.find('script#simple_form_attachments__template').html())
@@ -1,3 +1,3 @@
1
1
  module SimpleFormAttachments
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'jquery-ui-rails'
29
29
  spec.add_dependency 'rails-assets-blueimp-file-upload', '>= 9.6.0'
30
30
  spec.add_dependency 'rails-assets-handlebars'
31
+ spec.add_dependency 'rails-assets-numeraljs'
31
32
 
32
33
  # ---------------------------------------------------------------------
33
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_attachments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-08 00:00:00.000000000 Z
12
+ date: 2017-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -109,6 +109,20 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rails-assets-numeraljs
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
112
126
  - !ruby/object:Gem::Dependency
113
127
  name: bundler
114
128
  requirement: !ruby/object:Gem::Requirement