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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a070ca0daac5fbe11703a8c4b3c65555cd4722ea
4
- data.tar.gz: 8333942ca60d252a8c2b6929465cad8f701971d7
3
+ metadata.gz: d0c9718e4e677a1e1d3b04ec78ac9263b2db5c55
4
+ data.tar.gz: '083a9cb8ef8259816e99c48f5579faa7f52c2ff0'
5
5
  SHA512:
6
- metadata.gz: 363753be262a278d0e48073d452562a36f99119f068488e6bace934507fd8bd659fdd57ade629e589ecea19b0c78a98e9ca69d9aaeb1a5a7a7ec80908bb814c5
7
- data.tar.gz: ecab4a813b04600cfd0d4730431a5de890aba804fd9f6b046596e1f3ec0bcbfb81555320fda00b5e30fea5aba6ce4622d054048fedc19f9a33b14c40c2afdc37
6
+ metadata.gz: 1895b373d20b88e25b27c2544f5862175aa29fcc00f5503e711c0da37fcade4b6a0df66c2b76f69cbcbbac85afddb6f05e0059b143de90207ca8679708aec558
7
+ data.tar.gz: 1006a4207dd051138bc8cd99f2c5ff3786006c0f5d9c659e6559188d69af85205a4621c857de1142f5daa5a4052029995bb6d662198fa477a9d8259481811944
data/README.md CHANGED
@@ -8,7 +8,7 @@ Retina.js is an awesome and simple plugin for rendering retina images for displa
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem "retinajs-rails", "~> 2.1.1"
11
+ gem "retinajs-rails", "~> 2.1.3"
12
12
 
13
13
  And then execute:
14
14
 
@@ -1 +1,2 @@
1
- !function(){function t(t){return Array.prototype.slice.call(t)}function e(t){var e=parseInt(t,10);return e>f?f:e}function r(t){return t.hasAttribute("data-no-resize")||(0===t.offsetWidth&&0===t.offsetHeight?(t.setAttribute("width",t.naturalWidth),t.setAttribute("height",t.naturalHeight)):(t.setAttribute("width",t.offsetWidth),t.setAttribute("height",t.offsetHeight))),t}function n(t,e){var n=t.nodeName.toLowerCase(),i=document.createElement("img");i.addEventListener("load",function(){"img"===n?r(t).setAttribute("src",e):t.style.backgroundImage="url("+e+")"}),i.setAttribute("src",e),t.setAttribute(h,!0)}function i(t,r){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2],o=e(i);if(r&&o>1){var a=r.replace(c,"@"+o+"x$1");n(t,a)}}function o(t,e,r){f>1&&n(t,r)}function a(e){return e?"function"==typeof e.forEach?e:t(e):"undefined"!=typeof document?t(document.querySelectorAll(g)):[]}function u(t){return t.style.backgroundImage.replace(l,"$2")}function d(t){a(t).forEach(function(t){if(!t.getAttribute(h)){var e="img"===t.nodeName.toLowerCase(),r=e?t.getAttribute("src"):u(t),n=t.getAttribute("data-rjs"),a=!isNaN(parseInt(n,10));a?i(t,r,n):o(t,r,n)}})}"undefined"==typeof exports&&(exports={}),Object.defineProperty(exports,"__esModule",{value:!0});var s="undefined"!=typeof window,f=s?window.devicePixelRatio||1:1,c=/(\.[A-z]{3,4}\/?(\?.*)?)$/,l=/url\(('|")?([^\)'"]+)('|")?\)/i,g="[data-rjs]",h="data-rjs-processed";s&&(window.addEventListener("load",d),window.retinajs=d),exports["default"]=d}();
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
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'retinajs-rails'
5
- gem.version = '2.1.2'
5
+ gem.version = '2.1.3'
6
6
  gem.date = Date.today
7
7
  gem.authors = ["Joshua Jansen"]
8
8
  gem.email = ["joshuajansen88@gmail.com"]
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.2
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: 2016-09-08 00:00:00.000000000 Z
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.5.1
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