glib-web 0.4.64 → 0.4.69
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 +5 -5
- data/app/controllers/concerns/glib/auth/policy.rb +0 -0
- data/app/controllers/concerns/glib/json/libs.rb +14 -0
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/controllers/concerns/glib/json/traversal.rb +0 -0
- data/app/controllers/glib/home_controller.rb +0 -0
- data/app/helpers/glib/dynamic_images_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/forms_helper.rb +0 -0
- data/app/helpers/glib/json_ui/abstract_builder.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/list_builders.rb +0 -0
- data/app/helpers/glib/json_ui/menu_builder.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +6 -0
- data/app/helpers/glib/json_ui/response_helper.rb +0 -0
- data/app/helpers/glib/json_ui/split_builders.rb +0 -0
- data/app/helpers/glib/json_ui/styling_helper.rb +0 -0
- data/app/helpers/glib/json_ui/table_builders.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/banners.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +11 -0
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/policies/glib/application_policy.rb +0 -0
- data/app/validators/email_typo_validator.rb +38 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/app/views/json_ui/vue/renderer.html.erb +0 -0
- data/app/views/json_ui/garage/_nav_menu.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_timeouts.json.jbuilder +18 -0
- data/app/views/json_ui/garage/actions/_windows.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/index.json.jbuilder +2 -0
- data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/basic.json.jbuilder +8 -5
- data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select.json.jbuilder +2 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +1 -18
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/get_request.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/styled_boxes.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +54 -10
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +21 -1
- data/app/views/json_ui/garage/forms/text_validation.json.jbuilder +3 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +11 -0
- data/app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/edit_actions.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +10 -7
- data/app/views/json_ui/garage/lists/templating.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/index.json.jbuilder +55 -9
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +62 -0
- data/app/views/json_ui/garage/pages/flat_centered.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/index.json.jbuilder +9 -5
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +10 -0
- data/app/views/json_ui/garage/pages/nav_buttons.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/tab_bar.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/carousel.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +1 -1
- data/app/views/json_ui/garage/panels/split.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +10 -11
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/horizontal_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/banners.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/carousels.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/charts.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/images.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/misc.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/texts.json.jbuilder +0 -0
- data/config/routes.rb +0 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib-web.rb +1 -0
- data/lib/glib/crypt.rb +1 -0
- data/lib/glib/crypt/utils.rb +26 -0
- data/lib/glib/dynamic_text.rb +1 -1
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/engine.rb +0 -0
- data/lib/glib/json_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +3 -3
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +20 -6
- data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/json_crawler/http.rb +0 -0
- data/lib/glib/json_crawler/router.rb +21 -9
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- data/lib/tasks/db.rake +0 -0
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 311061195227701369a02a188f82f9451d512bca16078cc128ac7918abedeb4d
|
|
4
|
+
data.tar.gz: 0bb31f7dee92ddc995a614aaf1f4dd6fac8b65373f33da943754b086b0534bd3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3193b0cf15722a30ff0c30514cab8bfd4e06e95b7c1601d98ee4ca7ef524ac2320ca62780cb6613f998bb33c15a3450611ad39517dcd4756f687dbf53f81876
|
|
7
|
+
data.tar.gz: 396a852776dc6b8d537fef002efa8d04f1881bb06740cd8f28b884ea209f8a97b6ecaaf54339447b7ab1e02b223fed8330b695c7fb4bdfa50beed84d05f05a02
|
|
File without changes
|
|
@@ -46,6 +46,14 @@ module Glib::Json::Libs
|
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
def json_libs_handle_404
|
|
50
|
+
if json_ui_activated?
|
|
51
|
+
render file: "#{Rails.root}/public/404.html", status: :not_found
|
|
52
|
+
else
|
|
53
|
+
raise exception
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
49
57
|
|
|
50
58
|
|
|
51
59
|
module ClassMethods
|
|
@@ -103,5 +111,11 @@ module Glib::Json::Libs
|
|
|
103
111
|
end
|
|
104
112
|
end
|
|
105
113
|
|
|
114
|
+
def json_libs_rescue_404
|
|
115
|
+
rescue_from ActiveRecord::RecordNotFound do |exception|
|
|
116
|
+
json_libs_handle_404
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
106
120
|
end
|
|
107
121
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
class Glib::JsonUi::ViewBuilder
|
|
2
2
|
module Panels
|
|
3
3
|
class Form < View
|
|
4
|
+
action :onSubmit
|
|
5
|
+
string :paramNameForFormData
|
|
4
6
|
# boolean :local
|
|
5
7
|
|
|
6
8
|
def is_array_association?(prop)
|
|
@@ -97,6 +99,8 @@ class Glib::JsonUi::ViewBuilder
|
|
|
97
99
|
|
|
98
100
|
class List < View
|
|
99
101
|
hash :nextPage
|
|
102
|
+
action :onScrollToTop
|
|
103
|
+
action :onScrollToBottom
|
|
100
104
|
|
|
101
105
|
def firstSection(block)
|
|
102
106
|
json.sections [1] do
|
|
@@ -149,6 +153,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
149
153
|
|
|
150
154
|
class Responsive < View
|
|
151
155
|
views :childViews
|
|
156
|
+
string :align
|
|
152
157
|
end
|
|
153
158
|
|
|
154
159
|
class Column < View
|
|
@@ -188,6 +193,12 @@ class Glib::JsonUi::ViewBuilder
|
|
|
188
193
|
class Custom < View
|
|
189
194
|
string :template
|
|
190
195
|
hash :data
|
|
196
|
+
|
|
197
|
+
def content(block)
|
|
198
|
+
json.data do
|
|
199
|
+
block.call page.view_builder
|
|
200
|
+
end
|
|
201
|
+
end
|
|
191
202
|
end
|
|
192
203
|
|
|
193
204
|
class Ul < View
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
class EmailTypoValidator < ActiveModel::EachValidator
|
|
2
|
+
COMMON_FORMAT = {
|
|
3
|
+
'\.\.' => '.',
|
|
4
|
+
'.con\z' => '.com',
|
|
5
|
+
'.coj\z' => '.com',
|
|
6
|
+
'.vom\z' => '.com',
|
|
7
|
+
'.xom\z' => '.com',
|
|
8
|
+
'.com[a-z]\z' => '.com',
|
|
9
|
+
'.con.' => '.com.',
|
|
10
|
+
'.orf\z' => '.org',
|
|
11
|
+
'.orf.' => '.org.',
|
|
12
|
+
'@hitmail.' => '@hotmail.',
|
|
13
|
+
'@htomail.' => '@hotmail.',
|
|
14
|
+
'@hotnail.' => '@hotmail.',
|
|
15
|
+
'@hotmil.' => '@hotmail.',
|
|
16
|
+
'@hotmal.' => '@hotmail.',
|
|
17
|
+
'@hoymail.' => '@hotmail.',
|
|
18
|
+
'@hormail.' => '@hotmail.',
|
|
19
|
+
'@hotmsil.' => '@hotmail.',
|
|
20
|
+
'@gail.' => '@gmail.',
|
|
21
|
+
'@gnail.' => '@gmail.',
|
|
22
|
+
'@gmil.' => '@gmail.',
|
|
23
|
+
'@gmal.' => '@gmail.',
|
|
24
|
+
'@gmai.' => '@gmail.',
|
|
25
|
+
'@yahho.' => '@yahoo.',
|
|
26
|
+
'@yaho.' => '@yahoo.',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def validate_each(record, attribute, value)
|
|
30
|
+
COMMON_FORMAT.keys.each do |format_key|
|
|
31
|
+
regex = Regexp.new(format_key)
|
|
32
|
+
if match = regex.match(value)
|
|
33
|
+
record.errors.add(attribute, "Invalid, replace #{match[0]} with #{COMMON_FORMAT[format_key]}")
|
|
34
|
+
break
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
|
3
|
+
header.h3 text: 'Timeouts'
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
section.rows builder: ->(template) do
|
|
7
|
+
template.thumbnail title: 'timeouts/set', onClick: ->(action) do
|
|
8
|
+
action.timeouts_set interval: 1000, onTimeout: ->(subaction) do
|
|
9
|
+
subaction.snackbars_alert message: 'Timeout elapsed'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# section.rows builder: ->(template) do
|
|
15
|
+
# template.thumbnail title: 'timeouts/clear', onClick: ->(action) do
|
|
16
|
+
# action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
|
17
|
+
# end
|
|
18
|
+
# end
|
|
File without changes
|
|
@@ -12,6 +12,8 @@ json_ui_page json do |page|
|
|
|
12
12
|
render "#{@path_prefix}/actions/sheets", section: section
|
|
13
13
|
end, ->(section) do
|
|
14
14
|
render "#{@path_prefix}/actions/windows", section: section
|
|
15
|
+
end, ->(section) do
|
|
16
|
+
render "#{@path_prefix}/actions/timeouts", section: section
|
|
15
17
|
end, ->(section) do
|
|
16
18
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
|
17
19
|
header.h3 text: 'Reload'
|
|
File without changes
|
|
@@ -2,11 +2,11 @@ json.title 'Forms'
|
|
|
2
2
|
|
|
3
3
|
json_ui_page json do |page|
|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
|
7
7
|
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
|
8
8
|
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
# form.panels_split width: 'matchParent', leftViews: ->(split) do
|
|
11
11
|
# if params[:mode] == 'dialog'
|
|
12
12
|
# split.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
|
|
@@ -14,7 +14,7 @@ json_ui_page json do |page|
|
|
|
14
14
|
# end, rightViews: ->(split) do
|
|
15
15
|
# split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
16
16
|
# end
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
form.panels_split width: 'matchParent', content: ->(split) do
|
|
19
19
|
split.left childViews: ->(left) do
|
|
20
20
|
if params[:mode] == 'dialog'
|
|
@@ -25,7 +25,10 @@ json_ui_page json do |page|
|
|
|
25
25
|
right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
end
|
|
30
|
-
|
|
30
|
+
# , paramNameForFormData: 'formData', onSubmit: ->(action) do
|
|
31
|
+
# action.http_post url: json_ui_garage_url(path: 'forms/generic_post')
|
|
32
|
+
# end
|
|
33
|
+
|
|
31
34
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,12 +12,14 @@ json_ui_page json do |page|
|
|
|
12
12
|
selectedOptions: [ { value: 'id3', text: 'Item 3' } ],
|
|
13
13
|
url: json_ui_garage_url(path: 'forms/dynamic_select_data')
|
|
14
14
|
|
|
15
|
+
form.spacer height: 14
|
|
15
16
|
form.fields_dynamicSelect name: 'user[preferred_languages][]', width: 'matchParent', label: 'Preferred Languages',
|
|
16
17
|
# value: ['id3', 'id5'], multiple: true,
|
|
17
18
|
selectedOptions: [ { value: 'id3', text: 'Item 3' }, { value: 'id5', text: 'Item 5' } ],
|
|
18
19
|
url: json_ui_garage_url(path: 'forms/dynamic_select_data'),
|
|
19
20
|
multiple: true
|
|
20
21
|
|
|
22
|
+
form.spacer height: 14
|
|
21
23
|
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -13,28 +13,11 @@ json.rows do
|
|
|
13
13
|
json.child! do
|
|
14
14
|
index = page * count_per_page + i
|
|
15
15
|
json.template 'thumbnail'
|
|
16
|
-
json.title "City #{index}"
|
|
16
|
+
json.title "City #{index} (#{params[:q]})"
|
|
17
17
|
json.subtitle "State #{index}"
|
|
18
18
|
json.subsubtitle "Country #{index}"
|
|
19
19
|
json.value "id#{index}"
|
|
20
20
|
json.text "Item #{index}"
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
|
|
24
|
-
# languages = {
|
|
25
|
-
# 'zh-HK' => 'Hong Kong',
|
|
26
|
-
# 'zh-TW' => 'Taiwan',
|
|
27
|
-
# 'zh-CN' => 'China',
|
|
28
|
-
# 'ja-JP' => 'Japan',
|
|
29
|
-
# 'ko-KR' => 'Korea',
|
|
30
|
-
# 'ru-RU' => 'Russian',
|
|
31
|
-
# 'en-PH' => 'Philippines'
|
|
32
|
-
# }
|
|
33
|
-
# languages.each do |k, v|
|
|
34
|
-
# json.child! do
|
|
35
|
-
# json.value k
|
|
36
|
-
# json.text v
|
|
37
|
-
# end
|
|
38
|
-
# end
|
|
39
|
-
|
|
40
23
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,19 +1,63 @@
|
|
|
1
1
|
json.title 'Forms'
|
|
2
2
|
|
|
3
|
-
json_ui_page json
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
7
|
+
scroll.panels_form url: json_ui_garage_url(path: 'forms/submission_indicator_post'), method: 'post', childViews: ->(form) do
|
|
7
8
|
form.label text: 'These buttons get disabled on submit'
|
|
8
|
-
form.spacer height:
|
|
9
|
+
form.spacer height: 14
|
|
9
10
|
form.button text: 'Normal Button', onClick: ->(action) { action.forms_submit }
|
|
10
|
-
form.spacer height:
|
|
11
|
+
form.spacer height: 14
|
|
11
12
|
form.fields_submit text: 'Submit Button'
|
|
12
13
|
|
|
13
|
-
# This needs to be long enough that the FAB is roughly at the bottom of a mobile screen.
|
|
14
|
-
# Ideally the spacer can expand dynamically depending on available space.
|
|
15
|
-
form.spacer height: 400
|
|
16
|
-
|
|
17
14
|
form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
|
|
18
15
|
end
|
|
16
|
+
|
|
17
|
+
scroll.spacer height: 14
|
|
18
|
+
|
|
19
|
+
scroll.panels_form url: json_ui_garage_url(path: 'forms/submission_indicator_post', mode: 'slow_open'), method: 'post', childViews: ->(form) do
|
|
20
|
+
form.fields_submit text: 'Submit button with slow window/open'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
scroll.spacer height: 14
|
|
24
|
+
|
|
25
|
+
scroll.panels_form url: json_ui_garage_url(path: 'forms/submission_indicator_post', mode: 'slow_openWeb'), method: 'post', childViews: ->(form) do
|
|
26
|
+
form.fields_submit text: 'Submit button with slow window/openWeb'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
scroll.spacer height: 14
|
|
30
|
+
|
|
31
|
+
scroll.panels_form url: json_ui_garage_url(path: 'forms/submission_indicator_post', mode: 'timeout_once'), method: 'post', childViews: ->(form) do
|
|
32
|
+
form.fields_submit text: 'Submit Button with timeouts/set once'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
scroll.spacer height: 14
|
|
36
|
+
|
|
37
|
+
scroll.panels_form url: json_ui_garage_url(path: 'forms/submission_indicator_post', mode: 'timeout_chain', count: 0), method: 'post', childViews: ->(form) do
|
|
38
|
+
form.fields_submit text: 'Submit Button with timeouts/set chain'
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# This needs to be long enough that the FAB is roughly at the bottom of a mobile screen.
|
|
42
|
+
# Ideally the spacer can expand dynamically depending on available space.
|
|
43
|
+
scroll.spacer height: 400
|
|
44
|
+
|
|
19
45
|
end
|
|
46
|
+
|
|
47
|
+
# page.form url: json_ui_garage_url(path: 'forms/submission_indicator_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
|
|
48
|
+
# form.label text: 'These buttons get disabled on submit'
|
|
49
|
+
# form.spacer height: 10
|
|
50
|
+
# form.button text: 'Normal Button', onClick: ->(action) { action.forms_submit }
|
|
51
|
+
# form.spacer height: 10
|
|
52
|
+
# form.fields_submit text: 'Submit Button'
|
|
53
|
+
|
|
54
|
+
# # This needs to be long enough that the FAB is roughly at the bottom of a mobile screen.
|
|
55
|
+
# # Ideally the spacer can expand dynamically depending on available space.
|
|
56
|
+
# form.spacer height: 400
|
|
57
|
+
|
|
58
|
+
# form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
|
|
59
|
+
# end
|
|
60
|
+
|
|
61
|
+
# page.form url: json_ui_garage_url(path: 'forms/submission_indicator_post', timeout: true), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
|
|
62
|
+
# form.fields_submit text: 'Submit Button with Timeout'
|
|
63
|
+
# end
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
sleep 0.5
|
|
2
2
|
|
|
3
3
|
json_ui_response json do |action|
|
|
4
|
-
|
|
4
|
+
case params[:mode]
|
|
5
|
+
when 'timeout_once'
|
|
6
|
+
action.timeouts_set interval: 2000, onTimeout: ->(subaction) do
|
|
7
|
+
subaction.dialogs_alert message: 'Success!'
|
|
8
|
+
end
|
|
9
|
+
when 'timeout_chain'
|
|
10
|
+
count = params[:count].to_i
|
|
11
|
+
if count > 3
|
|
12
|
+
action.dialogs_alert message: 'Success!'
|
|
13
|
+
else
|
|
14
|
+
action.timeouts_set interval: 500, onTimeout: ->(subaction) do
|
|
15
|
+
subaction.http_post url: json_ui_garage_url(path: 'forms/submission_indicator_post', mode: 'timeout_chain', count: count + 1)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
when 'slow_open'
|
|
19
|
+
action.windows_open url: json_ui_garage_url(path: 'home/slow')
|
|
20
|
+
when 'slow_openWeb'
|
|
21
|
+
action.windows_openWeb url: 'https://www.google.com'
|
|
22
|
+
else
|
|
23
|
+
action.dialogs_alert message: 'Success!'
|
|
24
|
+
end
|
|
5
25
|
end
|