glib-web 0.5.13 → 0.5.14

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: 817f2b8ec420805eaca15e6d46be0f79249bc7c9
4
- data.tar.gz: 96b64cabaae675985e1d2344b99ecacbb23d2239
3
+ metadata.gz: f440c189aedc472b187e045fc6a7f860450f8301
4
+ data.tar.gz: 395891b80b5ca90022b42f5216003d57006a5ebc
5
5
  SHA512:
6
- metadata.gz: 6fdd5765bcd2e7b515f08639c3cacfcc288abbdf2ee00aa340344a84c333cf316474095bf08173335a39a83267c5b68b61ae61d89f2a7238de369ea8541ecdd9
7
- data.tar.gz: 87c694a3439074a2264939603d6f44dc6bcbefa68f518b8f454b18ee6661500f5a3d88632d4760892b22730f98833d02dd00d7d215261dfe4d7ef6df98e71e1a
6
+ metadata.gz: 29f95c4110b05050e3d5a28035c12c62c1bae2448798882f629fb1e2c0fd5a9b9e40c9df149f6ec90233dbce339d1a83830c99245cee5a33559c7fe7c3d283e7
7
+ data.tar.gz: 01fee1f715657b457dfd1f4e2026db4e014c5912c446c12e6042b8b416e0119e9da985491d37fee39af24c3576a40d3da41d2c3916820b4b13b4da71cdc1a6fd
@@ -7,7 +7,11 @@ module Glib
7
7
  end
8
8
 
9
9
  class AbstractTemplate < JsonUiElement
10
- # hash :padding
10
+ # def contextButtons(block)
11
+ # json.contextButtons do
12
+ # block.call page.menu_builder
13
+ # end
14
+ # end
11
15
 
12
16
  def editButtons(block)
13
17
  json.editButtons do
@@ -22,12 +26,13 @@ module Glib
22
26
  end
23
27
  end
24
28
 
25
- class Thumbnail < AbstractTemplate
29
+ class Standard < AbstractTemplate
26
30
  string :title
27
31
  string :subtitle
28
32
  string :subsubtitle
29
33
  string :imageUrl
30
34
  action :onClick
35
+ action :onLongPress
31
36
  icon :icon
32
37
  bool :avatar
33
38
 
@@ -36,10 +41,19 @@ module Glib
36
41
  # views :accessoryViews
37
42
  end
38
43
 
39
- class Featured < Thumbnail
44
+ class Featured < Standard
40
45
  end
41
46
 
42
- class Custom < Thumbnail
47
+ class Thumbnail < Standard
48
+ end
49
+
50
+ class CommentOutgoing < Standard
51
+ end
52
+
53
+ class CommentIncoming < Standard
54
+ end
55
+
56
+ class Custom < Standard
43
57
  string :template
44
58
 
45
59
  # TODO: Experimental
@@ -12,7 +12,6 @@ section.rows builder: ->(template) do
12
12
  menu.button text: 'Option2', onClick: ->(subaction) do
13
13
  subaction.dialogs_alert message: 'Option 2'
14
14
  end
15
- menu.button text: 'Cancel'
16
15
  end
17
16
  end
18
17
 
