retina_tag 1.2.2 → 1.3.0
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 +7 -0
- data/README.md +1 -1
- data/app/assets/javascripts/retina_tag.js +3 -3
- data/lib/retina_tag/engine.rb +2 -2
- data/lib/retina_tag/version.rb +1 -1
- data/retina_tag.gemspec +1 -1
- metadata +13 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 242a701fa20a5264fdfa733a6bd1a518384ec68a
|
4
|
+
data.tar.gz: c3166b701dc034733d1967ca40939842515e07d7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cd8db955b8b93de1dd99033c21b4ce738c82668bb3db97c438df321c81fe2c3b7e8ada02b24299c731d52f8c30727f7060be4dd9d1bad610eb0c040a6acc3e2e
|
7
|
+
data.tar.gz: d16c8250c8b529bd8ae0c159d19bdc361efc5059804c291a09d6cde5ca545a13882bd0668e8c9cada77f0546ec269be1e5490289804bb4fc4f2d2729844922e0
|
data/README.md
CHANGED
@@ -18,8 +18,8 @@ RetinaTag.updateImages = function() {
|
|
18
18
|
RetinaTag.refreshImage = function(image) {
|
19
19
|
var lazyLoad = image.getAttribute('data-lazy-load');
|
20
20
|
var imageSrc = image.src;
|
21
|
-
var hiDpiSrc = image.getAttribute('
|
22
|
-
var lowDpiSrc = image.getAttribute('
|
21
|
+
var hiDpiSrc = image.getAttribute('data-hidpi-src');
|
22
|
+
var lowDpiSrc = image.getAttribute('data-lowdpi-src');
|
23
23
|
if(!hiDpiSrc) {
|
24
24
|
return;
|
25
25
|
}
|
@@ -29,7 +29,7 @@ RetinaTag.refreshImage = function(image) {
|
|
29
29
|
}
|
30
30
|
if(window.devicePixelRatio > 1 && imageSrc != hiDpiSrc) {
|
31
31
|
if(!lowDpiSrc) {
|
32
|
-
image.setAttribute('
|
32
|
+
image.setAttribute('data-lowdpi-src',imageSrc);
|
33
33
|
}
|
34
34
|
image.src = hiDpiSrc;
|
35
35
|
}
|
data/lib/retina_tag/engine.rb
CHANGED
@@ -20,7 +20,7 @@ module RetinaTag
|
|
20
20
|
end
|
21
21
|
rescue
|
22
22
|
end
|
23
|
-
options_default = {
|
23
|
+
options_default = { "data-hidpi-src" => hidpi_asset_path }
|
24
24
|
|
25
25
|
if lazy = options.delete(:lazy)
|
26
26
|
options["data-lazy-load"] = lazy
|
@@ -30,7 +30,7 @@ module RetinaTag
|
|
30
30
|
image_tag_without_retina(source,options_default)
|
31
31
|
|
32
32
|
if options_default[:"data-lazy-load"]
|
33
|
-
options_default[
|
33
|
+
options_default["data-lowdpi-src"] = options_default.delete(:src)
|
34
34
|
end
|
35
35
|
|
36
36
|
tag("img", options_default)
|
data/lib/retina_tag/version.rb
CHANGED
data/retina_tag.gemspec
CHANGED
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retina_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- David Estes
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-03-10 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'
|
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'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: jquery-rails
|
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: :runtime
|
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
|
description: This gem overrides image_tag to support retina resolution images using
|
@@ -64,32 +59,25 @@ files:
|
|
64
59
|
homepage: http://github.com/davydotcom/retina_tag
|
65
60
|
licenses:
|
66
61
|
- MIT
|
62
|
+
metadata: {}
|
67
63
|
post_install_message:
|
68
64
|
rdoc_options: []
|
69
65
|
require_paths:
|
70
66
|
- lib
|
71
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
68
|
requirements:
|
74
|
-
- -
|
69
|
+
- - '>='
|
75
70
|
- !ruby/object:Gem::Version
|
76
71
|
version: '0'
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
hash: 1596883574543293708
|
80
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
73
|
requirements:
|
83
|
-
- -
|
74
|
+
- - '>='
|
84
75
|
- !ruby/object:Gem::Version
|
85
76
|
version: '0'
|
86
|
-
segments:
|
87
|
-
- 0
|
88
|
-
hash: 1596883574543293708
|
89
77
|
requirements: []
|
90
78
|
rubyforge_project:
|
91
|
-
rubygems_version:
|
79
|
+
rubygems_version: 2.2.2
|
92
80
|
signing_key:
|
93
|
-
specification_version:
|
81
|
+
specification_version: 4
|
94
82
|
summary: image_tag addon for retina graphics, with cache support.
|
95
83
|
test_files: []
|