glib-web 0.4.65 → 0.4.66

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
  SHA1:
3
- metadata.gz: 2158feb2985dca0cb028b034fbd8b9d9ba94924b
4
- data.tar.gz: 5319d4abaa9541211a111ed57c1d505e7a50e154
3
+ metadata.gz: 79b0d05fad96e500e336fd3705ed09ff53199d4d
4
+ data.tar.gz: 6cec3284142a09fb31f2d65f797047be7909e769
5
5
  SHA512:
6
- metadata.gz: 472b176e7a2e6bacb8d3f0e8c562df8e7ac339618f544f4685344d2a2efd04fad2ccdd42735ad134223d447b90fd4dbb89ce4b1dfa31e7780e904149634801ef
7
- data.tar.gz: 921148bf350fa27bbd43a8b13770551af7cf872c3fe49944e7f9e2a4b14a51aa16688c1755b2490f707ee69a9a4140a9e13505717a04af4825a08806cae7daab
6
+ metadata.gz: c8b9ab890ab1d8826d0839f1363102731a203ad82682e2846cb27a11e0caddb3144f9f10cb87d624a01837deb56a42878e5e81dd1d81e85ff46a1df60551b135
7
+ data.tar.gz: 5dadd52713ca918d748c1a57d574eb048b0667b4e69dfe9d0d8f764e14589c538d36f70522a95feb27ac3a5a81381f1cf90b2c9bbfa3cb7ac0241b4635602614
@@ -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)
@@ -149,6 +151,7 @@ class Glib::JsonUi::ViewBuilder
149
151
 
150
152
  class Responsive < View
151
153
  views :childViews
154
+ string :align
152
155
  end
153
156
 
154
157
  class Column < View
@@ -188,6 +191,12 @@ class Glib::JsonUi::ViewBuilder
188
191
  class Custom < View
189
192
  string :template
190
193
  hash :data
194
+
195
+ def content(block)
196
+ json.data do
197
+ block.call page.view_builder
198
+ end
199
+ end
191
200
  end
192
201
 
193
202
  class Ul < View
@@ -10,6 +10,9 @@ json_ui_page json do |page|
10
10
  form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
11
11
  form.fields_textarea name: 'user[textarea]', width: 'matchParent', label: 'Textarea with maxLength', maxLength: 50, validation: { required: { message: 'Required' } }
12
12
 
13
+ options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
14
+ form.fields_select name: 'user[gender]', width: 'matchParent', label: 'Gender', validation: { required: { message: 'Required' } }, options: options
15
+
13
16
  form.spacer height: 20
14
17
  form.fields_stripeToken name: 'user[stripe_token]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx'
15
18
 
@@ -1,15 +1,61 @@
1
1
  json.title 'Notifications'
2
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 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
3
+ # json.ws({
4
+ # "socket" => {
5
+ # "endpoint" => "/socket/websocket",
6
+ # "params" => {
7
+ # "vsn": "2.0.0"
8
+ # }
9
+ # },
10
+ # # "topic" => "room:30",
11
+ # # "event" => "comments_updated",
12
+ # "topic" => "links",
13
+ # "event" => "new_link_added",
14
+ # "header" => {
15
+ # "user_id" => 2,
16
+ # "prev_item_id" => nil,
17
+ # "last_item_id" => nil
18
+ # }
19
+ # })
20
+
21
+ page = json_ui_page json
22
+ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
23
+
24
+ page.list firstSection: ->(section) do
25
+ section.rows builder: ->(template) do
26
+ template.thumbnail title: 'Send Desktop Notification', onClick: ->(action) do
27
+ action.dialogs_notification title: 'Hello World', message: 'This is a notification', onClick: ->(subaction) do
28
+ subaction.dialogs_alert message: 'Perform action'
12
29
  end
13
30
  end
