onload-transformer 0.2.0 → 0.2.1
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 +2 -4
- data/lib/sprockets/onload_transformer.rb +3 -3
- data/lib/sprockets/onload_transformer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a086cd122118a3bfb9b74fbb4409b2efdf221464
|
4
|
+
data.tar.gz: 90585ac5d19051668ea1b07e35963a58116b9f7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
11
|
-
|
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});
|
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.
|
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-
|
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.
|
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
|