quince 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: 2cb965782c941f40df31a058388f1c7e30864c5a1cf708f2840340bf014a3b16
4
- data.tar.gz: 235e3aa8b1a759799f996f2d2170582f628ac32a80a69bd4fab2838d91dd3a03
3
+ metadata.gz: 915108de103a8f53a56eec910ca301b090ad537b2b368f919750283fe7781ae4
4
+ data.tar.gz: e0ce22c06ac12cc12bf901aac59443e61e587bdf870af52c97faa0fe38cd65fd
5
5
  SHA512:
6
- metadata.gz: 8de7ca420355f54e90e5dc16517f670a6009ebf0d02f6fa45bbeddf2b92fb8eb9e05f8b1e1f9eec584aa6e283b9063146b8980b4b6c2b1463b4b104f6c967865
7
- data.tar.gz: 0ac305e40cab122d9865e030572c704897a8daa5f2fa1dbb6222976834690be58efe1c4a5e1049b3f1e86846af584795ff41c2eb547490783d626544db677100
6
+ metadata.gz: a7bf3cd3af27f2523d6d2b57ad4bcb121478bfa72cf71ae459f3bafe2a2a5a5ff2826acc645e3e7da3479df7548d32560b572e0bf09fa5101a631e819feb5a03
7
+ data.tar.gz: f063a5d900d22b5c66a9cbc674782e04873b02a51860bb0c74146fb854e34a53de74dc7200a365bb5bfa85f85caf5b9c0c81ead9c2990066139ebc6e5387f00d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quince (0.1.0)
4
+ quince (0.1.1)
5
5
  oj (~> 3.13)
6
6
  typed_struct (>= 0.1.4)
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quince
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/quince.rb CHANGED
@@ -4,3 +4,4 @@ require "cgi"
4
4
  require_relative "quince/singleton_methods"
5
5
  require_relative "quince/component"
6
6
  require_relative "quince/html_tag_components"
7
+ require_relative "quince/version"
data/scripts.js ADDED
@@ -0,0 +1,24 @@
1
+ const callRemoteEndpoint = (endpoint, payload, selector) => {
2
+ fetch(
3
+ endpoint,
4
+ {
5
+ method: `POST`,
6
+ headers: {
7
+ "Content-Type": `application/json;charset=utf-8`
8
+ },
9
+ body: payload,
10
+ }
11
+ ).then(resp => resp.text()).then(html => {
12
+ const element = document.querySelector(selector);
13
+ if (!element) {
14
+ throw `element not found for ${selector}`;
15
+ }
16
+
17
+ element.outerHTML = html
18
+ })
19
+ }
20
+
21
+ const getFormValues = (form) => {
22
+ const fd = new FormData(form);
23
+ return Object.fromEntries(fd.entries());
24
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quince
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Johansen
@@ -64,6 +64,7 @@ files:
64
64
  - lib/quince/types.rb
65
65
  - lib/quince/version.rb
66
66
  - quince.gemspec
67
+ - scripts.js
67
68
  homepage: https://github.com/johansenja/quince
68
69
  licenses:
69
70
  - MIT