@@ -0,0 +1,112 @@
1
+ json.title 'Lists'
2
+
3
+ liked = params[:liked] == 'true'
4
+
5
+ json_ui_page json do |page|
6
+ render "#{@path_prefix}/nav_menu", json: json, page: page
7
+
8
+ page.list firstSection: ->(section) do
9
+ section.header padding: { top: 12, left: 16, right: 16, bottom: 12 }, childViews: ->(header) do
10
+ header.h3 text: 'Chat with John Doe'
11
+ end
12
+
13
+ section.rows builder: ->(template) do
14
+ # template.thumbnail title: "windows/reload (timestamp: #{DateTime.current.to_i}) -- #{liked}", onClick: ->(action) do
15
+ # action.windows_reload
16
+ # end, onLongPress: ->(action) do
17
+ # action.sheets_select message: "Context Menu (#{DateTime.current.to_i})", buttons: ->(menu) do
18
+ # if liked
19
+ # menu.button text: 'Cancel 👍', onClick: ->(subaction) do
20
+ # subaction.windows_reload url: json_ui_garage_url(path: 'lists/chat', liked: false)
21
+ # end
22
+ # else
23
+ # menu.button text: 'Give 👍', onClick: ->(subaction) do
24
+ # subaction.windows_reload url: json_ui_garage_url(path: 'lists/chat', liked: true)
25
+ # end
26
+ # end
27
+ # end
28
+ # end
29
+
30
+ template.commentOutgoing subtitle: 'Hey!', subsubtitle: l(10.minutes.ago, format: :short), imageUrl: glib_json_image_standard_url, chips: ->(menu) do
31
+ menu.button text: '😊 2', styleClass: 'info'
32
+ end
33
+
34
+ template.commentOutgoing subtitle: 'How are you?', subsubtitle: l(DateTime.current, format: :short)
35
+
36
+ template.commentIncoming title: 'John Doe', subtitle: 'Very well', subsubtitle: l(7.minutes.ago, format: :short), imageUrl: glib_json_image_standard_url, chips: ->(menu) do
37
+ menu.button text: "👍 #{liked ? 2 : 1}"
38
+ end, onLongPress: ->(action) do
39
+ action.sheets_select message: 'Context Menu', buttons: ->(menu) do
40
+ if liked
41
+ menu.button text: 'Cancel 👍', onClick: ->(subaction) do
42
+ subaction.windows_reload url: json_ui_garage_url(path: 'lists/chat', liked: false)
43
+ end
44
+ else
45
+ menu.button text: 'Give 👍', onClick: ->(subaction) do
46
+ subaction.windows_reload url: json_ui_garage_url(path: 'lists/chat', liked: true)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ section.footer padding: { top: 12, left: 16, right: 16, bottom: 12 }, childViews: ->(footer) do
54
+ # footer.
55
+
56
+ # json.ws({
57
+ # "socket" => {
58
+ # "endpoint" => "/socket/websocket",
59
+ # "params" => {
60
+ # vsn: '2.0.0',
61
+ # token: 'TOKEN'
62
+ # }
63
+ # },
64
+ # # "topic" => "room:30",
65
+ # # "event" => "comments_updated",
66
+ # "topic" => "links",
67
+ # "events" => ["new_link_added"],
68
+ # "header" => {
69
+ # "user_id" => 2,
70
+ # "prev_item_id" => nil,
71
+ # "last_item_id" => nil
72
+ # }
73
+ # })
74
+
75
+ # page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, paramNameForFormData: 'formData', onSubmit: ->(action) do
76
+ # json.action "ws/push"
77
+ # json.topic "links"
78
+ # json.event "new_link"
79
+ # json.payload({
80
+ # "club_id": "2",
81
+ # "room_id": "30",
82
+ # "user_id": "2"
83
+ # # title: "TITLE",
84
+ # # url: "URL"
85
+ # })
86
+
87
+ # end, childViews: ->(form) do
88
+ # form.spacer height: 14
89
+ # form.label text: "Message: #{params[:message]}"
90
+ # form.spacer height: 14
91
+
92
+ # form.fields_text name: 'message[body]', width: 'matchParent', label: 'Message'
93
+
94
+ # # TODO: Change this to radio for selecting alert vs reload response
95
+ # form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
96
+
97
+ # form.fields_hidden name: 'baseUrl', width: 'matchParent', value: json_ui_garage_url(path: 'notifications/web_socket')
98
+
99
+ # form.panels_split width: 'matchParent', content: ->(split) do
100
+ # # split.left childViews: ->(left) do
101
+ # # if params[:mode] == 'dialog'
102
+ # # left.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
103
+ # # end
104
+ # # end
105
+ # split.right childViews: ->(right) do
106
+ # right.button text: 'Submit', onClick: ->(action) { action.forms_submit }
107
+ # end
108
+ # end
109
+
110
+ end
111
+ end
112
+ end
@@ -2,7 +2,7 @@ json.title 'Lists'
2
2
 
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
5
+
6
6
  page.list firstSection: ->(section) do
7
7
  section.rows builder: ->(template) do
