c80_lazy_images 0.1.0 → 0.1.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf398a453ec909d5642cf8808eacb57edfb98984
|
4
|
+
data.tar.gz: 33d36cac560fa67c80ad8441696b0d95a37044fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735073664c93d6a3bbc3eefa38e501f3c7862edece3b9898ba4042991d8ef19f776ec33bdda7d6549c2f29fa8def896a01a7a34971642165027de733b5d5eb33
|
7
|
+
data.tar.gz: d6ff80f4ae7f96179f602f4dd7b36fc2d91a91e4ab8f248dc1a0848a483cfccf27d2ee7132468f8d1665ff09b92612de954bf04a986be85d5ecb1a0b5e735bc6
|
@@ -0,0 +1 @@
|
|
1
|
+
# require_directory ./lib
|
@@ -15,6 +15,9 @@ module C80LazyImages
|
|
15
15
|
# :style
|
16
16
|
# }
|
17
17
|
|
18
|
+
image_width = options.fetch(:image_width, '')
|
19
|
+
image_height = options.fetch(:image_height, '')
|
20
|
+
|
18
21
|
alt_image = options.fetch(:alt_image, '')
|
19
22
|
image = options.fetch(:image, '1px_invisible.gif')
|
20
23
|
a_href = options.fetch(:a_href, '/')
|
@@ -24,16 +27,18 @@ module C80LazyImages
|
|
24
27
|
a_css_style = options.fetch(:a_css_style, '')
|
25
28
|
a_rel = options.fetch(:a_rel, 'follow')
|
26
29
|
|
27
|
-
render :
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
30
|
+
render partial: 'c80_lazy_images/image_link_lazy',
|
31
|
+
locals: {
|
32
|
+
alt_image: alt_image,
|
33
|
+
image: image,
|
34
|
+
image_width: image_width,
|
35
|
+
image_height: image_height,
|
36
|
+
a_href: a_href,
|
37
|
+
aid: aid,
|
38
|
+
a_class: a_class,
|
39
|
+
target: target,
|
40
|
+
a_css_style: a_css_style,
|
41
|
+
a_rel: a_rel
|
37
42
|
}
|
38
43
|
end
|
39
44
|
|
@@ -2,7 +2,16 @@
|
|
2
2
|
# отрисовывается только с помощью метода хелпера render_image_link_lazy
|
3
3
|
%>
|
4
4
|
<a class="lazy-image-wrapper <%= a_class %>" id='<%= aid %>' title="<%= alt_image %>" href="<%= a_href %>" target="<%= target %>" style="<%= a_css_style %>" rel="<%= a_rel %>">
|
5
|
-
|
5
|
+
|
6
|
+
<% ww = image_width %>
|
7
|
+
<% hh = image_height %>
|
8
|
+
<% src = image_path('1px_invisible.gif') %>
|
9
|
+
|
10
|
+
<% if image_width.blank? || image_height.blank? %>
|
11
|
+
<img data-original='<%= image_path(image) %>' alt="<%= alt_image %>" src="<%= src %>">
|
12
|
+
<% else %>
|
13
|
+
<img data-original='<%= image_path(image) %>' alt="<%= alt_image %>" src="<%= src %>" width="<%=ww%>" height="<%=hh%>">
|
14
|
+
<% end %>
|
6
15
|
<noscript>
|
7
16
|
<img src="<%=image_path(image)%>" alt="<%= alt_image %>">
|
8
17
|
</noscript>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_lazy_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- app/assets/images/1px_invisible.gif
|
69
|
+
- app/assets/javascripts/c80_lazy_images.js.coffee
|
69
70
|
- app/assets/stylesheets/c80_lazy_images.scss
|
70
71
|
- app/assets/stylesheets/c80_lazy_images/lazy-image-wrapper.scss
|
71
72
|
- app/helpers/c80_lazy_images/lazy_images_helper.rb
|
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
version: '0'
|
97
98
|
requirements: []
|
98
99
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.6.11
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
103
|
summary: Lazy images helper and partials
|