jquery-lazy-images 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +8 -15
- data/lib/action_view/helpers/image_tag_helper.rb +14 -13
- data/lib/jquery-lazy-images/version.rb +1 -1
- metadata +28 -44
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4d4fb93ea11bdd3afa29c00e3b5b5d0ce1f97cc4
|
4
|
+
data.tar.gz: f6170288aa8f2671f79c49734ed6c623fe89e2a5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fe55589083da0433742adf2837158b83c7b6ea4be6c2cd0e8a2fb4cef8821b081542885431321d1ecf1cff198f1c1e9d38463c7a0916c380f6c7e98550fa5061
|
7
|
+
data.tar.gz: 6bea4a75fbded9e779763f30ce068e55363ccb22b55124b7bbcf05f04acc13153d697db90fafcdcdcd132ac5c20b55e549aef67a4669148b7987779905a79b2c
|
data/Rakefile
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
begin
|
8
|
-
require 'rdoc/task'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
require 'rdoc/task'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
desc "Run specs"
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
14
7
|
|
15
8
|
RDoc::Task.new(:rdoc) do |rdoc|
|
16
9
|
rdoc.rdoc_dir = 'rdoc'
|
@@ -20,8 +13,8 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
20
13
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
14
|
end
|
22
15
|
|
23
|
-
|
24
|
-
|
16
|
+
desc 'Default: run specs.'
|
17
|
+
task :default => :spec
|
25
18
|
|
26
19
|
Bundler::GemHelper.install_tasks
|
27
20
|
|
@@ -1,21 +1,22 @@
|
|
1
1
|
module ActionView
|
2
2
|
module Helpers
|
3
|
+
module AssetTagHelper
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
def image_tag_with_laziness(source, options={})
|
6
|
+
options = options.symbolize_keys
|
7
|
+
orig_options = options.dup
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
options[:data] ||= {}
|
10
|
+
options[:data] = {original: path_to_image(source)}
|
11
|
+
options[:class] ||= ""
|
12
|
+
options[:class] << " lazy"
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
alias_method :eager_image_tag, :image_tag
|
18
|
-
alias_method_chain :image_tag, :laziness
|
14
|
+
output = image_tag_without_laziness('grey.gif', options)
|
15
|
+
output << content_tag('noscript', image_tag_without_laziness(source, orig_options))
|
16
|
+
end
|
19
17
|
|
18
|
+
alias_method :eager_image_tag, :image_tag
|
19
|
+
alias_method_chain :image_tag, :laziness
|
20
|
+
end
|
20
21
|
end
|
21
22
|
end
|
metadata
CHANGED
@@ -1,132 +1,117 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-lazy-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Singlebrook Technology
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 3.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 3.1.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: capybara
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: guard-rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: guard-spork
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: poltergeist
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rb-fsevent
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: rspec-rails
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - '>='
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
|
-
description:
|
127
|
-
|
128
|
-
|
129
|
-
|
111
|
+
description: |-
|
112
|
+
Why make the browser load images that the user isn't going to see?
|
113
|
+
This Rails engine prevents images from loading until they're actually going to be displayed.
|
114
|
+
This saves bandwidth, reduces server load, and helps the user stay under their data quota.
|
130
115
|
email:
|
131
116
|
- leon@singlebrook.com
|
132
117
|
executables: []
|
@@ -147,7 +132,8 @@ files:
|
|
147
132
|
- Rakefile
|
148
133
|
homepage: https://github.com/singlebrook/jquery-lazy-images
|
149
134
|
licenses: []
|
150
|
-
|
135
|
+
metadata: {}
|
136
|
+
post_install_message: "If you use image_tag in your email templates, please change
|
151
137
|
it to\n eager_image_tag. If you don't, your email messages WILL LOOK WRONG!\n
|
152
138
|
\ This DANGEROUS command might make those changes for you:\n sed -i 's/image_tag/eager_image_tag/g'
|
153
139
|
app/views/*_mailer/*\n "
|
@@ -155,21 +141,19 @@ rdoc_options: []
|
|
155
141
|
require_paths:
|
156
142
|
- lib
|
157
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
-
none: false
|
159
144
|
requirements:
|
160
|
-
- -
|
145
|
+
- - '>='
|
161
146
|
- !ruby/object:Gem::Version
|
162
147
|
version: '0'
|
163
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
149
|
requirements:
|
166
|
-
- -
|
150
|
+
- - '>='
|
167
151
|
- !ruby/object:Gem::Version
|
168
152
|
version: '0'
|
169
153
|
requirements: []
|
170
154
|
rubyforge_project:
|
171
|
-
rubygems_version:
|
155
|
+
rubygems_version: 2.0.3
|
172
156
|
signing_key:
|
173
|
-
specification_version:
|
157
|
+
specification_version: 4
|
174
158
|
summary: Load all images in your Rails app lazily (i.e. only when they are visible).
|
175
159
|
test_files: []
|