retinajs-rails 2.1.2 → 2.1.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 +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/retina.js +2 -1
- data/app/assets/stylesheets/retina.less +56 -0
- data/retinajs-rails.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c9718e4e677a1e1d3b04ec78ac9263b2db5c55
|
4
|
+
data.tar.gz: '083a9cb8ef8259816e99c48f5579faa7f52c2ff0'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1895b373d20b88e25b27c2544f5862175aa29fcc00f5503e711c0da37fcade4b6a0df66c2b76f69cbcbbac85afddb6f05e0059b143de90207ca8679708aec558
|
7
|
+
data.tar.gz: 1006a4207dd051138bc8cd99f2c5ff3786006c0f5d9c659e6559188d69af85205a4621c857de1142f5daa5a4052029995bb6d662198fa477a9d8259481811944
|
data/README.md
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b():'function'==typeof define&&define.amd?define(b):a.retinajs=b()})(this,function(){'use strict';function a(a){return Array.prototype.slice.call(a)}function b(a){var b=parseInt(a,10);return k<b?k:b}function c(a){return a.hasAttribute('data-no-resize')||(0===a.offsetWidth&&0===a.offsetHeight?(a.setAttribute('width',a.naturalWidth),a.setAttribute('height',a.naturalHeight)):(a.setAttribute('width',a.offsetWidth),a.setAttribute('height',a.offsetHeight))),a}function d(a,b){var d=a.nodeName.toLowerCase(),e=document.createElement('img');e.addEventListener('load',function(){'img'===d?c(a).setAttribute('src',b):a.style.backgroundImage='url('+b+')'}),e.setAttribute('src',b),a.setAttribute(o,!0)}function e(a,c){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,f=b(e);if(c&&1<f){var g=c.replace(l,'@'+f+'x$1');d(a,g)}}function f(a,b,c){1<k&&d(a,c)}function g(b){return b?'function'==typeof b.forEach?b:a(b):'undefined'==typeof document?[]:a(document.querySelectorAll(n))}function h(a){return a.style.backgroundImage.replace(m,'$2')}function i(a){g(a).forEach(function(a){if(!a.getAttribute(o)){var b='img'===a.nodeName.toLowerCase(),c=b?a.getAttribute('src'):h(a),d=a.getAttribute('data-rjs'),g=!isNaN(parseInt(d,10));if(null===d)return;g?e(a,c,d):f(a,c,d)}})}var j='undefined'!=typeof window,k=Math.round(j?window.devicePixelRatio||1:1),l=/(\.[A-z]{3,4}\/?(\?.*)?)$/,m=/url\(('|")?([^)'"]+)('|")?\)/i,n='[data-rjs]',o='data-rjs-processed';return j&&(window.addEventListener('load',function(){i()}),window.retinajs=i),i});
|
2
|
+
//# sourceMappingURL=retina.min.js.map
|
@@ -0,0 +1,56 @@
|
|
1
|
+
// retina.less
|
2
|
+
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)
|
3
|
+
|
4
|
+
// Updated by John Newman
|
5
|
+
// github.com/jgnewman
|
6
|
+
// http://axial.agency
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Allows you to use retina images at various pixel densities.
|
10
|
+
* Examples:
|
11
|
+
*
|
12
|
+
* .retina(/images/mypic.jpg, 2);
|
13
|
+
* .retina(/images/mypic.jpg, 3, 100px 100px, left top no-repeat transparent);
|
14
|
+
*
|
15
|
+
* @param {String} $path The path to the file name minus extension.
|
16
|
+
* @param {Number} $cap: 2 The highest pixel density level images exist for.
|
17
|
+
* @param {Value} $size: auto auto The intended width of the rendered image.
|
18
|
+
* @param {Value} $extras: null Any other `background` values to be added.
|
19
|
+
*/
|
20
|
+
.retina(@path, @cap: 2, @size: auto auto, @extras: ~'') {
|
21
|
+
@lowretina: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
|
22
|
+
@2xpath: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`;
|
23
|
+
|
24
|
+
/*
|
25
|
+
* Set a base background for 1x environments.
|
26
|
+
*/
|
27
|
+
background: url(@path) @extras;
|
28
|
+
background-size: @size;
|
29
|
+
|
30
|
+
/*
|
31
|
+
* Create an @2x-ish media query.
|
32
|
+
*/
|
33
|
+
@media @lowretina {
|
34
|
+
background : url(@2xpath) @extras;
|
35
|
+
background-size : @size;
|
36
|
+
}
|
37
|
+
|
38
|
+
/*
|
39
|
+
* Create media queries for all environments that the user has
|
40
|
+
* provided images for.
|
41
|
+
*/
|
42
|
+
.create-queries() when (@cap >= 2) {
|
43
|
+
.loop(@env) when (@env <= @cap) {
|
44
|
+
@retinapath: ~`@{path}.replace(/\.\w+$/, function(match) { return "@@{env}x" + match; })`;
|
45
|
+
@media (-webkit-min-device-pixel-ratio: @env),
|
46
|
+
(min-resolution: @env * 96dpi) {
|
47
|
+
background : url(@retinapath) @extras;
|
48
|
+
background-size : @size;
|
49
|
+
}
|
50
|
+
.loop((@env + 1)); // next iteration
|
51
|
+
}
|
52
|
+
.loop(2);
|
53
|
+
}
|
54
|
+
.create-queries();
|
55
|
+
|
56
|
+
}
|
data/retinajs-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retinajs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Jansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Adds retina.js assets and image helpers to your Rails app
|
14
14
|
email:
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- ".gitignore"
|
21
21
|
- README.md
|
22
22
|
- app/assets/javascripts/retina.js
|
23
|
+
- app/assets/stylesheets/retina.less
|
23
24
|
- app/assets/stylesheets/retina.scss
|
24
25
|
- lib/retinajs-rails.rb
|
25
26
|
- retinajs-rails.gemspec
|
@@ -43,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
44
|
version: '0'
|
44
45
|
requirements: []
|
45
46
|
rubyforge_project:
|
46
|
-
rubygems_version: 2.
|
47
|
+
rubygems_version: 2.6.13
|
47
48
|
signing_key:
|
48
49
|
specification_version: 4
|
49
50
|
summary: This gem adds the retina.js assets to your asset pipeline and adds helper
|