lazy_images-rails 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e66aaa6e5145e030de75aaef69c851d46ca40397
4
- data.tar.gz: 36963484361df144ffa2348ebf3462de3379d6c3
3
+ metadata.gz: 4e04e640737f6513419b155d720398f6dd061f33
4
+ data.tar.gz: 37ba112b2864c07d38b8f72a94024d619695194d
5
5
  SHA512:
6
- metadata.gz: 18ebf1e4734915ae5d572b4bacc982771cfc675199d89955eb8e0c062863eeb48d36e1fa1a3dba49d168f43cbb66bd0768af7943c117ba13e90e3579f9332d6b
7
- data.tar.gz: f92042d774b1305b5413f7e89de70fc54594f9d2659237d3c63cc7cdd46e51e6c1df111a9d046fdf6038966c34db44b9b27328f987079012a9e4c0070b19aa71
6
+ metadata.gz: 00c11f340c027d65af7a266153a5314018c1e7923058c02115bbef6fb2f2af761641f5a54f9a7e9daf3eaa4499ce59e8a58a7f5168724abf5ad4fa459ce53852
7
+ data.tar.gz: 29725e238fba4fa4c7dfb75248d5489dfd9f5b19118c448e16575d689e7301be52fd0e2667cdf65e79f6745536657fd3f5f16186741f10748046babaa99dbcc1
@@ -0,0 +1,4 @@
1
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="rli-placeholder">
2
+ <path class="moon" d="M832 288c0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96 96 42.98 96 96z"></path>
3
+ <path class="mountain" d="M896 832h-768v-128l224-384 256 320h64l224-192z"></path>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ gem_path = File.expand_path("../../..", __FILE__)
2
+ placeholder_path = "#{gem_path}/app/assets/images/placeholder.svg"
3
+ LazyImages::Rails.placeholder ||= File.read(placeholder_path)
@@ -1,5 +1,7 @@
1
1
  module LazyImages
2
2
  module Rails
3
+ mattr_accessor :placeholder
4
+
3
5
  module TagHelper
4
6
  def self.included(base)
5
7
  base.alias_method_chain :image_tag, :lazy_images
@@ -10,12 +12,7 @@ module LazyImages
10
12
  data = { rli_image_src: src, rli_placeholder: true }
11
13
 
12
14
  content_tag(:div, data: data, class: 'rli-wrapper') do
13
- %(
14
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" class="rli-placeholder">
15
- <path class="moon" d="M832 288c0 53.020-42.98 96-96 96s-96-42.98-96-96 42.98-96 96-96 96 42.98 96 96z"></path>
16
- <path class="mountain" d="M896 832h-768v-128l224-384 256 320h64l224-192z"></path>
17
- </svg>
18
- ).html_safe + content_tag(:noscript) do
15
+ LazyImages::Rails.placeholder.html_safe + content_tag(:noscript) do
19
16
  options[:src] = src
20
17
  options[:class] = "#{options[:class]} rli-image"
21
18
  image_tag_without_lazy_images(source, options)
@@ -1,5 +1,5 @@
1
1
  module LazyImages
2
2
  module Rails
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_images-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - René Hansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-18 00:00:00.000000000 Z
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -62,8 +62,10 @@ extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
64
  - MIT-LICENSE
65
+ - app/assets/images/placeholder.svg
65
66
  - app/assets/javascripts/lazy_images_rails.js.coffee
66
67
  - app/assets/stylesheets/lazy_images_rails.css.scss
68
+ - config/initializers/lazy_images-rails.rb
67
69
  - lib/lazy_images-rails.rb
68
70
  - lib/lazy_images/rails/engine.rb
69
71
  - lib/lazy_images/rails/tag_helper.rb