8
8
  template.thumbnail title: 'Click menu (web) or swipe left (Android/iOS)', editButtons: ->(menu) do
@@ -13,6 +13,30 @@ json_ui_page json do |page|
13
13
  action.dialogs_alert message: 'Perform action'
14
14
  end
15
15
  end
16
+
17
+ template.thumbnail title: 'Long press to get an alert', onLongPress: ->(action) do
18
+ action.dialogs_alert message: 'This is an alert'
19
+ end
20
+
21
+ template.thumbnail title: 'Long press to see menu', onLongPress: ->(action) do
22
+ action.sheets_select message: 'Context Menu', buttons: ->(menu) do
23
+ menu.button icon: 'edit', text: 'Edit', onClick: ->(subaction) do
24
+ subaction.dialogs_alert message: 'Perform action'
25
+ end
26
+ menu.button icon: 'delete', text: 'Delete', onClick: ->(subaction) do
27
+ subaction.dialogs_alert message: 'Perform action'
28
+ end
29
+ end
30
+ end
31
+
32
+ # template.thumbnail title: 'Long press to see menu', contextButtons: ->(menu) do
33
+ # menu.button text: 'Edit', onClick: ->(action) do
34
+ # action.dialogs_alert message: 'Perform action'
35
+ # end
36
+ # menu.button text: 'Delete', onClick: ->(action) do
37
+ # action.dialogs_alert message: 'Perform action'
38
+ # end
39
+ # end
16
40
  end
17
41
 
18
42
  end
@@ -17,6 +17,9 @@ json_ui_page json do |page|
17
17
  template.thumbnail title: 'FAB (Floating Action Button)', onClick: ->(action) do
18
18
  action.windows_open url: json_ui_garage_url(path: 'lists/fab')
19
19
  end
20
+ template.thumbnail title: 'Chat Prototype', onClick: ->(action) do
21
+ action.windows_open url: json_ui_garage_url(path: 'lists/chat')
22
+ end
20
23
  end
21
24
 
22
25
  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.5.13
4
+ version: 0.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -107,7 +107,6 @@ files:
107
107
  - app/validators/email_typo_validator.rb
108
108
  - app/validators/email_validator.rb
109
109
  - app/validators/url_validator.rb
110
- - app/views/app/views/json_ui/vue/renderer.html.erb
111
110
  - app/views/json_ui/garage/_nav_menu.json.jbuilder
112
111
  - app/views/json_ui/garage/actions/_dialogs.json.jbuilder
113
112
  - app/views/json_ui/garage/actions/_http.json.jbuilder
@@ -144,6 +143,7 @@ files:
144
143
  - app/views/json_ui/garage/home/index.json.jbuilder
145
144
  - app/views/json_ui/garage/home/slow.json.jbuilder
146
145
  - app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder
146
+ - app/views/json_ui/garage/lists/chat.json.jbuilder
147
147
  - app/views/json_ui/garage/lists/edit_actions.json.jbuilder
148
148
  - app/views/json_ui/garage/lists/fab.json.jbuilder
149
149
  - app/views/json_ui/garage/lists/index.json.jbuilder
@@ -1,35 +0,0 @@
1
- <!-- Deprecated. Use layouts instead
2
- <!DOCTYPE html>
3
- <html>
4
-
5
- <head>
6
- <meta charset="utf-8" />
7
- <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" />
8
-
9
- <title>App</title>
10
- <%= csrf_meta_tags %>
11
-
12
- <%= javascript_pack_tag 'vue_renderer', defer: true %>
13
- <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
14
-
15
- <%= stylesheet_pack_tag 'vue_renderer' %>
16
- <% if (custom_css_path = options[:custom_css_path]) %>
17
- <%= stylesheet_link_tag custom_css_path, media: 'all' %>
18
- <% end %>
19
-
20
- <link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
21
- </head>
22
-
23
- <body>
24
- <noscript>Please enable JavaScript to view this web site.</noscript>
25
- <div id="app"></div>
26
-
27
- <script>
28
- var __page = <%= raw @__json_ui_orig_page%>;
29
- </script>
30
-
31
- <% locals[:footer_block]&.call %>
32
- </body>
33
-
34
- </html>
35
- -->