glib-web 0.12.1 → 0.13.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/app/helpers/glib/json_ui/action_builder/commands.rb +1 -0
- data/app/helpers/glib/json_ui/action_builder/components.rb +9 -0
- data/app/helpers/glib/json_ui/action_builder/http.rb +5 -2
- data/app/helpers/glib/json_ui/action_builder/tours.rb +3 -0
- data/app/helpers/glib/json_ui/response_helper.rb +19 -2
- data/app/helpers/glib/json_ui/view_builder/panels.rb +6 -0
- data/app/helpers/glib/json_ui/view_builder.rb +1 -0
- data/app/views/json_ui/garage/forms/basic.json.jbuilder +1 -0
- data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +7 -1
- data/app/views/json_ui/garage/forms/{disable_dirty_prompt.json.jbuilder → dirty_prompt.json.jbuilder} +8 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +7 -7
- data/app/views/json_ui/garage/forms/page_update_on_response.json.jbuilder +57 -0
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +2 -1
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +2 -2
- data/app/views/json_ui/garage/forms/text_validation.json.jbuilder +42 -4
- data/app/views/json_ui/garage/lists/edit_mode.json.jbuilder +12 -1
- data/app/views/json_ui/garage/views/shareButton.json.jbuilder +62 -40
- metadata +4 -3
- data/app/views/json_ui/garage/forms/get_request.json.jbuilder +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c216d9d31f88411766f7e38ec86bf4e993032c487562a33728a972587ee5a8ad
|
4
|
+
data.tar.gz: fb975c7d55c06b0db38dba2df8c2756ba62d6b79a13d678d36901cd590428872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f406a24519cf923a5603a53f77a6ad68dcecfcb3408ef902833f8022de5463d76b4670c450173917d4690c63e34935b9883c2f3b6924c54101764155ab41a289
|
7
|
+
data.tar.gz: e284fe2ac21627346f026b5c520152b466fb9a1b155ec44a70d55222d297c390c6916d40c4d48db300002f93617c2466288377e9ad8aa4ca960c0d098427cfcb
|
@@ -22,6 +22,9 @@ class Glib::JsonUi::ActionBuilder
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
class Get < AbstractHttp
|
26
|
+
end
|
27
|
+
|
25
28
|
class Post < AbstractHttp
|
26
29
|
end
|
27
30
|
|
@@ -31,8 +34,8 @@ class Glib::JsonUi::ActionBuilder
|
|
31
34
|
end
|
32
35
|
|
33
36
|
class Delete < AbstractHttp
|
34
|
-
|
35
|
-
|
37
|
+
# string :url, cache: true
|
38
|
+
# hash :formData
|
36
39
|
end
|
37
40
|
|
38
41
|
end
|
@@ -10,14 +10,31 @@ module Glib
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
def json_ui_response_with_view(json)
|
14
|
+
json.analytics do
|
15
|
+
json.disabled true
|
16
|
+
end
|
17
|
+
|
18
|
+
json.onResponse do
|
19
|
+
response = Response.new(json, self, true)
|
20
|
+
yield response.action_builder
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
class Response
|
14
|
-
attr_reader :action_builder
|
25
|
+
attr_reader :action_builder, :view_builder, :list_section_builder, :table_section_builder, :current_form
|
15
26
|
|
16
|
-
def initialize(json, context)
|
27
|
+
def initialize(json, context, with_view_builder = false)
|
17
28
|
@json = json
|
18
29
|
@context = context
|
19
30
|
|
20
31
|
@action_builder = ActionBuilder.new(json, self, false)
|
32
|
+
|
33
|
+
if with_view_builder
|
34
|
+
@view_builder = ViewBuilder.new(json, self, true)
|
35
|
+
@list_section_builder = ListBuilders::Section.new(json, self, ListBuilders::Template.new(json, self))
|
36
|
+
@table_section_builder = TableBuilders::Section.new(json, self, TableBuilders::Template.new(json, self))
|
37
|
+
end
|
21
38
|
end
|
22
39
|
end
|
23
40
|
end
|
@@ -112,11 +112,17 @@ class Glib::JsonUi::ViewBuilder
|
|
112
112
|
end
|
113
113
|
|
114
114
|
class List < View
|
115
|
+
# Setting this will turn the list into edit mode.
|
115
116
|
string :fieldPrefix
|
117
|
+
|
118
|
+
# Setting this will enable title editing.
|
116
119
|
string :fieldTitleName
|
117
120
|
string :fieldSubtitleName
|
118
121
|
string :fieldSubsubtitleName
|
119
122
|
|
123
|
+
# This can be used to implement "check all" and "uncheck all".
|
124
|
+
hash :fieldCheckValueIf
|
125
|
+
|
120
126
|
hash :phoenixSocket
|
121
127
|
hash :actionCable
|
122
128
|
|
@@ -12,6 +12,7 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
12
12
|
left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
|
13
13
|
case params[:mode]
|
14
14
|
when 'dialog'
|
15
|
+
horizontal.fields_hidden name: 'mode', value: 'dialog'
|
15
16
|
horizontal.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
|
16
17
|
when 'dialog_reload'
|
17
18
|
horizontal.button styleClass: 'link', text: 'back', onClick: ->(action) do
|
@@ -3,6 +3,12 @@ json_ui_response json do |action|
|
|
3
3
|
if !name.present?
|
4
4
|
action.dialogs_alert message: 'Please enter name'
|
5
5
|
else
|
6
|
-
|
6
|
+
if params[:mode] == 'dialog'
|
7
|
+
action.dialogs_close onClose: ->(subaction) do
|
8
|
+
render "#{@path_prefix}/forms/alert_post_data", action: subaction
|
9
|
+
end
|
10
|
+
else
|
11
|
+
render "#{@path_prefix}/forms/alert_post_data", action: action
|
12
|
+
end
|
7
13
|
end
|
8
14
|
end
|
@@ -22,6 +22,14 @@ page.form \
|
|
22
22
|
form.fields_text name: 'user[dirty_check_disabled]', width: 'matchParent', label: 'Dirty check disabled', disableDirtyCheck: true
|
23
23
|
|
24
24
|
form.panels_split width: 'matchParent', content: ->(split) do
|
25
|
+
split.left childViews: ->(left) do
|
26
|
+
left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
|
27
|
+
horizontal.label text: 'Dialog Form', onClick: ->(action) do
|
28
|
+
action.dialogs_open url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
25
33
|
split.right childViews: ->(right) do
|
26
34
|
right.fields_submit text: 'Submit'
|
27
35
|
end
|
@@ -19,14 +19,14 @@ page.list sections: [
|
|
19
19
|
template.thumbnail title: 'Submission Indicator', onClick: ->(action) do
|
20
20
|
action.windows_open url: json_ui_garage_url(path: 'forms/submission_indicator')
|
21
21
|
end
|
22
|
-
template.thumbnail title: '
|
23
|
-
action.windows_open url: json_ui_garage_url(path: 'forms/
|
22
|
+
template.thumbnail title: 'Page Update on Response', onClick: ->(action) do
|
23
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/page_update_on_response')
|
24
24
|
end
|
25
25
|
template.thumbnail title: 'Synchronous Request', onClick: ->(action) do
|
26
26
|
action.windows_open url: json_ui_garage_url(path: 'forms/local_request')
|
27
27
|
end
|
28
|
-
template.thumbnail title: '
|
29
|
-
action.windows_open url: json_ui_garage_url(path: 'forms/
|
28
|
+
template.thumbnail title: 'Dirty Prompt', onClick: ->(action) do
|
29
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/dirty_prompt')
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -63,6 +63,9 @@ page.list sections: [
|
|
63
63
|
template.thumbnail title: 'Select Fields', onClick: ->(action) do
|
64
64
|
action.windows_open url: json_ui_garage_url(path: 'forms/selects')
|
65
65
|
end
|
66
|
+
template.thumbnail title: 'Checkboxes', onClick: ->(action) do
|
67
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/checkboxes')
|
68
|
+
end
|
66
69
|
template.thumbnail title: 'File Upload', onClick: ->(action) do
|
67
70
|
action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
|
68
71
|
end
|
@@ -117,9 +120,6 @@ page.list sections: [
|
|
117
120
|
template.thumbnail title: 'Dynamic Select', onClick: ->(action) do
|
118
121
|
action.windows_open url: json_ui_garage_url(path: 'forms/dynamic_select')
|
119
122
|
end
|
120
|
-
template.thumbnail title: 'Checkboxes', onClick: ->(action) do
|
121
|
-
action.windows_open url: json_ui_garage_url(path: 'forms/checkboxes')
|
122
|
-
end
|
123
123
|
|
124
124
|
end
|
125
125
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
data = params[:user] || {}
|
4
|
+
|
5
|
+
page = json_ui_page json
|
6
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
7
|
+
|
8
|
+
# page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', padding: glib_json_padding_body, childViews: ->(form) do
|
9
|
+
page.scroll childViews: ->(scroll) do
|
10
|
+
scroll.panels_form \
|
11
|
+
width: 'matchParent',
|
12
|
+
url: json_ui_garage_url(path: 'forms/get_request'),
|
13
|
+
method: 'get',
|
14
|
+
padding: glib_json_padding_body,
|
15
|
+
childViews: ->(form) do
|
16
|
+
form.h2 text: 'GET Request'
|
17
|
+
form.label text: 'On the web, upon submit, URL needs to change on the browser'
|
18
|
+
form.spacer height: 10
|
19
|
+
|
20
|
+
# TODO: Potential improvement:
|
21
|
+
# Use `reload` behaviour instead of `open` (i.e. don't keep adding URL to history).
|
22
|
+
# Probably introduce a flag to panels_form so developer can enable/disable this behaviour.
|
23
|
+
form.markdown text: "Hello **#{ data[:name] }**"
|
24
|
+
form.spacer height: 6
|
25
|
+
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
26
|
+
|
27
|
+
form.spacer height: 6
|
28
|
+
form.panels_split width: 'matchParent', content: ->(split) do
|
29
|
+
split.right childViews: ->(right) do
|
30
|
+
right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
scroll.panels_form \
|
36
|
+
width: 'matchParent',
|
37
|
+
url: json_ui_garage_url(path: 'forms/get_request'),
|
38
|
+
method: 'post',
|
39
|
+
padding: glib_json_padding_body,
|
40
|
+
childViews: ->(form) do
|
41
|
+
form.h2 text: 'POST Request'
|
42
|
+
form.label text: 'This produces the same effect as the form above, but the browser URL will not change in this case.'
|
43
|
+
form.spacer height: 10
|
44
|
+
|
45
|
+
form.markdown text: "Hello **#{ data[:name] }**"
|
46
|
+
form.spacer height: 6
|
47
|
+
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
48
|
+
|
49
|
+
form.spacer height: 6
|
50
|
+
form.panels_split width: 'matchParent', content: ->(split) do
|
51
|
+
split.right childViews: ->(right) do
|
52
|
+
right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -31,7 +31,8 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
31
31
|
end
|
32
32
|
|
33
33
|
json.imageUploader do
|
34
|
-
json.
|
34
|
+
json.name 'user[images_attributes][]'
|
35
|
+
json.accepts(fileType: 'image/*', maxFileSize: 5000)
|
35
36
|
json.directUploadUrl rails_direct_uploads_url
|
36
37
|
end
|
37
38
|
end
|
@@ -15,8 +15,8 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
15
15
|
'melbourne' => 'Melbourne',
|
16
16
|
'sydney' => 'Sydney',
|
17
17
|
}
|
18
|
-
form.fields_select name: 'user[city]', width: 'matchParent', label: '
|
19
|
-
form.fields_select name: 'user[cities][]', width: 'matchParent', label: '
|
18
|
+
form.fields_select name: 'user[city]', width: 'matchParent', label: 'City', options: languages.map { |k, v| { value: k, text: v } }, value: 'canberra'
|
19
|
+
form.fields_select name: 'user[cities][]', width: 'matchParent', label: 'Cities', options: languages.map { |k, v| { value: k, text: v } }, value: ['melbourne', 'sydney'], multiple: true
|
20
20
|
|
21
21
|
form.spacer height: 20
|
22
22
|
form.h2 text: 'Select fields with grouping'
|
@@ -52,13 +52,51 @@ page.form \
|
|
52
52
|
maxLength: 50,
|
53
53
|
validation: { required: { message: 'Required' } }
|
54
54
|
|
55
|
-
options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
|
55
|
+
# options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
|
56
|
+
# form.fields_select \
|
57
|
+
# name: 'user[gender]',
|
58
|
+
# width: 'matchParent',
|
59
|
+
# label: 'Gender',
|
60
|
+
# validation: { required: { message: 'Required' } },
|
61
|
+
# options: options
|
62
|
+
|
63
|
+
languages = {
|
64
|
+
'brisbane' => 'Brisbane',
|
65
|
+
'canberra' => 'Canberra',
|
66
|
+
'melbourne' => 'Melbourne',
|
67
|
+
'sydney' => 'Sydney',
|
68
|
+
}
|
56
69
|
form.fields_select \
|
57
|
-
name: 'user[
|
70
|
+
name: 'user[city]',
|
58
71
|
width: 'matchParent',
|
59
|
-
label: '
|
72
|
+
label: 'City',
|
73
|
+
options: languages.map { |k, v| { value: k, text: v } },
|
74
|
+
validation: { required: { message: 'Required' } }
|
75
|
+
|
76
|
+
form.spacer height: 10
|
77
|
+
form.h4 text: 'Gender'
|
78
|
+
form.spacer height: 4
|
79
|
+
form.fields_radioGroup \
|
80
|
+
name: 'user[gender]',
|
81
|
+
validation: { required: { message: 'Required' } },
|
82
|
+
childViews: ->(group) do
|
83
|
+
group.fields_radio value: '', label: 'Unknown'
|
84
|
+
group.fields_radio value: 'M', label: 'Male'
|
85
|
+
group.fields_radio value: 'F', label: 'Female'
|
86
|
+
end
|
87
|
+
|
88
|
+
form.spacer height: 10
|
89
|
+
form.h4 text: 'Skills'
|
90
|
+
form.spacer height: 4
|
91
|
+
form.fields_checkGroup \
|
92
|
+
name: 'user[skills][]',
|
93
|
+
uncheckValue: 1,
|
60
94
|
validation: { required: { message: 'Required' } },
|
61
|
-
|
95
|
+
childViews: ->(group) do
|
96
|
+
group.fields_check checkValue: 2, label: 'Game Development'
|
97
|
+
group.fields_check checkValue: 3, label: 'Web Development'
|
98
|
+
group.fields_check checkValue: 4, label: 'Mobile Development'
|
99
|
+
end
|
62
100
|
|
63
101
|
form.spacer height: 30
|
64
102
|
form.fields_submit text: 'Submit'
|
@@ -15,6 +15,9 @@ page.form \
|
|
15
15
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
16
16
|
|
17
17
|
header.panels_horizontal childViews: ->(horizontal) do
|
18
|
+
horizontal.fields_check name: 'user[check_all]', label: 'All', checkValue: true
|
19
|
+
|
20
|
+
header.spacer width: 20
|
18
21
|
# header.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[new_name]', label: 'Item name'
|
19
22
|
statuses = [:pending, :active]
|
20
23
|
header.fields_select \
|
@@ -23,6 +26,7 @@ page.form \
|
|
23
26
|
width: 'matchParent',
|
24
27
|
label: 'Status',
|
25
28
|
options: statuses.map { |status| { value: status, text: status.to_s.humanize } }
|
29
|
+
|
26
30
|
header.spacer width: 20
|
27
31
|
header.fields_submit text: 'Update'
|
28
32
|
end
|
@@ -34,5 +38,12 @@ page.form \
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
37
|
-
]
|
41
|
+
], fieldCheckValueIf: {
|
42
|
+
"==": [
|
43
|
+
{
|
44
|
+
"var": 'user[check_all]'
|
45
|
+
},
|
46
|
+
true
|
47
|
+
]
|
48
|
+
}
|
38
49
|
end
|
@@ -11,40 +11,50 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
11
11
|
f.shareButton \
|
12
12
|
network: 'copy',
|
13
13
|
url: '',
|
14
|
-
title: '
|
15
|
-
description: 'Internship opportunities at talentbasket',
|
14
|
+
title: '',
|
16
15
|
text: 'Copy Link',
|
17
16
|
onClick: ->(action) do
|
18
|
-
action.commands_copy text: 'copied'
|
17
|
+
action.commands_copy text: 'This is copied text', onCopy: ->(subaction) do
|
18
|
+
subaction.snackbars_alert message: 'Copied', styleClass: 'success'
|
19
|
+
end
|
19
20
|
end
|
20
21
|
|
22
|
+
f.spacer width: 10
|
23
|
+
|
24
|
+
# For testing: https://developers.facebook.com/tools/debug/
|
21
25
|
f.shareButton \
|
22
26
|
network: 'facebook',
|
23
|
-
url: 'https://www.
|
24
|
-
title: '
|
25
|
-
description: '
|
26
|
-
facebookQuote: '
|
27
|
+
url: 'https://www.google.com',
|
28
|
+
title: 'This is a title',
|
29
|
+
description: 'This is a description',
|
30
|
+
facebookQuote: 'This is a quote',
|
27
31
|
text: 'Facebook'
|
28
32
|
|
33
|
+
f.spacer width: 10
|
34
|
+
|
29
35
|
f.shareButton \
|
30
36
|
network: 'linkedin',
|
31
|
-
url: 'https://www.
|
32
|
-
title: '
|
33
|
-
description: '
|
37
|
+
url: 'https://www.google.com',
|
38
|
+
title: 'This is a title',
|
39
|
+
description: 'This is a description',
|
34
40
|
text: 'LinkedIn'
|
35
41
|
|
42
|
+
f.spacer width: 10
|
43
|
+
|
36
44
|
f.shareButton \
|
37
45
|
network: 'whatsapp',
|
38
|
-
url: 'https://www.
|
39
|
-
title: '
|
40
|
-
description: '
|
46
|
+
url: 'https://www.google.com',
|
47
|
+
title: 'This is a title',
|
48
|
+
description: 'This is a description',
|
41
49
|
text: 'WhatsApp'
|
42
50
|
|
51
|
+
f.spacer width: 10
|
52
|
+
|
43
53
|
f.shareButton \
|
44
54
|
network: 'telegram',
|
45
|
-
url: 'https://www.
|
46
|
-
title: '
|
47
|
-
description: '
|
55
|
+
url: 'https://www.google.com',
|
56
|
+
title: 'This is a title',
|
57
|
+
description: 'This is a description',
|
48
58
|
text: 'Telegram'
|
49
59
|
end
|
50
60
|
end
|
@@ -53,27 +63,33 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
53
63
|
col.panels_flow innerPadding: { top: 0, right: 0, bottom: 0, left: 0 }, childViews: ->(f) do
|
54
64
|
f.shareButton \
|
55
65
|
network: 'facebook',
|
56
|
-
url: 'https://www.
|
57
|
-
title: '
|
58
|
-
description: '
|
66
|
+
url: 'https://www.google.com',
|
67
|
+
title: 'This is a title',
|
68
|
+
description: 'This is a description'
|
69
|
+
|
70
|
+
f.spacer width: 10
|
59
71
|
|
60
72
|
f.shareButton \
|
61
73
|
network: 'linkedin',
|
62
|
-
url: 'https://www.
|
63
|
-
title: '
|
64
|
-
description: '
|
74
|
+
url: 'https://www.google.com',
|
75
|
+
title: 'This is a title',
|
76
|
+
description: 'This is a description'
|
77
|
+
|
78
|
+
f.spacer width: 10
|
65
79
|
|
66
80
|
f.shareButton \
|
67
81
|
network: 'whatsapp',
|
68
|
-
url: 'https://www.
|
69
|
-
title: '
|
70
|
-
description: '
|
82
|
+
url: 'https://www.google.com',
|
83
|
+
title: 'This is a title',
|
84
|
+
description: 'This is a description'
|
85
|
+
|
86
|
+
f.spacer width: 10
|
71
87
|
|
72
88
|
f.shareButton \
|
73
89
|
network: 'telegram',
|
74
|
-
url: 'https://www.
|
75
|
-
title: '
|
76
|
-
description: '
|
90
|
+
url: 'https://www.google.com',
|
91
|
+
title: 'This is a title',
|
92
|
+
description: 'This is a description'
|
77
93
|
end
|
78
94
|
end
|
79
95
|
scroll.spacer height: 20
|
@@ -82,32 +98,38 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
82
98
|
col.panels_vertical width: 200, childViews: ->(v) do
|
83
99
|
v.shareButton \
|
84
100
|
network: 'facebook',
|
85
|
-
url: 'https://www.
|
86
|
-
title: '
|
87
|
-
description: '
|
101
|
+
url: 'https://www.google.com',
|
102
|
+
title: 'This is a title',
|
103
|
+
description: 'This is a description',
|
88
104
|
text: 'Facebook'
|
89
105
|
|
106
|
+
v.spacer height: 10
|
107
|
+
|
90
108
|
v.shareButton \
|
91
109
|
network: 'linkedin',
|
92
|
-
url: 'https://www.
|
93
|
-
title: '
|
94
|
-
description: '
|
110
|
+
url: 'https://www.google.com',
|
111
|
+
title: 'This is a title',
|
112
|
+
description: 'This is a description',
|
95
113
|
text: 'LinkedIn'
|
96
114
|
|
115
|
+
v.spacer height: 10
|
116
|
+
|
97
117
|
v.shareButton \
|
98
118
|
width: 'matchParent',
|
99
119
|
network: 'whatsapp',
|
100
|
-
url: 'https://www.
|
101
|
-
title: '
|
102
|
-
description: '
|
120
|
+
url: 'https://www.google.com',
|
121
|
+
title: 'This is a title',
|
122
|
+
description: 'This is a description',
|
103
123
|
text: 'WhatsApp'
|
104
124
|
|
125
|
+
v.spacer height: 10
|
126
|
+
|
105
127
|
v.shareButton \
|
106
128
|
width: 'matchParent',
|
107
129
|
network: 'telegram',
|
108
|
-
url: 'https://www.
|
109
|
-
title: '
|
110
|
-
description: '
|
130
|
+
url: 'https://www.google.com',
|
131
|
+
title: 'This is a title',
|
132
|
+
description: 'This is a description',
|
111
133
|
text: 'Telegram'
|
112
134
|
end
|
113
135
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- app/helpers/glib/json_ui/abstract_builder.rb
|
93
93
|
- app/helpers/glib/json_ui/action_builder.rb
|
94
94
|
- app/helpers/glib/json_ui/action_builder/commands.rb
|
95
|
+
- app/helpers/glib/json_ui/action_builder/components.rb
|
95
96
|
- app/helpers/glib/json_ui/action_builder/dialogs.rb
|
96
97
|
- app/helpers/glib/json_ui/action_builder/http.rb
|
97
98
|
- app/helpers/glib/json_ui/action_builder/iap.rb
|
@@ -146,19 +147,19 @@ files:
|
|
146
147
|
- app/views/json_ui/garage/forms/basic_post.json.jbuilder
|
147
148
|
- app/views/json_ui/garage/forms/checkboxes.json.jbuilder
|
148
149
|
- app/views/json_ui/garage/forms/conditional_value.json.jbuilder
|
149
|
-
- app/views/json_ui/garage/forms/
|
150
|
+
- app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder
|
150
151
|
- app/views/json_ui/garage/forms/dynamic_group.json.jbuilder
|
151
152
|
- app/views/json_ui/garage/forms/dynamic_select.json.jbuilder
|
152
153
|
- app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder
|
153
154
|
- app/views/json_ui/garage/forms/file_upload.json.jbuilder
|
154
155
|
- app/views/json_ui/garage/forms/floating_submit.json.jbuilder
|
155
156
|
- app/views/json_ui/garage/forms/generic_post.json.jbuilder
|
156
|
-
- app/views/json_ui/garage/forms/get_request.json.jbuilder
|
157
157
|
- app/views/json_ui/garage/forms/index.json.jbuilder
|
158
158
|
- app/views/json_ui/garage/forms/local_request.json.jbuilder
|
159
159
|
- app/views/json_ui/garage/forms/new_rich_text.json.jbuilder
|
160
160
|
- app/views/json_ui/garage/forms/online_participant1.json.jbuilder
|
161
161
|
- app/views/json_ui/garage/forms/online_participant2.json.jbuilder
|
162
|
+
- app/views/json_ui/garage/forms/page_update_on_response.json.jbuilder
|
162
163
|
- app/views/json_ui/garage/forms/payments.json.jbuilder
|
163
164
|
- app/views/json_ui/garage/forms/pickers.json.jbuilder
|
164
165
|
- app/views/json_ui/garage/forms/ratings.json.jbuilder
|
@@ -1,27 +0,0 @@
|
|
1
|
-
json.title 'Forms'
|
2
|
-
|
3
|
-
data = params[:user] || {}
|
4
|
-
|
5
|
-
page = json_ui_page json
|
6
|
-
render "#{@path_prefix}/nav_menu", json: json, page: page
|
7
|
-
|
8
|
-
page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', padding: glib_json_padding_body, childViews: ->(form) do
|
9
|
-
# TODO: Potential improvement:
|
10
|
-
# Use `reload` behaviour instead of `open` (i.e. don't keep adding URL to history).
|
11
|
-
# Probably introduce a flag to panels_form so developer can enable/disable this behaviour.
|
12
|
-
form.h3 text: "Hello #{ data[:name] }"
|
13
|
-
form.spacer height: 6
|
14
|
-
form.label text: 'On the web, upon submit, URL needs to change on the browser'
|
15
|
-
form.spacer height: 10
|
16
|
-
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name', disableDirtyCheck: true
|
17
|
-
|
18
|
-
# form.panels_split width: 'matchParent', rightViews: ->(split) do
|
19
|
-
# split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
20
|
-
# end
|
21
|
-
|
22
|
-
form.panels_split width: 'matchParent', content: ->(split) do
|
23
|
-
split.right childViews: ->(right) do
|
24
|
-
right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|