glib-web 3.14.2 → 3.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73a7b9c04e171d374cba337720592ea50ac8ef1a7d15d1af315490d7cfa1f044
4
- data.tar.gz: c583570b3b87c94fb65202efbb31fd67a324e1139466154739e2ae0ed0afc3d3
3
+ metadata.gz: 3d4698a3bbea4d4960e782ad29170fbb049247d745085663b37d8c2e72f05be6
4
+ data.tar.gz: 34958e58ee0067170f948af7fba0aebbd9406e35ac7e34f590f8ac6649b43478
5
5
  SHA512:
6
- metadata.gz: d117002112d56a0a729cdebf8aca501154597d048df97dfe8de90a4fc11cebe35343fb9a904d9930fbe90bb52b882467f33d4b1207949c1935b1ba0164acae8c
7
- data.tar.gz: 31efc5d359c71fd256e0597ce3396bf5123fe9d70c7f0e3f26f092154fb9ac71b77e18e106d5bcce44bb4f783f7a9640d01ae35af6920b261ce3a0e9cecd36db
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
- # onSet: {
14
- # action: 'timeouts/set',
15
- # interval: 1000,
16
- # onTimeout: {
17
- # action: 'labels/set',
18
- # targetId: 'label-1',
19
- # text: "Room ##{data['room'].upcase}"
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
@@ -271,6 +271,8 @@ class Glib::JsonUi::ViewBuilder
271
271
  string :subtitle
272
272
  string :uploadTitle
273
273
  string :uploadFailedText
274
+
275
+ required :accepts, :directUploadUrl
274
276
  end
275
277
 
276
278
  # TODO
@@ -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
- onError: ->(action) do
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: "Room ##{room.upcase}"
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
  ]
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: 3.14.2
4
+ version: 3.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''