avatars_for_rails 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 121c97a3a4aafa171f7ad2d22e4ce00a341f737e
4
- data.tar.gz: ee12a07c8c781423f251177f0f2da36ee7818c2b
3
+ metadata.gz: 63ef1090f4e07e335c723459840581f7def14992
4
+ data.tar.gz: 774ff99df0041eac6cb9102cd0bfa782087a2d25
5
5
  SHA512:
6
- metadata.gz: 439b6b2ad2fb492fe6e1782ec1f20bcf43e929e34a01311c8702660aa2ee2beef5a9b04d40525e3c8554280b9e6a292d95c29483b28ff8df473f26361c4aa9dd
7
- data.tar.gz: 3eb1eaea45eed02d4f6ebc955edf133a9ef55117ebe8b6dd384ac35bf2b2a0f4fc6c49b00a270a1db509d2e4f8c4bbf3b9b93172c1c4c8431a06cfb25e5757f8
6
+ metadata.gz: 1ad93d034158dc05bc6df8bae686ead9c6d0eb2df439b6d8c426c3c799785acf47c742758cb073f3414a7790f233a0ee9930be98d71143b9b76c092e7cd163a5
7
+ data.tar.gz: 3a7dfb5677270b6c0471d77cb11cb0b0c57af8d0520fcc9eb85c3b2878171d897a0fc5cb62b37d680fb0c5293f5413b9795b9cbd92478139d06fe1c3275404ac
@@ -20,8 +20,19 @@ var AvatarForRails = AvatarForRails || (function($, undefined) {
20
20
  var initFileUpload = function() {
21
21
  $('input[name*="logo"]').fileupload({
22
22
  dataType: 'json',
23
+ progressall: function (e, data) {
24
+ var progress = parseInt(data.loaded / data.total * 100, 10);
25
+
26
+ $('#avatar-progress .bar').css(
27
+ 'width',
28
+ progress + '%'
29
+ );
30
+ },
23
31
  done: uploadDone
24
32
  });
33
+
34
+ $('#avatar-progress .bar').css('width', '0%');
35
+
25
36
  };
26
37
 
27
38
  var uploadDone = function(e, data) {
@@ -2,6 +2,8 @@
2
2
  <%= f.file_field :logo, "data-url" => avatar_path %>
3
3
  <% end %>
4
4
 
5
+ <%= render partial: 'avatars/progress' %>
6
+
5
7
  <% content_for :javascript do %>
6
8
  $(function() {
7
9
  AvatarForRails.edit();
@@ -0,0 +1,6 @@
1
+ <div id="avatar-progress">
2
+ <div class="progress progress-striped active">
3
+ <div class="bar" style="width: 100%">
4
+ </div>
5
+ </div>
6
+ </div>
@@ -1,3 +1,3 @@
1
1
  module AvatarsForRails
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatars_for_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Castro Montero
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
@@ -185,6 +185,7 @@ files:
185
185
  - app/controllers/avatars_controller.rb
186
186
  - app/views/avatars/_crop.html.erb
187
187
  - app/views/avatars/_form.html.erb
188
+ - app/views/avatars/_progress.html.erb
188
189
  - avatars_for_rails.gemspec
189
190
  - config/locales/en.yml
190
191
  - config/locales/es.yml