glib-web 0.5.67 → 0.5.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/channels/glib/channel/is_typing_channel.rb +0 -0
- data/app/channels/glib/channel/online_channel.rb +3 -3
- data/app/controllers/concerns/glib/json/traversal.rb +0 -0
- data/app/controllers/glib/home_controller.rb +0 -0
- data/app/helpers/glib/json_ui/abstract_builder.rb +15 -0
- data/app/helpers/glib/json_ui/action_builder.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +2 -0
- data/app/helpers/glib/json_ui/list_builders.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +0 -0
- data/app/helpers/glib/json_ui/response_helper.rb +0 -0
- data/app/helpers/glib/json_ui/styling_helper.rb +8 -0
- data/app/helpers/glib/json_ui/view_builder.rb +8 -0
- data/app/helpers/glib/json_ui/view_builder/banners.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +15 -3
- data/app/helpers/glib/json_ui/view_builder/panels.rb +5 -0
- data/app/models/glib/application_record.rb +4 -4
- data/app/views/json_ui/garage/actions/_windows.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/conditional_value.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +5 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +2 -5
- data/app/views/json_ui/garage/forms/new_rich_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/online_participant1.json.jbuilder +25 -0
- data/app/views/json_ui/garage/forms/online_participant2.json.jbuilder +25 -0
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +8 -6
- data/app/views/json_ui/garage/forms/ratings.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 +2 -1
- 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/text_validation.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/timers.json.jbuilder +120 -0
- data/app/views/json_ui/garage/home/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/_autoload_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/index.json.jbuilder +6 -0
- data/app/views/json_ui/garage/lists/reordering.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/action_cable.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/android_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +10 -0
- data/app/views/json_ui/garage/panels/index.json.jbuilder +3 -1
- data/app/views/json_ui/garage/panels/web.json.jbuilder +15 -0
- data/app/views/json_ui/garage/views/controls.json.jbuilder +37 -0
- data/app/views/json_ui/garage/views/icons.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/index.json.jbuilder +3 -0
- data/app/views/json_ui/garage/views/maps.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 -9
- data/lib/glib/json_crawler/router.rb +0 -0
- data/lib/glib/test_helpers.rb +0 -0
- metadata +8 -4
- data/app/views/json_ui/garage/forms/misc.json.jbuilder +0 -57
- data/app/views/json_ui/garage/forms/misc_two.json.jbuilder +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63c05f4665c6948216e6fd40af4b8fcc4cfddccec4ab4bda3b8edfd65b3219ce
|
4
|
+
data.tar.gz: b2efc86bb633920c6430482c743139af1c44efeaef12252237a4be0d75556794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc286a18d408ed083904a16cd4c41d85237802f52fd6bbf83be58419687787816327fedac8d471212dbc39d94a65d86d118a045f14de84fbe2ea5677514d3320
|
7
|
+
data.tar.gz: 49c84b472a6c1a2a4d5d87e8a9143b9f873f558de7ee25756ba1ea85e7ea579cda30eaa42b24b3bb7a7867d09e2aee836cdc9e84fef904888b383c7a83d339b2
|
File without changes
|
@@ -26,10 +26,10 @@ module Glib
|
|
26
26
|
action: 'component/set',
|
27
27
|
text: text,
|
28
28
|
status: data['status'],
|
29
|
-
|
30
|
-
reset_value: data['reset_value'],
|
29
|
+
value: data['reset_value'],
|
31
30
|
event: 'online_status'
|
32
|
-
}
|
31
|
+
},
|
32
|
+
filterKey: data['user_id']
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
File without changes
|
File without changes
|
@@ -48,6 +48,8 @@ module Glib
|
|
48
48
|
class JsonUiElement
|
49
49
|
attr_reader :json, :page
|
50
50
|
|
51
|
+
@@_required_properties = {}
|
52
|
+
|
51
53
|
def initialize(json, page)
|
52
54
|
@json = json
|
53
55
|
@page = page
|
@@ -60,6 +62,11 @@ module Glib
|
|
60
62
|
args.each do |k, v|
|
61
63
|
send(k, v)
|
62
64
|
end
|
65
|
+
|
66
|
+
required_properties = @@_required_properties[self.class.component_name] || []
|
67
|
+
required_properties.each do |prop|
|
68
|
+
raise "Property required: #{prop}. Properties provided: #{args}. Component: #{self.class.component_name}" unless args[prop].present?
|
69
|
+
end
|
63
70
|
else
|
64
71
|
raise "Invalid properties: #{args}"
|
65
72
|
end
|
@@ -68,6 +75,10 @@ module Glib
|
|
68
75
|
end
|
69
76
|
|
70
77
|
private
|
78
|
+
def self.component_name
|
79
|
+
@component_name ||= self.name.sub('Glib::JsonUi::ActionBuilder::', '')
|
80
|
+
end
|
81
|
+
|
71
82
|
def self.any(propName)
|
72
83
|
define_method(propName) do |value|
|
73
84
|
json.set! propName, value
|
@@ -285,6 +296,10 @@ module Glib
|
|
285
296
|
end
|
286
297
|
end
|
287
298
|
|
299
|
+
def self.required(*prop_names)
|
300
|
+
@@_required_properties[self.component_name] = prop_names
|
301
|
+
end
|
302
|
+
|
288
303
|
def created
|
289
304
|
# To be overridden
|
290
305
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -98,11 +98,10 @@ class Glib::JsonUi::ViewBuilder
|
|
98
98
|
end
|
99
99
|
|
100
100
|
class Timer < Text
|
101
|
-
bool :forward
|
102
101
|
hash :actionCable
|
103
|
-
action :onZero
|
104
102
|
int :min
|
105
103
|
int :max
|
104
|
+
bool :forward
|
106
105
|
end
|
107
106
|
|
108
107
|
# Benefits of using `fields/submit` over `button`
|
@@ -129,7 +128,7 @@ class Glib::JsonUi::ViewBuilder
|
|
129
128
|
@value = value if value != Glib::Value::DEFAULT
|
130
129
|
end
|
131
130
|
|
132
|
-
# Where possible, use value instead of this
|
131
|
+
# TODO: Remove (deprecated). Where possible, use value instead of this
|
133
132
|
bool :checked
|
134
133
|
end
|
135
134
|
|
@@ -153,6 +152,7 @@ class Glib::JsonUi::ViewBuilder
|
|
153
152
|
hash :append
|
154
153
|
end
|
155
154
|
|
155
|
+
# TODO: Remove (deprecated)
|
156
156
|
class Autocomplete < AbstractField
|
157
157
|
array :options
|
158
158
|
# bool :readOnly
|
@@ -214,6 +214,18 @@ class Glib::JsonUi::ViewBuilder
|
|
214
214
|
hash :placeholderView
|
215
215
|
end
|
216
216
|
|
217
|
+
class MultiImage < Text
|
218
|
+
# file_rules = { fileType: 'image/*', maxFileSize: 5000 }
|
219
|
+
# file_rules = { fileType: 'video/*', maxFileSize: 50000 }
|
220
|
+
# file_rules = { fileType: 'application/pdf', maxFileSize: 5000 }
|
221
|
+
# hash :accepts
|
222
|
+
|
223
|
+
string :directUploadUrl
|
224
|
+
# string :fileUrl
|
225
|
+
# string :fileTitle
|
226
|
+
hash :placeholderView
|
227
|
+
end
|
228
|
+
|
217
229
|
class Date < AbstractField
|
218
230
|
date :min
|
219
231
|
date :max
|
@@ -212,6 +212,7 @@ class Glib::JsonUi::ViewBuilder
|
|
212
212
|
end
|
213
213
|
|
214
214
|
class Flow < View
|
215
|
+
hash :innerPadding
|
215
216
|
views :childViews
|
216
217
|
end
|
217
218
|
|
@@ -237,6 +238,10 @@ class Glib::JsonUi::ViewBuilder
|
|
237
238
|
end
|
238
239
|
end
|
239
240
|
|
241
|
+
class Web < View
|
242
|
+
string :url
|
243
|
+
end
|
244
|
+
|
240
245
|
class Ul < View
|
241
246
|
views :childViews
|
242
247
|
|
@@ -5,13 +5,13 @@ module Glib
|
|
5
5
|
scope :created_asc, -> { order(created_at: :asc) }
|
6
6
|
scope :created_desc, -> { order(created_at: :desc) }
|
7
7
|
|
8
|
-
def glib_enum_humanize(enum_name)
|
9
|
-
self.class.glib_enum_humanize(enum_name, send(enum_name))
|
8
|
+
def glib_enum_humanize(enum_name, default_value = nil)
|
9
|
+
self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.glib_enum_humanize(enum_name, enum_value)
|
12
|
+
def self.glib_enum_humanize(enum_name, enum_value, default_value = nil)
|
13
13
|
if enum_value
|
14
|
-
I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}")
|
14
|
+
I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -28,5 +28,10 @@ page.form options.merge(childViews: ->(form) do
|
|
28
28
|
rules = { fileType: 'pdf', maxFileSize: 5000 }
|
29
29
|
form.fields_file name: 'user[pdf2][]', width: 'matchParent', label: 'PDF Document', accepts: rules, directUploadUrl: rails_direct_uploads_url
|
30
30
|
|
31
|
+
# TODO
|
32
|
+
# rules = { fileType: 'image/*', maxFileSize: 1, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
|
33
|
+
# form.fields_multiImage name: 'user[photos][]', width: 'matchParent', label: 'Avatar', accepts: rules, directUploadUrl: rails_direct_uploads_url,
|
34
|
+
# placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJBUWFxgZEHE6FCUnKxwdEUI2LwM4KSskNzg6LC4WOz8f/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwC6XuvCQRj7okcUe27UYoxt4TOKDDG3Knkjm3jeGCMdeoeaOcWmQwQZe6/Qc0a+6Lpx+6PbcqOSNbeF44oMMbcqeSOZeN4YIx1+h5oXEG6MEGXuv0HNGuui6cfuvMytl6zWTXi6XuN039hh1koflPxDe4nyILW/qfpO/pFB6oLDhMLTX0XLbLbChmcSNDZ8T2tPqVUNuy/aY38S0PI3A3W/0tkF5qC4bVnZYsPxLT8Ic71AWgZ72ICXmuP+m/7KpUQWzAzzsQP8Y9Ybx9F0szlsb3TFqhjDWJZ6uAVOogvcR2RR+XEa7bouB+S2B0hdOOHCqoVjiDMEg7xQ917FgzqtcHVjucNz9Mf7qjoUFwMFzHahbM3tmPZQfJ3iG10m2mCR+qGZjqw17EqXZNynCtDZwIrXt2gawn7zTUIOt7r1BzRj7ounFHtu1GOCMbeEzigwxtyp5I5t43hgjHXqHmjnXTdGCDL3X6DmjXXRd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WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' }
|
35
|
+
|
31
36
|
form.fields_submit text: 'Submit'
|
32
37
|
end)
|
@@ -62,11 +62,8 @@ page.list sections: [
|
|
62
62
|
template.thumbnail title: 'Ratings', onClick: ->(action) do
|
63
63
|
action.windows_open url: json_ui_garage_url(path: 'forms/ratings')
|
64
64
|
end
|
65
|
-
template.thumbnail title: '
|
66
|
-
action.windows_open url: json_ui_garage_url(path: 'forms/
|
67
|
-
end
|
68
|
-
template.thumbnail title: 'Misc 2', onClick: ->(action) do
|
69
|
-
action.windows_open url: json_ui_garage_url(path: 'forms/misc_two')
|
65
|
+
template.thumbnail title: 'Timers', onClick: ->(action) do
|
66
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/timers')
|
70
67
|
end
|
71
68
|
end
|
72
69
|
end, ->(section) do
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
online_channel = 'OnlineChannel'
|
7
|
+
event = 'online_status'
|
8
|
+
first_user = User.first
|
9
|
+
|
10
|
+
online_socket_config = {
|
11
|
+
channel: online_channel,
|
12
|
+
filterKey: nil,
|
13
|
+
params: {}
|
14
|
+
}
|
15
|
+
json.actionCable online_socket_config
|
16
|
+
|
17
|
+
page.on load: ->(action) do
|
18
|
+
action.timeouts_set interval: 1000, repeat: true, onTimeout: ->(subaction) do
|
19
|
+
subaction.cables_push channel: online_channel, event: event, payload: { status: true, user_id: first_user.id, reset_value: 3 }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
24
|
+
scroll.label text: 'Participant One is now online'
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
online_channel = 'OnlineChannel'
|
7
|
+
event = 'online_status'
|
8
|
+
second_user = User.second
|
9
|
+
|
10
|
+
online_socket_config = {
|
11
|
+
channel: online_channel,
|
12
|
+
filterKey: nil,
|
13
|
+
params: {}
|
14
|
+
}
|
15
|
+
json.actionCable online_socket_config
|
16
|
+
|
17
|
+
page.on load: ->(action) do
|
18
|
+
action.timeouts_set interval: 1000, repeat: true, onTimeout: ->(subaction) do
|
19
|
+
subaction.cables_push channel: online_channel, event: event, payload: { status: true, user_id: second_user.id, reset_value: 3 }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
24
|
+
scroll.label text: 'Participant Two is now online'
|
25
|
+
end
|
@@ -30,12 +30,14 @@ page.form \
|
|
30
30
|
name: 'user[employer]',
|
31
31
|
checkValue: 1,
|
32
32
|
label: 'I am an employer (no default value)'
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
|
34
|
+
# Use `switch` component instead.
|
35
|
+
# form.fields_check \
|
36
|
+
# name: 'user[enabled]',
|
37
|
+
# styleClass: 'switch',
|
38
|
+
# checkValue: true,
|
39
|
+
# label: 'Enable',
|
40
|
+
# value: 'true'
|
39
41
|
|
40
42
|
form.spacer height: 20
|
41
43
|
form.h2 text: 'Date/Time'
|
File without changes
|
File without changes
|
@@ -71,8 +71,9 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
71
71
|
form.fields_select name: 'user[nil_default]', width: 'matchParent', label: 'Nil Default', options: languages.map { |k, v| { value: k, text: v } }
|
72
72
|
form.fields_select name: 'user[mixed_default][]', width: 'matchParent', label: 'Mixed Default', options: languages.map { |k, v| { value: k, text: v } }, value: ['', 'specified', nil], multiple: true
|
73
73
|
|
74
|
+
# TODO: Remove
|
74
75
|
form.spacer height: 20
|
75
|
-
form.h2 text: 'Autocomplete (select with manual entry)'
|
76
|
+
form.h2 text: 'Autocomplete (select with manual entry) -- DEPRECATED: Confusing UX, promote bad backend design'
|
76
77
|
form.spacer height: 6
|
77
78
|
skills = ['Singing', 'Dancing', 'Fighting']
|
78
79
|
form.fields_autocomplete name: 'user[skill]', width: 'matchParent', label: 'Skill', options: skills, value: 'Singing'
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,120 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
online_channel = 'OnlineChannel'
|
7
|
+
first_user = User.first
|
8
|
+
second_user = User.second
|
9
|
+
|
10
|
+
page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
11
|
+
form.spacer height: 20
|
12
|
+
form.h2 text: 'Standard (Backward)'
|
13
|
+
form.spacer height: 6
|
14
|
+
form.fields_timer \
|
15
|
+
width: 160,
|
16
|
+
styleClasses: ['outlined'],
|
17
|
+
label: 'Timer',
|
18
|
+
name: 'user[timer]',
|
19
|
+
value: 60,
|
20
|
+
min: 30
|
21
|
+
|
22
|
+
form.spacer height: 20
|
23
|
+
form.h2 text: 'Stop Watch (Forward)'
|
24
|
+
form.spacer height: 6
|
25
|
+
form.fields_timer \
|
26
|
+
width: 160,
|
27
|
+
styleClasses: ['outlined'],
|
28
|
+
label: 'Stop Watch',
|
29
|
+
name: 'user[stop_watch]',
|
30
|
+
value: 10,
|
31
|
+
max: 20,
|
32
|
+
forward: true
|
33
|
+
|
34
|
+
form.spacer height: 20
|
35
|
+
form.h2 text: 'Reset timer by ActionCable'
|
36
|
+
online_participant1_config = {
|
37
|
+
channel: online_channel,
|
38
|
+
filterKey: first_user.id
|
39
|
+
}
|
40
|
+
|
41
|
+
form.fields_timer \
|
42
|
+
width: 120,
|
43
|
+
actionCable: online_participant1_config,
|
44
|
+
name: 'user[online_timer1]',
|
45
|
+
value: 3,
|
46
|
+
min: 0
|
47
|
+
|
48
|
+
form.label \
|
49
|
+
text: 'Participant One is online',
|
50
|
+
color: glib_color_success,
|
51
|
+
showIf: {
|
52
|
+
">": [
|
53
|
+
{
|
54
|
+
"var": 'user[online_timer1]'
|
55
|
+
},
|
56
|
+
0
|
57
|
+
]
|
58
|
+
}
|
59
|
+
|
60
|
+
form.label \
|
61
|
+
text: 'Participant One is offline',
|
62
|
+
color: glib_color_error,
|
63
|
+
showIf: {
|
64
|
+
"<=": [
|
65
|
+
{
|
66
|
+
"var": 'user[online_timer1]'
|
67
|
+
},
|
68
|
+
0
|
69
|
+
]
|
70
|
+
}
|
71
|
+
|
72
|
+
form.spacer height: 10
|
73
|
+
form.label text: 'Open Participant One', onClick: ->(action) do
|
74
|
+
action.windows_openWeb url: json_ui_garage_url(path: 'forms/online_participant1')
|
75
|
+
end
|
76
|
+
form.spacer height: 20
|
77
|
+
|
78
|
+
online_participant2_config = {
|
79
|
+
channel: online_channel,
|
80
|
+
filterKey: second_user.id
|
81
|
+
}
|
82
|
+
form.fields_timer \
|
83
|
+
width: 120,
|
84
|
+
actionCable: online_participant2_config,
|
85
|
+
name: 'user[online_timer2]',
|
86
|
+
value: 3,
|
87
|
+
min: 0
|
88
|
+
|
89
|
+
form.label \
|
90
|
+
text: 'Participant Two is online',
|
91
|
+
color: glib_color_success,
|
92
|
+
showIf: {
|
93
|
+
">": [
|
94
|
+
{
|
95
|
+
"var": 'user[online_timer2]'
|
96
|
+
},
|
97
|
+
0
|
98
|
+
]
|
99
|
+
}
|
100
|
+
|
101
|
+
form.label \
|
102
|
+
text: 'Participant Two is offline',
|
103
|
+
color: glib_color_error,
|
104
|
+
showIf: {
|
105
|
+
"<=": [
|
106
|
+
{
|
107
|
+
"var": 'user[online_timer2]'
|
108
|
+
},
|
109
|
+
0
|
110
|
+
]
|
111
|
+
}
|
112
|
+
|
113
|
+
form.spacer height: 10
|
114
|
+
form.label text: 'Open Participant Two', onClick: ->(action) do
|
115
|
+
action.windows_openWeb url: json_ui_garage_url(path: 'forms/online_participant2')
|
116
|
+
end
|
117
|
+
|
118
|
+
form.spacer height: 40
|
119
|
+
form.fields_submit text: 'Submit'
|
120
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,6 +4,12 @@ json_ui_page json do |page|
|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
|
5
5
|
|
6
6
|
page.list firstSection: ->(section) do
|
7
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
8
|
+
header.label text: 'The List panel is useful for displaying a large number of items that are uniform, which is especially important in mobile apps because the rows can be reused for efficiency.'
|
9
|
+
header.spacer height: 6
|
10
|
+
header.label text: 'So, following the mobile-first paradigm, do not ever display large numbers of items using other components.'
|
11
|
+
end
|
12
|
+
|
7
13
|
section.rows builder: ->(template) do
|
8
14
|
template.thumbnail icon: 'list', title: 'Templating', onClick: ->(action) do
|
9
15
|
action.windows_open url: json_ui_garage_url(path: 'lists/templating')
|
File without changes
|
File without changes
|
File without changes
|
@@ -29,6 +29,16 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
29
29
|
panel.button text: '5'
|
30
30
|
end
|
31
31
|
|
32
|
+
scroll.label text: "\n"
|
33
|
+
scroll.h1 text: 'Inner Paddings'
|
34
|
+
scroll.panels_flow innerPadding: { top: 10, bottom: 10, left: 10, right: 10 }, width: 300, backgroundColor: '#b3bac2', childViews: ->(panel) do
|
35
|
+
panel.button text: '1'
|
36
|
+
panel.button text: '2'
|
37
|
+
panel.button text: '3'
|
38
|
+
panel.button text: '4'
|
39
|
+
panel.button text: '5'
|
40
|
+
end
|
41
|
+
|
32
42
|
# scroll.label text: "\n"
|
33
43
|
# scroll.h1 text: 'Alignments'
|
34
44
|
# scroll.panels_horizontal align: 'top', childViews: ->(panel) do
|
@@ -82,7 +82,6 @@ json_ui_page json do |page|
|
|
82
82
|
template.thumbnail title: 'Column', subtitle: 'Adds control over layout inside a responsive panel', onClick: ->(action) do
|
83
83
|
action.windows_open url: json_ui_garage_url(path: 'panels/responsive')
|
84
84
|
end
|
85
|
-
|
86
85
|
end
|
87
86
|
end, ->(section) do
|
88
87
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
@@ -93,6 +92,9 @@ json_ui_page json do |page|
|
|
93
92
|
template.thumbnail title: 'Custom', onClick: ->(action) do
|
94
93
|
action.windows_open url: json_ui_garage_url(path: 'panels/custom')
|
95
94
|
end
|
95
|
+
template.thumbnail title: 'Web', onClick: ->(action) do
|
96
|
+
action.windows_open url: json_ui_garage_url(path: 'panels/web')
|
97
|
+
end
|
96
98
|
|
97
99
|
end
|
98
100
|
end, ->(section) do
|
@@ -0,0 +1,15 @@
|
|
1
|
+
json.title 'Panels'
|
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: 'Web View'
|
8
|
+
end
|
9
|
+
|
10
|
+
page.body height: 'matchParent', padding: glib_json_padding_body, childViews: ->(body) do
|
11
|
+
body.panels_web \
|
12
|
+
width: 'matchParent',
|
13
|
+
height: 'matchParent',
|
14
|
+
url: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
|
15
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
json.title 'Views'
|
2
|
+
|
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.h2 text: 'Button'
|
8
|
+
scroll.spacer height: 6
|
9
|
+
scroll.button text: 'Click me', onClick: ->(action) do
|
10
|
+
action.dialogs_alert message: 'Perform action'
|
11
|
+
end
|
12
|
+
|
13
|
+
scroll.spacer height: 20
|
14
|
+
scroll.h2 text: 'Chip'
|
15
|
+
scroll.spacer height: 6
|
16
|
+
scroll.chip styleClass: 'success', text: 'pending'
|
17
|
+
scroll.spacer height: 6
|
18
|
+
scroll.chip text: 'Skills', onClick: ->(action) do
|
19
|
+
action.dialogs_alert message: 'Perform action'
|
20
|
+
end
|
21
|
+
|
22
|
+
scroll.spacer height: 20
|
23
|
+
scroll.h2 text: 'Switch'
|
24
|
+
scroll.spacer height: 6
|
25
|
+
scroll.switch \
|
26
|
+
text: 'Email notification',
|
27
|
+
onEnabled: ->(action) do
|
28
|
+
action.dialogs_alert message: 'Enabled'
|
29
|
+
end
|
30
|
+
scroll.switch \
|
31
|
+
enabled: true,
|
32
|
+
text: 'Push notification',
|
33
|
+
onDisabled: ->(action) do
|
34
|
+
action.dialogs_alert message: 'Disabled'
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
File without changes
|
@@ -13,6 +13,9 @@ json_ui_page json do |page|
|
|
13
13
|
template.thumbnail title: 'Texts', onClick: ->(action) do
|
14
14
|
action.windows_open url: json_ui_garage_url(path: 'views/texts')
|
15
15
|
end
|
16
|
+
template.thumbnail title: 'Controls', onClick: ->(action) do
|
17
|
+
action.windows_open url: json_ui_garage_url(path: 'views/controls')
|
18
|
+
end
|
16
19
|
template.thumbnail title: 'Images', onClick: ->(action) do
|
17
20
|
action.windows_open url: json_ui_garage_url(path: 'views/images')
|
18
21
|
end
|
File without changes
|
File without changes
|
@@ -32,13 +32,4 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
32
32
|
' comes from a line in section 1.10.32.' + "\n\n" +
|
33
33
|
'The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum"'\
|
34
34
|
' by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.'
|
35
|
-
|
36
|
-
scroll.spacer height: 20
|
37
|
-
scroll.h2 text: 'Chip'
|
38
|
-
scroll.spacer height: 6
|
39
|
-
scroll.chip styleClass: 'success', text: 'pending'
|
40
|
-
scroll.spacer height: 6
|
41
|
-
scroll.chip text: 'Skills', onClick: ->(action) do
|
42
|
-
action.dialogs_alert message: 'Perform action'
|
43
|
-
end
|
44
35
|
end
|
File without changes
|
data/lib/glib/test_helpers.rb
CHANGED
File without changes
|
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.5.
|
4
|
+
version: 0.5.71
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -146,9 +146,9 @@ files:
|
|
146
146
|
- app/views/json_ui/garage/forms/generic_post.json.jbuilder
|
147
147
|
- app/views/json_ui/garage/forms/get_request.json.jbuilder
|
148
148
|
- app/views/json_ui/garage/forms/index.json.jbuilder
|
149
|
-
- app/views/json_ui/garage/forms/misc.json.jbuilder
|
150
|
-
- app/views/json_ui/garage/forms/misc_two.json.jbuilder
|
151
149
|
- app/views/json_ui/garage/forms/new_rich_text.json.jbuilder
|
150
|
+
- app/views/json_ui/garage/forms/online_participant1.json.jbuilder
|
151
|
+
- app/views/json_ui/garage/forms/online_participant2.json.jbuilder
|
152
152
|
- app/views/json_ui/garage/forms/pickers.json.jbuilder
|
153
153
|
- app/views/json_ui/garage/forms/ratings.json.jbuilder
|
154
154
|
- app/views/json_ui/garage/forms/rich_text.json.jbuilder
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- app/views/json_ui/garage/forms/submission_indicator.json.jbuilder
|
161
161
|
- app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder
|
162
162
|
- app/views/json_ui/garage/forms/text_validation.json.jbuilder
|
163
|
+
- app/views/json_ui/garage/forms/timers.json.jbuilder
|
163
164
|
- app/views/json_ui/garage/home/blank.json.jbuilder
|
164
165
|
- app/views/json_ui/garage/home/index.json.jbuilder
|
165
166
|
- app/views/json_ui/garage/home/slow.json.jbuilder
|
@@ -197,6 +198,7 @@ files:
|
|
197
198
|
- app/views/json_ui/garage/panels/responsive.json.jbuilder
|
198
199
|
- app/views/json_ui/garage/panels/split.json.jbuilder
|
199
200
|
- app/views/json_ui/garage/panels/vertical.json.jbuilder
|
201
|
+
- app/views/json_ui/garage/panels/web.json.jbuilder
|
200
202
|
- app/views/json_ui/garage/services/dynamic_text.json.jbuilder
|
201
203
|
- app/views/json_ui/garage/services/image.json.jbuilder
|
202
204
|
- app/views/json_ui/garage/services/index.json.jbuilder
|
@@ -211,6 +213,7 @@ files:
|
|
211
213
|
- app/views/json_ui/garage/views/banners.json.jbuilder
|
212
214
|
- app/views/json_ui/garage/views/calendar_data.json.jbuilder
|
213
215
|
- app/views/json_ui/garage/views/charts.json.jbuilder
|
216
|
+
- app/views/json_ui/garage/views/controls.json.jbuilder
|
214
217
|
- app/views/json_ui/garage/views/icon_names.json.jbuilder
|
215
218
|
- app/views/json_ui/garage/views/icons.json.jbuilder
|
216
219
|
- app/views/json_ui/garage/views/images.json.jbuilder
|
@@ -271,7 +274,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
274
|
- !ruby/object:Gem::Version
|
272
275
|
version: '0'
|
273
276
|
requirements: []
|
274
|
-
|
277
|
+
rubyforge_project:
|
278
|
+
rubygems_version: 2.7.6
|
275
279
|
signing_key:
|
276
280
|
specification_version: 4
|
277
281
|
summary: ''
|
@@ -1,57 +0,0 @@
|
|
1
|
-
json.title 'Forms'
|
2
|
-
|
3
|
-
page = json_ui_page json
|
4
|
-
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
-
|
6
|
-
online_channel = 'OnlineChannel'
|
7
|
-
event = 'online_status'
|
8
|
-
first_user = User.first
|
9
|
-
second_user = User.offset(1).first
|
10
|
-
|
11
|
-
page.on load: ->(action) do
|
12
|
-
action.timeouts_set interval: 1000, repeat: true, onTimeout: ->(subaction) do
|
13
|
-
subaction.cables_push channel: online_channel, event: event, payload: { status: true, user_id: first_user.id, reset_value: 10 }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
page.form \
|
18
|
-
url: json_ui_garage_url(path: 'forms/generic_post'),
|
19
|
-
method: 'post',
|
20
|
-
padding: glib_json_padding_body,
|
21
|
-
childViews: ->(form) do
|
22
|
-
|
23
|
-
form.spacer height: 20
|
24
|
-
form.h2 text: 'Standard (Backward)'
|
25
|
-
form.spacer height: 6
|
26
|
-
form.fields_timer \
|
27
|
-
name: 'user[timer]',
|
28
|
-
value: 60,
|
29
|
-
min: 30
|
30
|
-
|
31
|
-
form.spacer height: 20
|
32
|
-
form.h2 text: 'Stop Watch (Forward)'
|
33
|
-
form.spacer height: 6
|
34
|
-
form.fields_timer \
|
35
|
-
name: 'user[stop_watch]',
|
36
|
-
value: 10,
|
37
|
-
max: 20,
|
38
|
-
forward: true
|
39
|
-
|
40
|
-
form.spacer height: 20
|
41
|
-
form.h2 text: 'Reset timer by ActionCable'
|
42
|
-
online_socket_config = {
|
43
|
-
channel: online_channel,
|
44
|
-
filterKey: second_user.id,
|
45
|
-
params: {
|
46
|
-
conversation: 2
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
form.fields_timer \
|
51
|
-
actionCable: online_socket_config,
|
52
|
-
name: 'user[reset_timer]',
|
53
|
-
value: 10
|
54
|
-
|
55
|
-
form.spacer height: 20
|
56
|
-
form.fields_submit text: 'Submit'
|
57
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
json.title 'Forms'
|
2
|
-
|
3
|
-
page = json_ui_page json
|
4
|
-
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
-
|
6
|
-
online_channel = 'OnlineChannel'
|
7
|
-
event = 'online_status'
|
8
|
-
first_user = User.first
|
9
|
-
second_user = User.offset(1).first
|
10
|
-
|
11
|
-
page.on load: ->(action) do
|
12
|
-
action.timeouts_set interval: 1000, repeat: false, onTimeout: ->(subaction) do
|
13
|
-
subaction.cables_push \
|
14
|
-
channel: online_channel,
|
15
|
-
event: event,
|
16
|
-
payload: { status: true, user_id: first_user.id, reset_value: 10 }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
page.form \
|
21
|
-
url: json_ui_garage_url(path: 'forms/generic_post'),
|
22
|
-
method: 'post',
|
23
|
-
padding: glib_json_padding_body,
|
24
|
-
childViews: ->(form) do
|
25
|
-
|
26
|
-
form.spacer height: 20
|
27
|
-
form.h2 text: 'Set offline when value 0'
|
28
|
-
|
29
|
-
online_socket_config = {
|
30
|
-
channel: online_channel,
|
31
|
-
filterKey: second_user.id,
|
32
|
-
params: {
|
33
|
-
conversation: 2
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
form.fields_timer \
|
38
|
-
name: 'user[online_timer]',
|
39
|
-
value: 10,
|
40
|
-
onZero: lambda { |action|
|
41
|
-
action.cables_push \
|
42
|
-
channel: online_channel,
|
43
|
-
event: event,
|
44
|
-
payload: { status: false, user_id: first_user.id }
|
45
|
-
}
|
46
|
-
|
47
|
-
form.label \
|
48
|
-
actionCable: online_socket_config,
|
49
|
-
text: ' ',
|
50
|
-
showIf: {
|
51
|
-
">=": [
|
52
|
-
{
|
53
|
-
"var": 'user[online_timer]'
|
54
|
-
},
|
55
|
-
0
|
56
|
-
]
|
57
|
-
}
|
58
|
-
|
59
|
-
form.spacer height: 20
|
60
|
-
form.fields_submit text: 'Submit'
|
61
|
-
end
|