preflex 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/preflex/preferences_helper.rb +8 -2
- data/lib/preflex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 480b69bc648fbfeb5a69a9b4bc9d0bc99b954bd0e7b9476af0a5f03b9f6b9159
|
4
|
+
data.tar.gz: 6ccbd7b123a353b71a3f90ebe61fb124dfbf39e146fec0217ff557c9f656cb64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33c6c7bea76a5cc28a57c55a1f9534446c8acfb5e513a9b7b64f56986a7c6519004b068a8f98b99e7ff00f98087584bd5cfdd221fba4737c9d1e08ed05c670a1
|
7
|
+
data.tar.gz: d40abca380a989b8894a9a1dd30503c46362472dab7ff72dbea5fe3849d09f9cb56b1d1f3448df356c22d581192d205f22fda2ecf66fb9ba5e03621429391e57
|
@@ -3,7 +3,7 @@ module Preflex
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
# PREFLEX_PREFERENCE_JS = File.read(Preferences::Preflex::Engine.root.join("app", "static", "preflex_preference.js"))
|
6
|
-
def
|
6
|
+
def script_raw(*preference_klasses)
|
7
7
|
return ''.html_safe if preference_klasses.empty?
|
8
8
|
|
9
9
|
base = <<~JS
|
@@ -72,7 +72,13 @@ module Preflex
|
|
72
72
|
"window['#{klass.name}'] = new PreflexPreference('#{klass.name}', #{klass.current.data_for_js});"
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
js.join("\n")
|
76
|
+
end
|
77
|
+
|
78
|
+
def script_tag(*preference_klasses)
|
79
|
+
return ''.html_safe if preference_klasses.empty?
|
80
|
+
|
81
|
+
"<script data-turbo-eval=\"false\">#{script_raw(*preference_klasses)}</script>".html_safe
|
76
82
|
end
|
77
83
|
end
|
78
84
|
end
|
data/lib/preflex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: preflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|