lazyload-rails 0.3.1 → 0.4.0

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
- SHA1:
3
- metadata.gz: 6d3ae7b6404532e88eb9a6bbfaf7837c06d3b037
4
- data.tar.gz: 2763f7b41f9d5e8d04ccb3d944b14c28e21ad25a
2
+ SHA256:
3
+ metadata.gz: 9bea9d89fb6ecb8a0218753ab51a6a6aa39e31a613b9c943c8562957c3fbb28a
4
+ data.tar.gz: 7cda2a364ee6b450965eacba99085a670b4e0f0f09d51e6c7003657903c65e18
5
5
  SHA512:
6
- metadata.gz: 84f18a5cb5587e28813d214add7f0b0f334ce315fb31af0c5422e68bd549399ce7c0057cf3d3a2c7aa78e069625eec4c9cd5c3d6dab926c5347c9c76c8440f10
7
- data.tar.gz: ed23c7fb9c5dcead008628c13b45cf3724a9f9e2a7b7d15ab44a92d7f578220fa69df9167d0a4f73b8e79fa05f130177aae339f0986bec3b46ec0776b7653760
6
+ metadata.gz: da29205ffe57d1de0eabc3ebf82cadff46484306fea78046ee6089912bd13dc1b17de9c37399d44c54049476c7e51596652e9da037bec2e8a8271dedf10f1e13
7
+ data.tar.gz: 75ad188919cb37d8297d0b898687f4332177a152600183839cd6d928dc41a85baaeee2bc58222f5d884fddcf8f5008c4618fd98f6a27087512f005f8bd493452
data/README.md CHANGED
@@ -17,48 +17,54 @@ See [example](http://backbonejs.org/#examples) (scroll down to see images load)
17
17
 
18
18
  ### Features
19
19
 
20
- * Add `lazy: true` option to Rails `image_tag` helpers to render lazyload-friendly
21
- -html img tags.
22
- * Simple, really. That's pretty much it.
20
+ * Add `lazy: true` option to Rails `image_tag` helpers to render lazyload-friendly img tags.
21
+ * Simple (really). That's pretty much it.
23
22
 
24
23
  ### Example
25
24
 
26
- <%= image_tag "kittenz.png", alt: "OMG a cat!", lazy: true %>
25
+ ```erb
26
+ <%= image_tag "kittenz.png", alt: "OMG a cat!", lazy: true %>
27
+ ```
27
28
 
28
29
  Equals:
29
30
 
30
- <img alt="OMG a cat!" data-original="/images/kittenz.png" src="http://www.appelsiini.net/projects/lazyload/img/grey.gif">
31
+ ```html
32
+ <img alt="OMG a cat!" data-original="/images/kittenz.png" src="http://www.appelsiini.net/projects/lazyload/img/grey.gif">
33
+ ```
34
+
35
+ **PRO TIP!** You must set image dimensions either as width and height attributes or in CSS. Otherwise plugin might not work properly.
31
36
 
32
37
  ## Install
33
38
 
34
- Add this line to your application's Gemfile:
39
+ 1. Add this line to your application's Gemfile:
40
+
41
+ gem "lazyload-rails"
42
+
43
+ 2. Download the [jQuery Lazy Load Plugin](https://raw.github.com/tuupola/jquery_lazyload/master/jquery.lazyload.js)
44
+ into your `vendor/assets/javascripts` directory.
35
45
 
36
- gem "lazyload-rails"
46
+ 3. Include it however you prefer. For example, in your application.js you could add:
37
47
 
38
- Download the [jQuery Lazy Load Plugin](https://raw.github.com/tuupola/jquery_lazyload/master/jquery.lazyload.js)
39
- into your `vendor/assets/javascripts` directory and include it however you prefer.
48
+ //= require jquery.lazyload
40
49
 
41
- And in your JavaScript code do:
50
+ 4. In your JavaScript code do:
42
51
 
43
- $("img").lazyload();
52
+ $("img").lazyload();
44
53
 
45
54
  Lazy Load can be customized, [see more options](http://www.appelsiini.net/projects/lazyload)
46
55
 
47
- *Important: Remember that the Lazy Load Plugin depends on jQuery.*
56
+ *__Important__: Remember that the Lazy Load Plugin depends on jQuery.*
48
57
 
49
58
  ## Configuration
50
59
 
51
60
  By default, a 1x1 grey gif is used as placeholder (from [http://appelsiini.net/projects/lazyload/img/grey.gif](http://www.appelsiini.net/projects/lazyload/img/grey.gif)). This can be easily customized:
52
61
 
53
- # config/initializers/lazyload.rb
54
- Lazyload::Rails.configure do |config|
55
- config.placeholder = "/public/img/grey.gif"
56
- end
57
-
58
- ## FAQ
59
-
60
- * *Q: How can I use the old `image_tag` method?*
61
- * R: Try with `x_image_tag`
62
+ ```ruby
63
+ # config/initializers/lazyload.rb
64
+ Lazyload::Rails.configure do |config|
65
+ config.placeholder = "/public/img/grey.gif"
66
+ end
67
+ ```
62
68
 
63
69
  ## License
64
70
 
@@ -1,8 +1,7 @@
1
1
  require "nokogiri"
2
2
  require "action_view"
3
-
4
3
  require "lazyload-rails/version"
5
- require "lazyload-rails/configuration"
4
+ require "lazyload-rails/config"
6
5
 
7
6
  module Lazyload
8
7
  module Rails
@@ -68,5 +67,4 @@ ActionView::Helpers::AssetTagHelper.module_eval do
68
67
 
69
68
  [options, args]
70
69
  end
71
-
72
70
  end
@@ -22,7 +22,7 @@ module Lazyload
22
22
 
23
23
  # Set default settings
24
24
  def initialize
25
- @placeholder = "http://www.appelsiini.net/projects/lazyload/img/grey.gif"
25
+ @placeholder = "data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs="
26
26
  end
27
27
  end
28
28
  end
@@ -1,5 +1,5 @@
1
1
  module Lazyload
2
2
  module Rails
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazyload-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
- - Javier Saldana
7
+ - Javier Trevino Saldana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-17 00:00:00.000000000 Z
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -24,23 +24,51 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: test-unit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: actionpack
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - ">="
32
60
  - !ruby/object:Gem::Version
33
- version: '3.1'
61
+ version: '3'
34
62
  type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - ">="
39
67
  - !ruby/object:Gem::Version
40
- version: '3.1'
41
- description: lazyload-rails project integrates jQuery Lazy Load Plugin for Rails image_tag
68
+ version: '3'
69
+ description: lazyload-rails integrates jQuery's Lazy Load Plugin with Rails image_tag
42
70
  helpers
43
- email: javier@tractical.com
71
+ email: jts@dynamic.tech
44
72
  executables: []
45
73
  extensions: []
46
74
  extra_rdoc_files: []
@@ -48,7 +76,7 @@ files:
48
76
  - MIT-LICENSE
49
77
  - README.md
50
78
  - lib/lazyload-rails.rb
51
- - lib/lazyload-rails/configuration.rb
79
+ - lib/lazyload-rails/config.rb
52
80
  - lib/lazyload-rails/version.rb
53
81
  homepage: https://github.com/jassa/lazyload-rails
54
82
  licenses:
@@ -69,8 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
97
  - !ruby/object:Gem::Version
70
98
  version: '0'
71
99
  requirements: []
72
- rubyforge_project:
73
- rubygems_version: 2.2.2
100
+ rubygems_version: 3.0.1
74
101
  signing_key:
75
102
  specification_version: 4
76
103
  summary: jQuery Lazy Load for Rails image_tag helpers