quince 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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/quince/attributes_by_element.rb +5 -0
- data/lib/quince/html_tag_components.rb +7 -4
- data/lib/quince/version.rb +1 -1
- data/scripts.js +5 -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: 1b5c0ef933d95f7026239bcfc5685e4aeb1582382056725b245cd37838540bf4
|
4
|
+
data.tar.gz: c790f0bc40602888167f46bf9636c55a739d5191645fd43e3614c78e381c6d1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f561f03a959ed9fb221d0462f8901fe9f0cb20bda9e80ede4757a6a5cf89c979da5f80c135054454ef64ad5ddec09751a23088fe08762084b13c097c56db3c
|
7
|
+
data.tar.gz: 47f28845aad32b4ba53f76acf4fab7695c903cb8d94197b6ac0096f16a2f048684f5677d35edeaa0c06554ae19d32152294f878e5ef5e8cbd9eccd581671389a
|
data/Gemfile.lock
CHANGED
@@ -45,10 +45,13 @@ module Quince
|
|
45
45
|
CGI.escape_html(
|
46
46
|
"callRemoteEndpoint(`/api/#{owner}/#{name}`,`#{payload}`,`#{selector}`)"
|
47
47
|
)
|
48
|
-
when :onsubmit
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
when :onsubmit, :onchange, :onblur, :onsearch, :onkeyup, :onselect
|
49
|
+
ev = "const p = #{payload}; callRemoteEndpoint( `/api/#{owner}/#{name}`, JSON.stringify({...p, params: getFormValues(this)}), `#{selector}`)"
|
50
|
+
case key
|
51
|
+
when :onsubmit
|
52
|
+
ev += "; return false"
|
53
|
+
end
|
54
|
+
CGI.escape_html(ev)
|
52
55
|
end
|
53
56
|
when true
|
54
57
|
return key
|
data/lib/quince/version.rb
CHANGED
data/scripts.js
CHANGED
@@ -18,7 +18,11 @@ const callRemoteEndpoint = (endpoint, payload, selector) => {
|
|
18
18
|
})
|
19
19
|
}
|
20
20
|
|
21
|
-
const getFormValues = (
|
21
|
+
const getFormValues = (elem) => {
|
22
|
+
let form = elem.localName === "form" ? elem : elem.form;
|
23
|
+
if (!form) {
|
24
|
+
throw `element ${elem} should belong to a form`;
|
25
|
+
}
|
22
26
|
const fd = new FormData(form);
|
23
27
|
return Object.fromEntries(fd.entries());
|
24
28
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quince
|
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
|
- Joseph Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typed_struct
|