onload-transformer 0.2.0 → 0.2.1

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: fc48aa1c187e9a812f198ff52b38cc0206f45749
4
- data.tar.gz: 289f674f9f154994bdf625c8f50de266fc541319
3
+ metadata.gz: a086cd122118a3bfb9b74fbb4409b2efdf221464
4
+ data.tar.gz: 90585ac5d19051668ea1b07e35963a58116b9f7e
5
5
  SHA512:
6
- metadata.gz: 951abd2dfece8bbb097f77143d5194f25919651ff889f128d2b55a642eccd80b64030346cc57ce58807377360956f8e9335cdf6d9cda0794600f9721753cc325
7
- data.tar.gz: 5a0086a6edd3e315e29c24d098dcede4330923f2c95a80f8516b215fdb1e60cd3c84226a98a6bd95e15fbd5efccb5303562d36327d009ec5563b859cdc0df59b
6
+ metadata.gz: 3d1435bfacadb75dfd7a289587503aeffda8eb8a0d3c7f32a936b9b8e7b55c8afb6d81fdbe7ae13194dd815968aec164eaec24e7322cfde5de9a3c8174f5aa20
7
+ data.tar.gz: e0d6fd343b702a38c530c844b5fad47c8e1c41723e58cb129a6a68bfed02b57edffd155d8df8505f33f39d46ca04a1a0269f33d46f0f921829d4802d28767b2d
data/README.md CHANGED
@@ -21,7 +21,5 @@ It just wraps the whole file in a function and then binds it to the `DOMContentL
21
21
  ## What? (can be improved)
22
22
 
23
23
  Probably a lot of stuff, but at least:
24
-
25
- [ ] - The functions used to wrap the body of the file are in the global namespace. It would be better if they were defined on a transformer-only object.
26
- [ ] - Make it so it can be used with .js.erb / .js.coffee (maybe ?)
27
-
24
+ - [ ] The functions used to wrap the body of the file are in the global namespace. It would be better if they were defined on a transformer-only object.
25
+ - [ ] Make it so it can be used with .js.erb / .js.coffee (maybe ?)
@@ -7,9 +7,9 @@ module Sprockets
7
7
  body = input[:data]
8
8
  util_function_name = "onloadTransformerUtil#{to_function_key(asset_name)}"
9
9
  wrapped_in_event = <<-JS
10
- function #{util_function_name}() {
11
- #{body}
12
- };
10
+ var #{util_function_name} = (function() {
11
+ #{body}
12
+ }).bind(this)
13
13
 
14
14
  if (document.readyState === "loading") {
15
15
  document.addEventListener("DOMContentLoaded", #{util_function_name});
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  class OnloadTransformer
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onload-transformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémie Bonal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
- rubygems_version: 2.5.2.2
67
+ rubygems_version: 2.6.14
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: A short extension of Sprockets to wrap JS libs so they wait for DOMContentLoaded