glib-web 3.14.2 → 3.15.0
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/channels/glib/channel/appearance_channel.rb +11 -10
- data/app/helpers/glib/json_ui/action_builder.rb +3 -0
- data/app/helpers/glib/json_ui/page_helper.rb +12 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +2 -0
- data/app/views/json_ui/garage/actions/_timeouts.json.jbuilder +5 -1
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +1 -0
- data/app/views/json_ui/garage/notifications/action_cable.json.jbuilder +14 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4698a3bbea4d4960e782ad29170fbb049247d745085663b37d8c2e72f05be6
|
4
|
+
data.tar.gz: 34958e58ee0067170f948af7fba0aebbd9406e35ac7e34f590f8ac6649b43478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d23493798bec86ec387059376a1cc3e4696938f0eb9c3e9de88c9947c9685bcda9aa6f497a04088ce18d276e57ab62b4733151801f8959501aef8c5a52cc57
|
7
|
+
data.tar.gz: c0ece3eebef55739e9f5a8baa756594704851eebea6e91232370e9471cfa260f8c04b83fc6ac512957c7c5f4b12c3dbb79cdd3a24601b7e2cde7fdfd7b78205f
|
@@ -9,16 +9,17 @@ module Glib
|
|
9
9
|
action = {
|
10
10
|
action: 'labels/set',
|
11
11
|
targetId: 'label-1',
|
12
|
-
text: data['text']
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
text: data['text'],
|
13
|
+
onSet: {
|
14
|
+
action: 'timeouts/set',
|
15
|
+
interval: 3000,
|
16
|
+
timerId: 'label-1-set',
|
17
|
+
onTimeout: {
|
18
|
+
action: 'labels/set',
|
19
|
+
targetId: 'label-1',
|
20
|
+
text: "Room ##{data['room'].upcase}"
|
21
|
+
}
|
22
|
+
}
|
22
23
|
}
|
23
24
|
|
24
25
|
broadcast_to("appearance_#{data['room']}", action)
|
@@ -110,6 +110,7 @@ module Glib
|
|
110
110
|
|
111
111
|
module Timeouts
|
112
112
|
class Set < Action
|
113
|
+
string :timerId
|
113
114
|
int :interval # Milliseconds
|
114
115
|
action :onTimeout
|
115
116
|
bool :repeat
|
@@ -121,6 +122,8 @@ module Glib
|
|
121
122
|
|
122
123
|
# FUTURE
|
123
124
|
class Clear < Action
|
125
|
+
string :timerId, required: true
|
126
|
+
bool :repeat
|
124
127
|
end
|
125
128
|
end
|
126
129
|
|
@@ -106,6 +106,18 @@ module Glib
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
if (on_open = options[:onOpen])
|
110
|
+
json.onOpen do
|
111
|
+
on_open.call(@action_builder)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
if (on_close = options[:onClose])
|
116
|
+
json.onClose do
|
117
|
+
on_close.call(@action_builder)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
109
121
|
json.channels options[:channels]
|
110
122
|
end
|
111
123
|
end
|
@@ -11,10 +11,14 @@ section.rows builder: ->(template) do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
template.thumbnail title: 'timeouts/set with repeat', onClick: ->(action) do
|
14
|
-
action.timeouts_set interval: 1000, repeat: true, onTimeout: ->(subaction) do
|
14
|
+
action.timeouts_set timerId: 'timeout-1', interval: 1000, repeat: true, onTimeout: ->(subaction) do
|
15
15
|
subaction.snackbars_alert message: 'Timeout elapsed every 1 second'
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
19
|
+
template.thumbnail title: 'timeouts/clear stop repeat', onClick: ->(action) do
|
20
|
+
action.timeouts_clear timerId: 'timeout-1', repeat: true
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
# section.rows builder: ->(template) do
|
@@ -39,6 +39,7 @@ page.form options.merge(childViews: ->(form) do
|
|
39
39
|
form.spacer height: 16
|
40
40
|
form.fields_multipleUpload \
|
41
41
|
name: 'user[multi][]',
|
42
|
+
accepts: rules,
|
42
43
|
directUploadUrl: rails_direct_uploads_url,
|
43
44
|
title: 'Select file or drag and drop here',
|
44
45
|
subtitle: 'JPG, PNG or PDF, file size no more than 10MB',
|
@@ -18,8 +18,14 @@ if room.present?
|
|
18
18
|
options: { targetId: 'list-1', room: room }
|
19
19
|
}
|
20
20
|
],
|
21
|
-
|
21
|
+
onOpen: ->(action) do
|
22
|
+
action.labels_set targetId: 'label-1', text: "Room ##{room.upcase}"
|
23
|
+
end,
|
24
|
+
onClose: ->(action) do
|
22
25
|
action.labels_set targetId: 'label-1', text: "Room ##{room.upcase} (OFF)"
|
26
|
+
end,
|
27
|
+
onError: ->(action) do
|
28
|
+
action.labels_set targetId: 'label-1', text: "Room ##{room.upcase} (ERROR)"
|
23
29
|
end
|
24
30
|
end
|
25
31
|
|
@@ -30,7 +36,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
30
36
|
form.fields_hidden name: 'chat[room]', value: room
|
31
37
|
form.fields_hidden name: 'chat[user]', value: user
|
32
38
|
|
33
|
-
form.p id: 'label-1', text:
|
39
|
+
form.p id: 'label-1', text: 'Loading...'
|
34
40
|
|
35
41
|
form.panels_list width: 'matchParent', height: 'matchParent', id: 'list-1', sections: [
|
36
42
|
->(section) do
|
@@ -47,13 +53,13 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
47
53
|
event: 'status',
|
48
54
|
channel: 'Glib::Channel::AppearanceChannel',
|
49
55
|
payload: { text: "#{user} is typing", room: room }
|
50
|
-
end,
|
51
|
-
onTypeEnd: ->(action) do
|
52
|
-
action.cables_push \
|
53
|
-
event: 'status',
|
54
|
-
channel: 'Glib::Channel::AppearanceChannel',
|
55
|
-
payload: { text: "Room ##{room.upcase}", room: room }
|
56
56
|
end
|
57
|
+
# onTypeEnd: ->(action) do
|
58
|
+
# action.cables_push \
|
59
|
+
# event: 'status',
|
60
|
+
# channel: 'Glib::Channel::AppearanceChannel',
|
61
|
+
# payload: { text: "Room ##{room.upcase}", room: room }
|
62
|
+
# end
|
57
63
|
end
|
58
64
|
end
|
59
65
|
]
|