glib-web 0.5.5
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 +7 -0
- data/app/controllers/concerns/glib/auth/policy.rb +148 -0
- data/app/controllers/concerns/glib/json/dynamic_text.rb +126 -0
- data/app/controllers/concerns/glib/json/libs.rb +144 -0
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +122 -0
- data/app/controllers/concerns/glib/json/transformation.rb +11 -0
- data/app/controllers/concerns/glib/json/traversal.rb +85 -0
- data/app/controllers/concerns/glib/json/ui.rb +70 -0
- data/app/controllers/concerns/glib/json/validation.rb +13 -0
- data/app/controllers/glib/home_controller.rb +16 -0
- data/app/helpers/glib/app_feature_support_helper.rb +16 -0
- data/app/helpers/glib/dynamic_images_helper.rb +52 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +42 -0
- data/app/helpers/glib/forms_helper.rb +15 -0
- data/app/helpers/glib/json_ui/abstract_builder.rb +281 -0
- data/app/helpers/glib/json_ui/action_builder.rb +81 -0
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +58 -0
- data/app/helpers/glib/json_ui/action_builder/http.rb +19 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +15 -0
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +41 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +25 -0
- data/app/helpers/glib/json_ui/dynamic_field_builders.rb +25 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +28 -0
- data/app/helpers/glib/json_ui/list_builders.rb +87 -0
- data/app/helpers/glib/json_ui/menu_builder.rb +52 -0
- data/app/helpers/glib/json_ui/page_helper.rb +187 -0
- data/app/helpers/glib/json_ui/response_helper.rb +23 -0
- data/app/helpers/glib/json_ui/split_builders.rb +32 -0
- data/app/helpers/glib/json_ui/styling_helper.rb +25 -0
- data/app/helpers/glib/json_ui/table_builders.rb +74 -0
- data/app/helpers/glib/json_ui/view_builder.rb +185 -0
- data/app/helpers/glib/json_ui/view_builder/banners.rb +24 -0
- data/app/helpers/glib/json_ui/view_builder/charts.rb +33 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +213 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +219 -0
- data/app/models/glib/active_storage/attachment.rb +9 -0
- data/app/models/glib/active_storage/blob.rb +9 -0
- data/app/models/glib/dynamic_text_record.rb +9 -0
- data/app/models/glib/text.rb +96 -0
- data/app/policies/glib/application_policy.rb +164 -0
- data/app/validators/email_typo_validator.rb +38 -0
- data/app/validators/email_validator.rb +7 -0
- data/app/validators/url_validator.rb +20 -0
- data/app/views/app/views/json_ui/vue/renderer.html.erb +35 -0
- data/app/views/json_ui/garage/_nav_menu.json.jbuilder +71 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +104 -0
- data/app/views/json_ui/garage/actions/_http.json.jbuilder +18 -0
- data/app/views/json_ui/garage/actions/_reload.json.jbuilder +17 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +19 -0
- data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +33 -0
- data/app/views/json_ui/garage/actions/_timeouts.json.jbuilder +18 -0
- data/app/views/json_ui/garage/actions/_windows.json.jbuilder +24 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +6 -0
- data/app/views/json_ui/garage/actions/index.json.jbuilder +23 -0
- data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +7 -0
- data/app/views/json_ui/garage/forms/basic.json.jbuilder +34 -0
- data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +8 -0
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +44 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +41 -0
- data/app/views/json_ui/garage/forms/dynamic_select.json.jbuilder +25 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +38 -0
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +58 -0
- data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +31 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +3 -0
- data/app/views/json_ui/garage/forms/get_request.json.jbuilder +28 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +101 -0
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +46 -0
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +40 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +70 -0
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +88 -0
- data/app/views/json_ui/garage/forms/styled_boxes.json.jbuilder +32 -0
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +17 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +24 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +63 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +25 -0
- data/app/views/json_ui/garage/forms/text_validation.json.jbuilder +22 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +11 -0
- data/app/views/json_ui/garage/home/index.json.jbuilder +32 -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 +20 -0
- data/app/views/json_ui/garage/lists/edit_actions.json.jbuilder +19 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +14 -0
- data/app/views/json_ui/garage/lists/index.json.jbuilder +23 -0
- data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +38 -0
- data/app/views/json_ui/garage/lists/templating.json.jbuilder +35 -0
- data/app/views/json_ui/garage/notifications/index.json.jbuilder +18 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +60 -0
- data/app/views/json_ui/garage/pages/flat_centered.json.jbuilder +29 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +29 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +16 -0
- data/app/views/json_ui/garage/pages/index.json.jbuilder +47 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +19 -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 +21 -0
- data/app/views/json_ui/garage/pages/tab_bar.json.jbuilder +27 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +78 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +4 -0
- data/app/views/json_ui/garage/panels/carousel.json.jbuilder +16 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +17 -0
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +49 -0
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +91 -0
- data/app/views/json_ui/garage/panels/index.json.jbuilder +132 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +4 -0
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +88 -0
- data/app/views/json_ui/garage/panels/split.json.jbuilder +183 -0
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +50 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +13 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +47 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +17 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +13 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +38 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +39 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +29 -0
- data/app/views/json_ui/garage/tables/horizontal_scroll.json.jbuilder +26 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +26 -0
- data/app/views/json_ui/garage/tables/layout.json.jbuilder +38 -0
- data/app/views/json_ui/garage/views/_chart_data.json.jbuilder +17 -0
- data/app/views/json_ui/garage/views/banners.json.jbuilder +51 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +30 -0
- data/app/views/json_ui/garage/views/carousels.json.jbuilder +37 -0
- data/app/views/json_ui/garage/views/charts.json.jbuilder +115 -0
- data/app/views/json_ui/garage/views/images.json.jbuilder +89 -0
- data/app/views/json_ui/garage/views/index.json.jbuilder +48 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +70 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +43 -0
- data/app/views/json_ui/garage/views/markdowns.json.jbuilder +41 -0
- data/app/views/json_ui/garage/views/misc.json.jbuilder +34 -0
- data/app/views/json_ui/garage/views/texts.json.jbuilder +41 -0
- data/app/views/layouts/json_ui/renderer.html.erb +32 -0
- data/config/routes.rb +8 -0
- data/lib/generators/glib/install_generator.rb +24 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +12 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +7 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +7 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +27 -0
- data/lib/generators/templates/database.yml +107 -0
- data/lib/generators/templates/dynamic_text.rb +2 -0
- data/lib/glib-web.rb +8 -0
- data/lib/glib/crypt.rb +1 -0
- data/lib/glib/crypt/utils.rb +26 -0
- data/lib/glib/dynamic_text.rb +1 -0
- data/lib/glib/dynamic_text/config.rb +21 -0
- data/lib/glib/engine.rb +7 -0
- data/lib/glib/json_crawler.rb +10 -0
- data/lib/glib/json_crawler/action_crawler.rb +20 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +14 -0
- data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +48 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +12 -0
- data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +15 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +28 -0
- data/lib/glib/json_crawler/coverage.rb +20 -0
- data/lib/glib/json_crawler/http.rb +120 -0
- data/lib/glib/json_crawler/router.rb +86 -0
- data/lib/glib/test_helpers.rb +40 -0
- data/lib/glib/value.rb +7 -0
- data/lib/glib/version.rb +5 -0
- data/lib/tasks/db.rake +95 -0
- metadata +246 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
# json.rows do
|
|
3
|
+
# batch_count = 30
|
|
4
|
+
# batch_count.times do |i|
|
|
5
|
+
# index = page * batch_count + i
|
|
6
|
+
# json.child! do
|
|
7
|
+
# json.template 'thumbnail'
|
|
8
|
+
# json.title "Item #{index}"
|
|
9
|
+
# end
|
|
10
|
+
# end
|
|
11
|
+
# end
|
|
12
|
+
|
|
13
|
+
section = json_ui_section json
|
|
14
|
+
section.rows builder: ->(row) do
|
|
15
|
+
batch_count = 30
|
|
16
|
+
batch_count.times do |i|
|
|
17
|
+
index = page * batch_count + i
|
|
18
|
+
row.thumbnail title: "Item #{index}"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
json.title 'Lists'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.list firstSection: ->(section) do
|
|
7
|
+
section.rows builder: ->(template) do
|
|
8
|
+
template.thumbnail title: 'Click menu (web) or swipe left (Android/iOS)', editButtons: ->(menu) do
|
|
9
|
+
menu.button text: 'Edit', onClick: ->(action) do
|
|
10
|
+
action.dialogs_alert message: 'Perform action'
|
|
11
|
+
end
|
|
12
|
+
menu.button text: 'Delete', onClick: ->(action) do
|
|
13
|
+
action.dialogs_alert message: 'Perform action'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
json.title 'Lists'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
# page.body height: 'matchParent', padding: glib_json_padding_body, childViews: ->(body) do
|
|
7
|
+
page.body childViews: ->(body) do
|
|
8
|
+
body.fab icon: 'add', onClick: ->(action) { action.dialogs_alert message: 'Perform action' }
|
|
9
|
+
|
|
10
|
+
body.panels_list width: 'matchParent', firstSection: ->(section) do
|
|
11
|
+
render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: 0
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
json.title 'Lists'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
|
|
5
|
+
|
|
6
|
+
page.list firstSection: ->(section) do
|
|
7
|
+
section.rows builder: ->(template) do
|
|
8
|
+
template.thumbnail icon: 'list', title: 'Templating', onClick: ->(action) do
|
|
9
|
+
action.windows_open url: json_ui_garage_url(path: 'lists/templating')
|
|
10
|
+
end
|
|
11
|
+
template.thumbnail title: 'Edit Actions', onClick: ->(action) do
|
|
12
|
+
action.windows_open url: json_ui_garage_url(path: 'lists/edit_actions')
|
|
13
|
+
end
|
|
14
|
+
template.thumbnail title: 'Infinite Scroll', onClick: ->(action) do
|
|
15
|
+
action.windows_open url: json_ui_garage_url(path: 'lists/infinite_scroll')
|
|
16
|
+
end
|
|
17
|
+
template.thumbnail title: 'FAB (Floating Action Button)', onClick: ->(action) do
|
|
18
|
+
action.windows_open url: json_ui_garage_url(path: 'lists/fab')
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
page_index = params[:page].to_i
|
|
3
|
+
next_page = {
|
|
4
|
+
url: json_ui_garage_url(path: 'lists/infinite_scroll', page: page_index + 1, section_only: 'v1'),
|
|
5
|
+
# TODO: rename, e.g. autoloadAsNeeded vs autoloadAll
|
|
6
|
+
autoLoad: true
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
# TODO: Cater
|
|
10
|
+
# - for SEO: one URL for a standalone page and one URL for pagination only
|
|
11
|
+
# - for generic approach, e.g. excluding nav_menu when there is no change
|
|
12
|
+
if params[:section_only].present?
|
|
13
|
+
json.nextPage next_page
|
|
14
|
+
json.sections do
|
|
15
|
+
json.child! do
|
|
16
|
+
render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page_index
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
else
|
|
20
|
+
json.title 'Lists'
|
|
21
|
+
|
|
22
|
+
# options = { nextPage: nextPage }
|
|
23
|
+
# json_body_with_list json, nil, nil, options do
|
|
24
|
+
# render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
|
|
25
|
+
# end
|
|
26
|
+
|
|
27
|
+
page = json_ui_page json
|
|
28
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
29
|
+
|
|
30
|
+
page.list nextPage: next_page, firstSection: ->(section) do
|
|
31
|
+
render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page_index
|
|
32
|
+
end, onScrollToBottom: ->(action) do
|
|
33
|
+
action.snackbars_alert message: 'Scrolled to Bottom'
|
|
34
|
+
end, onScrollToTop: ->(action) do
|
|
35
|
+
action.snackbars_alert message: 'Scrolled to Top'
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
json.title 'Lists'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.list firstSection: ->(section) do
|
|
7
|
+
section.header padding: { top: 12, left: 16, right: 16, bottom: 12 }, childViews: ->(header) do
|
|
8
|
+
header.h3 text: 'Section Header'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
section.rows builder: ->(template) do
|
|
12
|
+
template.thumbnail title: 'Click me', onClick: ->(action) do
|
|
13
|
+
action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
|
14
|
+
end
|
|
15
|
+
template.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
|
|
16
|
+
template.thumbnail title: 'Item with chips', chips: ->(menu) do
|
|
17
|
+
menu.button text: 'Finished', styleClass: 'info'
|
|
18
|
+
menu.button props: { text: 'Succeeded', styleClass: 'success' }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
template.thumbnail title: 'Item with thumbnail image', subtitle: 'Item subtitle', imageUrl: glib_json_image_standard_url
|
|
22
|
+
template.featured title: 'Featured with featured image', subtitle: 'Item subtitle', imageUrl: glib_json_image_standard_url
|
|
23
|
+
|
|
24
|
+
# TODO
|
|
25
|
+
# template.thumbnail title: 'Item with accessories (Experimental)', subtitle: 'Item subtitle', accessoryViews: ->(thumbnail) do
|
|
26
|
+
# thumbnail.panels_horizontal childViews: ->(horizontal) do
|
|
27
|
+
# horizontal.chip text: 'finished'
|
|
28
|
+
# horizontal.spacer width: 10
|
|
29
|
+
# horizontal.chip text: 'succeeded'
|
|
30
|
+
# end
|
|
31
|
+
# end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
json.title 'Notifications'
|
|
2
|
+
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
|
|
5
|
+
|
|
6
|
+
page.list firstSection: ->(section) do
|
|
7
|
+
section.rows builder: ->(template) do
|
|
8
|
+
template.thumbnail title: 'Send Desktop Notification', onClick: ->(action) do
|
|
9
|
+
action.dialogs_notification title: 'Hello World', message: 'This is a notification', onClick: ->(subaction) do
|
|
10
|
+
subaction.dialogs_alert message: 'Perform action'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
template.thumbnail title: 'WebSocket Real-time Update', onClick: ->(action) do
|
|
15
|
+
action.windows_open url: json_ui_garage_url(path: 'notifications/web_socket')
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
json.title 'Forms'
|
|
2
|
+
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
json.ws({
|
|
7
|
+
"socket" => {
|
|
8
|
+
"endpoint" => "/socket/websocket",
|
|
9
|
+
"params" => {
|
|
10
|
+
vsn: '2.0.0',
|
|
11
|
+
token: 'TOKEN'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
# "topic" => "room:30",
|
|
15
|
+
# "event" => "comments_updated",
|
|
16
|
+
"topic" => "links",
|
|
17
|
+
"events" => ["new_link_added"],
|
|
18
|
+
"header" => {
|
|
19
|
+
"user_id" => 2,
|
|
20
|
+
"prev_item_id" => nil,
|
|
21
|
+
"last_item_id" => nil
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, paramNameForFormData: 'formData', onSubmit: ->(action) do
|
|
26
|
+
json.action "ws/push"
|
|
27
|
+
json.topic "links"
|
|
28
|
+
json.event "new_link"
|
|
29
|
+
json.payload({
|
|
30
|
+
"club_id": "2",
|
|
31
|
+
"room_id": "30",
|
|
32
|
+
"user_id": "2"
|
|
33
|
+
# title: "TITLE",
|
|
34
|
+
# url: "URL"
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
end, childViews: ->(form) do
|
|
38
|
+
form.spacer height: 14
|
|
39
|
+
form.label text: "Message: #{params[:message]}"
|
|
40
|
+
form.spacer height: 14
|
|
41
|
+
|
|
42
|
+
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
|
43
|
+
|
|
44
|
+
# TODO: Change this to radio for selecting alert vs reload response
|
|
45
|
+
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
|
|
46
|
+
|
|
47
|
+
form.fields_hidden name: 'baseUrl', width: 'matchParent', value: json_ui_garage_url(path: 'notifications/web_socket')
|
|
48
|
+
|
|
49
|
+
form.panels_split width: 'matchParent', content: ->(split) do
|
|
50
|
+
# split.left childViews: ->(left) do
|
|
51
|
+
# if params[:mode] == 'dialog'
|
|
52
|
+
# left.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
|
|
53
|
+
# end
|
|
54
|
+
# end
|
|
55
|
+
split.right childViews: ->(right) do
|
|
56
|
+
right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.template 'flatCentered'
|
|
7
|
+
|
|
8
|
+
page.header childViews: ->(header) do
|
|
9
|
+
header.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
10
|
+
vertical.h1 text: 'Header'
|
|
11
|
+
end
|
|
12
|
+
header.spacer height: 20
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
page.footer childViews: ->(footer) do
|
|
16
|
+
footer.spacer height: 20
|
|
17
|
+
footer.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
18
|
+
vertical.h1 text: 'Footer'
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
page.body childViews: ->(scroll) do
|
|
23
|
+
scroll.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
24
|
+
(1..100).each do |index|
|
|
25
|
+
scroll.label text: 'Content'
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.template 'fullWidth'
|
|
7
|
+
|
|
8
|
+
page.header childViews: ->(header) do
|
|
9
|
+
header.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
10
|
+
vertical.h1 text: 'Header'
|
|
11
|
+
end
|
|
12
|
+
header.spacer height: 10
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
page.footer childViews: ->(footer) do
|
|
16
|
+
footer.spacer height: 10
|
|
17
|
+
footer.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
18
|
+
vertical.h1 text: 'Footer'
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
page.body childViews: ->(scroll) do
|
|
23
|
+
scroll.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
|
24
|
+
(1..100).each do |index|
|
|
25
|
+
vertical.label text: 'Content'
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.header padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(header) do
|
|
7
|
+
header.h1 text: 'Header'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
page.body height: 'matchParent', padding: glib_json_padding_body, childViews: ->(body) do
|
|
11
|
+
body.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
page.footer height: 80, padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
|
|
15
|
+
footer.h1 text: 'Footer'
|
|
16
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
|
|
5
|
+
|
|
6
|
+
page.list sections: [
|
|
7
|
+
->(section) do
|
|
8
|
+
section.rows builder: ->(template) do
|
|
9
|
+
template.thumbnail title: 'Hamburger Layout', onClick: ->(action) do
|
|
10
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/layout')
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
template.thumbnail title: 'Full Width/Height', onClick: ->(action) do
|
|
14
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/full_width_height')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
template.thumbnail title: 'Tab Bar', onClick: ->(action) do
|
|
18
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/tab_bar')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
template.thumbnail title: 'Nav Buttons', onClick: ->(action) do
|
|
22
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/nav_buttons')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
template.thumbnail title: 'Loading Indicator', onClick: ->(action) do
|
|
26
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/loading_indicator')
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end,
|
|
30
|
+
->(section) do
|
|
31
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
|
32
|
+
header.h2 text: 'Templates (Web Only)'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
section.rows builder: ->(template) do
|
|
36
|
+
template.thumbnail title: 'Flat Centered', onClick: ->(action) do
|
|
37
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/flat_centered')
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
template.thumbnail title: 'Full Width', onClick: ->(action) do
|
|
41
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/full_width')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.header padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(header) do
|
|
7
|
+
header.h1 text: 'Header'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
|
|
11
|
+
footer.h1 text: 'Footer'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
15
|
+
(1..100).each do |index|
|
|
16
|
+
scroll.label text: 'Content'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
sleep 1
|
|
2
|
+
|
|
3
|
+
json.title 'Pages'
|
|
4
|
+
|
|
5
|
+
page = json_ui_page json
|
|
6
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
7
|
+
|
|
8
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
9
|
+
scroll.label text: 'On the web, the loading indicator should be show on the browser tab.'
|
|
10
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.rightNavButtons do |menu|
|
|
7
|
+
menu.button icon: 'search', onClick: ->(action) do
|
|
8
|
+
action.dialogs_alert message: 'Perform some action'
|
|
9
|
+
end
|
|
10
|
+
menu.button icon: { name: 'star', badge: { text: '1', backgroundColor: '#ff0000' } }, onClick: ->(action) do
|
|
11
|
+
action.dialogs_alert message: 'Perform some action'
|
|
12
|
+
end
|
|
13
|
+
menu.button icon: { name: 'map', badge: '2' }, onClick: ->(action) do
|
|
14
|
+
action.dialogs_alert message: 'Perform some action'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
19
|
+
scroll.label text: 'See the right menu buttons on the nav bar'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
json.title 'Pages'
|
|
2
|
+
|
|
3
|
+
json_ui_page json do |page|
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
|
+
|
|
6
|
+
page.header childViews: ->(header) do
|
|
7
|
+
header.tabBar width: 'matchParent', backgroundColor: '#ffca05', color: '#7f561b', buttons: ->(menu) do
|
|
8
|
+
|
|
9
|
+
['FIRST', 'SECOND', 'THIRD'].each_with_index do |text, index|
|
|
10
|
+
menu.button text: text, disabled: params[:tab].to_i == index, onClick: ->(action) do
|
|
11
|
+
action.windows_reload url: json_ui_garage_url(path: 'pages/tab_bar', tab: index)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
18
|
+
scroll.label text: "Tab index #{params[:tab].to_i} selected"
|
|
19
|
+
|
|
20
|
+
scroll.spacer height: 10
|
|
21
|
+
|
|
22
|
+
100.times do |i|
|
|
23
|
+
scroll.label text: "Line #{i + 1}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|