31
+
32
+ template.thumbnail title: 'WebSocket Real-time Update', onClick: ->(action) do
33
+ action.windows_open url: json_ui_garage_url(path: 'notifications/web_socket')
34
+ # dialogs_notification title: 'Hello World', message: 'This is a notification', onClick: ->(subaction) do
35
+ # subaction.dialogs_alert message: 'Perform action'
36
+ # end
37
+ end
38
+
39
+ # template.thumbnail title: 'Send WebSocket Notification', onClick: ->(action) do
40
+ # json.action "ws/push"
41
+ # json.topic "links"
42
+ # json.event "new_link"
43
+ # json.payload({
44
+ # "club_id": "2",
45
+ # "room_id": "30",
46
+ # "user_id": "2"
47
+ # # title: "TITLE",
48
+ # # url: "URL"
49
+ # })
50
+
51
+ # # "topic": "room:30",
52
+ # # "event": "create_comment",
53
+ # # "payload": {
54
+ # # "club_id": "2",
55
+ # # "room_id": "30",
56
+ # # "user_id": "2"
57
+ # # }
58
+
59
+ # end
14
60
  end
15
61
  end
@@ -0,0 +1,61 @@
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
+ }
12
+ },
13
+ # "topic" => "room:30",
14
+ # "event" => "comments_updated",
15
+ "topic" => "links",
16
+ "event" => "new_link_added",
17
+ "header" => {
18
+ "user_id" => 2,
19
+ "prev_item_id" => nil,
20
+ "last_item_id" => nil
21
+ }
22
+ })
23
+
24
+ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, paramNameForFormData: 'formData', onSubmit: ->(action) do
25
+ # action.dialogs_alert
26
+
27
+ json.action "ws/push"
28
+ json.topic "links"
29
+ json.event "new_link"
30
+ json.payload({
31
+ "club_id": "2",
32
+ "room_id": "30",
33
+ "user_id": "2"
34
+ # title: "TITLE",
35
+ # url: "URL"
36
+ })
37
+
38
+ # "topic": "room:30",
39
+ # "event": "create_comment",
40
+ # "payload": {
41
+ # "club_id": "2",
42
+ # "room_id": "30",
43
+ # "user_id": "2"
44
+ # }
45
+
46
+ end, childViews: ->(form) do
47
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
48
+ form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
49
+
50
+ form.panels_split width: 'matchParent', content: ->(split) do
51
+ # split.left childViews: ->(left) do
52
+ # if params[:mode] == 'dialog'
53
+ # left.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
54
+ # end
55
+ # end
56
+ split.right childViews: ->(right) do
57
+ right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
58
+ end
59
+ end
60
+
61
+ end
@@ -54,7 +54,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
54
54
  scroll.spacer height: 20
55
55
  scroll.h2 text: 'With mixed components'
56
56
  scroll.spacer height: 6
57
- scroll.panels_responsive width: 'matchParent', childViews: ->(responsive) do
57
+ scroll.panels_responsive width: 'matchParent', align: 'center', childViews: ->(responsive) do
58
58
  responsive.h4 text: 'Heading'
59
59
 
60
60
  responsive.label text: 'Label'
@@ -1,18 +1,17 @@
1
1
  json.title 'Dynamic Texts'
2
2
 
3
- json_ui_page json do |page|
4
- render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
5
5
 
6
- page.list firstSection: ->(section) do
7
- section.rows builder: ->(template) do
8
- template.thumbnail title: 'Dynamic Text', onClick: ->(action) do
9
- action.windows_open url: json_ui_garage_url(path: 'services/dynamic_text')
10
- end
11
-
12
- template.thumbnail title: 'Image', onClick: ->(action) do
13
- action.windows_open url: json_ui_garage_url(path: 'services/image')
14
- end
6
+ page.list firstSection: ->(section) do
7
+ section.rows builder: ->(template) do
8
+ template.thumbnail title: 'Dynamic Text', onClick: ->(action) do
9
+ action.windows_open url: json_ui_garage_url(path: 'services/dynamic_text')
15
10
  end
16
11
 
12
+ template.thumbnail title: 'Image', onClick: ->(action) do
13
+ action.windows_open url: json_ui_garage_url(path: 'services/image')
14
+ end
17
15
  end
16
+
18
17
  end
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.4.65
4
+ version: 0.4.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -141,6 +141,7 @@ files:
141
141
  - app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder
142
142
  - app/views/json_ui/garage/lists/templating.json.jbuilder
143
143
  - app/views/json_ui/garage/notifications/index.json.jbuilder
144
+ - app/views/json_ui/garage/notifications/web_socket.json.jbuilder
144
145
  - app/views/json_ui/garage/pages/flat_centered.json.jbuilder
145
146
  - app/views/json_ui/garage/pages/full_width.json.jbuilder
146
147
  - app/views/json_ui/garage/pages/full_width_height.json.jbuilder