glib-web 0.0.13 → 0.0.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
  SHA256:
3
- metadata.gz: fa54978babb0309d7e60e95a3ac0a8de38d6e7114986154e07ce37af78014f49
4
- data.tar.gz: 9f74445f4674fbbe6985565db1e621ba4dd04bc9c029b8dbcff8276d7066cafa
3
+ metadata.gz: fc06c04993bc790fd9234381201fd24ce3ed1b8520aefee43633bed714b51ec5
4
+ data.tar.gz: 45a7e73f8a23d33da64bc9ab5936db68be9f1bd1b507205d54e97d1bf5abb1e1
5
5
  SHA512:
6
- metadata.gz: 5b8022ad0f2c590e36832fdee3b985c2470421bce4d13047883cce252979bf5ff7d7000598e139d709d09eb1f1bdd9febf9c19a6b406699bb4955cb9bbd2366d
7
- data.tar.gz: 1a760bc4370f659e4d819af3b966462301818f36ea85e88d5201a06a47132efa56f580fe39a81431ee7ffc9b49c8c6ab8befe592c243f93df3b89bea221232e8
6
+ metadata.gz: cf337b7c9aa21d9a4e6b4a4dd2f7380ff5b88cfa3666d5fdf5d402d70c9d72d75211ed4725f31f61a064b2cae4aa158a75b7dd799c8f189c683c12a42cff3fb1
7
+ data.tar.gz: 7929fd151cce9c6a68666be64307ea9f5fd7936280134be466b54a306248cde897a8643807f655eaf8ad8dce014d9ea2ed44e66cae5f4887bb594225bcbca918
@@ -2,93 +2,93 @@ module Glib
2
2
  module JsonUi
3
3
  # TODO: Remove (deprecated)
4
4
  module JsonUiHelper
5
- class Builder
6
- def initialize(json)
7
- @json = json
8
- end
5
+ # class Builder
6
+ # def initialize(json)
7
+ # @json = json
8
+ # end
9
9
 
10
- def optional(options, *props)
11
- props.each do |prop|
12
- @json.set! prop, options[prop]
13
- end
14
- end
15
- end
10
+ # def optional(options, *props)
11
+ # props.each do |prop|
12
+ # @json.set! prop, options[prop]
13
+ # end
14
+ # end
15
+ # end
16
16
 
17
- def json_body_with_list(json, header = nil, footer = nil, options = {})
18
- json.header header
19
- json.content do
20
- json.childViews [1] do
21
- json.view 'panels/list-v1'
22
- json.width 'matchParent'
23
- json.nextPage options[:nextPage]
24
- json.sections [1] do
25
- yield
26
- end
27
- end
28
- end
29
- json.footer footer
30
- end
17
+ # def json_body_with_list(json, header = nil, footer = nil, options = {})
18
+ # json.header header
19
+ # json.content do
20
+ # json.childViews [1] do
21
+ # json.view 'panels/list-v1'
22
+ # json.width 'matchParent'
23
+ # json.nextPage options[:nextPage]
24
+ # json.sections [1] do
25
+ # yield
26
+ # end
27
+ # end
28
+ # end
29
+ # json.footer footer
30
+ # end
31
31
 
32
- def json_body_with_scroll(json, header = nil, footer = nil, options = {})
33
- builder = Builder.new(json)
32
+ # def json_body_with_scroll(json, header = nil, footer = nil, options = {})
33
+ # builder = Builder.new(json)
34
34
 
35
- json.header header
36
- json.content do
37
- json.childViews [1] do
38
- json.view 'panels/scroll-v1'
39
- json.width 'matchParent'
35
+ # json.header header
36
+ # json.content do
37
+ # json.childViews [1] do
38
+ # json.view 'panels/scroll-v1'
39
+ # json.width 'matchParent'
40
40
 
41
- builder.optional(options, :padding, :backgroundColor)
41
+ # builder.optional(options, :padding, :backgroundColor)
42
42
 
43
- json.childViews do
44
- yield
45
- end
46
- end
47
- end
48
- json.footer footer
49
- end
43
+ # json.childViews do
44
+ # yield
45
+ # end
46
+ # end
47
+ # end
48
+ # json.footer footer
49
+ # end
50
50
 
51
- def json_body_with_form(json, header = nil, footer = nil, options = {})
52
- json.header header
53
- json_body_with_scroll json do
54
- method = options[:method].to_sym
51
+ # def json_body_with_form(json, header = nil, footer = nil, options = {})
52
+ # json.header header
53
+ # json_body_with_scroll json do
54
+ # method = options[:method].to_sym
55
55
 
56
- json.child! do
57
- json.view 'panels/form-v1'
58
- json.width 'matchParent'
59
- json.(options, :url)
56
+ # json.child! do
57
+ # json.view 'panels/form-v1'
58
+ # json.width 'matchParent'
59
+ # json.(options, :url)
60
60
 
61
- case method
62
- when :patch, :put, :delete
63
- json.method :post
64
- else
65
- json.method method
66
- end
61
+ # case method
62
+ # when :patch, :put, :delete
63
+ # json.method :post
64
+ # else
65
+ # json.method method
66
+ # end
67
67
 
68
- json.padding options[:padding]
69
- json.local options[:local]
70
- json.childViews do
71
- json.child! do
72
- json.view 'fields/hidden-v1'
73
- json.name 'authenticity_token'
74
- json.value form_authenticity_token
75
- end
68
+ # json.padding options[:padding]
69
+ # json.local options[:local]
70
+ # json.childViews do
71
+ # json.child! do
72
+ # json.view 'fields/hidden-v1'
73
+ # json.name 'authenticity_token'
74
+ # json.value form_authenticity_token
75
+ # end
76
76
 
77
- case method
78
- when :patch, :put, :delete
79
- json.child! do
80
- json.view 'fields/hidden-v1'
81
- json.name '_method'
82
- json.value method
83
- end
84
- end
77
+ # case method
78
+ # when :patch, :put, :delete
79
+ # json.child! do
80
+ # json.view 'fields/hidden-v1'
81
+ # json.name '_method'
82
+ # json.value method
83
+ # end
84
+ # end
85
85
 
86
- yield
87
- end
88
- end
89
- end
90
- json.footer footer
91
- end
86
+ # yield
87
+ # end
88
+ # end
89
+ # end
90
+ # json.footer footer
91
+ # end
92
92
  end
93
93
  end
94
94
  end
@@ -18,8 +18,13 @@ module Glib
18
18
  class Thumbnail < AbstractTemplate
19
19
  string :title
20
20
  string :subtitle
21
+ string :subsubtitle
22
+ string :imageUrl
21
23
  action :onClick
22
24
  end
25
+
26
+ class Featured < Thumbnail
27
+ end
23
28
  end
24
29
 
25
30
  class Section < AbstractBuilder
@@ -62,5 +62,13 @@ class Glib::JsonUi::ViewBuilder
62
62
  string :label
63
63
  string :value
64
64
  end
65
+
66
+ class File < Text
67
+ string :accepts
68
+ string :s3_direct_upload_url
69
+ string :file_size_limit_alert_text
70
+ string :value
71
+ int :file_size_limit
72
+ end
65
73
  end
66
74
  end
@@ -50,6 +50,7 @@ module Glib
50
50
 
51
51
  class Image < View
52
52
  string :url
53
+ string :base64Data
53
54
  action :onClick
54
55
  end
55
56
 
@@ -57,6 +58,13 @@ module Glib
57
58
  string :text
58
59
  end
59
60
 
61
+ class Map < View
62
+ float :latitude
63
+ float :longitude
64
+ int :zoom
65
+ string :height
66
+ end
67
+
60
68
  end
61
69
  end
62
70
  end
@@ -7,47 +7,59 @@ options = {
7
7
  method: 'post',
8
8
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
9
9
  }
10
- json_body_with_form json, nil, nil, options do
11
- json.child! do
12
- json.view 'fields/text-v1'
13
- json.name 'user[name]'
14
- json.width 'matchParent'
15
- json.label 'Name'
16
- end
17
-
18
- json.child! do
19
- json.view 'fields/email-v1'
20
- json.name 'user[email]'
21
- json.width 'matchParent'
22
- json.label 'Email'
23
- end
24
-
25
- json.child! do
26
- json.view 'fields/password-v1'
27
- json.name 'user[password]'
28
- json.width 'matchParent'
29
- json.label 'Password'
30
- end
31
-
32
- json.child! do
33
- json.view 'panels/split-v1'
34
- json.width 'matchParent'
35
-
36
- json.rightViews do
37
- json.child! do
38
- json.view 'button-v1'
39
- json.text 'Submit'
40
- json.onClick do
41
- json.action 'forms/submit-v1'
42
-
43
- # json.action 'forms/encode-v1'
44
- # json.paramName 'formData'
45
- # json.onEncoded do
46
- # json.action 'http/post-v1'
47
- # json.url json_ui_garage_url(path: 'forms/basic_post')
48
- # end
49
- end
50
- end
10
+
11
+ json_ui_page json do |page|
12
+ page.form options.merge(childViews: ->(form) do
13
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
14
+ form.fields_email name: 'user[email]', width: 'matchParent', label: 'Email'
15
+ form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
16
+ form.panels_split width: 'matchParent', rightViews: ->(split) do
17
+ split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
51
18
  end
52
- end
19
+ end)
53
20
  end
21
+
22
+ # json_body_with_form json, nil, nil, options do
23
+ # json.child! do
24
+ # json.view 'fields/text-v1'
25
+ # json.name 'user[name]'
26
+ # json.width 'matchParent'
27
+ # json.label 'Name'
28
+ # end
29
+
30
+ # json.child! do
31
+ # json.view 'fields/email-v1'
32
+ # json.name 'user[email]'
33
+ # json.width 'matchParent'
34
+ # json.label 'Email'
35
+ # end
36
+
37
+ # json.child! do
38
+ # json.view 'fields/password-v1'
39
+ # json.name 'user[password]'
40
+ # json.width 'matchParent'
41
+ # json.label 'Password'
42
+ # end
43
+
44
+ # json.child! do
45
+ # json.view 'panels/split-v1'
46
+ # json.width 'matchParent'
47
+
48
+ # json.rightViews do
49
+ # json.child! do
50
+ # json.view 'button-v1'
51
+ # json.text 'Submit'
52
+ # json.onClick do
53
+ # json.action 'forms/submit-v1'
54
+
55
+ # # json.action 'forms/encode-v1'
56
+ # # json.paramName 'formData'
57
+ # # json.onEncoded do
58
+ # # json.action 'http/post-v1'
59
+ # # json.url json_ui_garage_url(path: 'forms/basic_post')
60
+ # # end
61
+ # end
62
+ # end
63
+ # end
64
+ # end
65
+ # end
@@ -7,32 +7,40 @@ options = {
7
7
  method: 'post',
8
8
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
9
9
  }
10
- json_body_with_form json, nil, nil, options do
11
- json.child! do
12
- json.view 'fields/file-v1'
13
- json.name 'user[photo]'
14
- json.width 'matchParent'
15
- json.label 'Photo'
16
-
17
- json.value 'VALUE_OF_THE_PREVIOUS_IMAGE_WHICH_IS_USEFUL_WHEN_UPDATING_EXISTING_MODEL'
18
-
19
- json.accepts "image/*"
20
- # json.s3_bucket 'BUCKET_NAME'
21
- # json.s3_path_prefix 'uploads/images'
22
- json.s3_direct_upload_url rails_direct_uploads_path
23
-
24
- # This is for security so we don't have to reveal key/secret in the json api
25
- # json.s3_signature_url 'URL_TO_OUR_SERVER_TO_GET_GENERATED_SIGNATURE'
26
-
27
- json.file_size_limit 5000 # 5 MB
28
- json.file_size_limit_alert_text 'Too big!'
29
- end
30
-
31
- json.child! do
32
- json.view 'button-v1'
33
- json.text 'Submit'
34
- json.onClick do
35
- json.action 'forms/submit-v1'
36
- end
37
- end
10
+
11
+ json_ui_page json do |page|
12
+ page.form options.merge(childViews: ->(form) do
13
+ form.fields_file name: 'user[photo]', width: 'matchParent', label: 'Photo', accepts: "image/*", s3_direct_upload_url: rails_direct_uploads_path, file_size_limit: 5000, file_size_limit_alert_text: 'Too big!', value: 'VALUE_OF_THE_PREVIOUS_IMAGE_WHICH_IS_USEFUL_WHEN_UPDATING_EXISTING_MODEL'
14
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
15
+ end)
38
16
  end
17
+
18
+ # json_body_with_form json, nil, nil, options do
19
+ # json.child! do
20
+ # json.view 'fields/file-v1'
21
+ # json.name 'user[photo]'
22
+ # json.width 'matchParent'
23
+ # json.label 'Photo'
24
+
25
+ # json.value 'VALUE_OF_THE_PREVIOUS_IMAGE_WHICH_IS_USEFUL_WHEN_UPDATING_EXISTING_MODEL'
26
+
27
+ # json.accepts "image/*"
28
+ # # json.s3_bucket 'BUCKET_NAME'
29
+ # # json.s3_path_prefix 'uploads/images'
30
+ # json.s3_direct_upload_url rails_direct_uploads_path
31
+
32
+ # # This is for security so we don't have to reveal key/secret in the json api
33
+ # # json.s3_signature_url 'URL_TO_OUR_SERVER_TO_GET_GENERATED_SIGNATURE'
34
+
35
+ # json.file_size_limit 5000 # 5 MB
36
+ # json.file_size_limit_alert_text 'Too big!'
37
+ # end
38
+
39
+ # json.child! do
40
+ # json.view 'button-v1'
41
+ # json.text 'Submit'
42
+ # json.onClick do
43
+ # json.action 'forms/submit-v1'
44
+ # end
45
+ # end
46
+ # end
@@ -2,47 +2,59 @@ json.title 'Forms'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- footer = Jbuilder.new do |json|
6
- json.padding(top: 12, left: 20, right: 80, bottom: 12)
7
- json.backgroundColor '#b3bac2'
8
- json.subviews do
9
- json.child! do
10
- json.view 'label-v1'
11
- json.text 'Demonstrates the use Floating Action Button on a form with footer'
12
- end
13
- end
14
- end
5
+ # footer = Jbuilder.new do |json|
6
+ # json.padding(top: 12, left: 20, right: 80, bottom: 12)
7
+ # json.backgroundColor '#b3bac2'
8
+ # json.subviews do
9
+ # json.child! do
10
+ # json.view 'label-v1'
11
+ # json.text 'Demonstrates the use Floating Action Button on a form with footer'
12
+ # end
13
+ # end
14
+ # end
15
15
 
16
16
  options = {
17
17
  url: json_ui_garage_url(path: 'forms/generic_post'),
18
18
  method: 'post',
19
19
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
20
20
  }
21
- json_body_with_form json, nil, footer, options do
22
- 30.times do |i|
23
- json.child! do
24
- json.view 'fields/text-v1'
25
- json.name "user[field#{i}]"
26
- json.width 'matchParent'
27
- json.label "Field#{i}"
28
- end
29
- end
30
-
31
- json.child! do
32
- json.view 'button-v1'
33
- json.text 'Submit'
34
- json.onClick do
35
- json.action 'forms/submit-v1'
36
- end
37
- end
38
21
 
39
- json.child! do
40
- json.view 'fab-v1'
41
- json.icon do
42
- json.materialName 'send'
22
+ json_ui_page json do |page|
23
+ page.form options.merge(childViews: ->(form) do
24
+ form.label text: 'Demonstrates the use Floating Action Button on a form with footer'
25
+ 30.times do |i|
26
+ form.fields_text name: "user[field#{i}]", width: 'matchParent', label: "Field#{i}"
43
27
  end
44
- json.onClick do
45
- json.action 'forms/submit-v1'
46
- end
47
- end
28
+ form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
29
+ form.fab icon: 'send', onClick: ->(action) { action.forms_submit }
30
+ end)
48
31
  end
32
+
33
+ # json_body_with_form json, nil, footer, options do
34
+ # 30.times do |i|
35
+ # json.child! do
36
+ # json.view 'fields/text-v1'
37
+ # json.name "user[field#{i}]"
38
+ # json.width 'matchParent'
39
+ # json.label "Field#{i}"
40
+ # end
41
+ # end
42
+
43
+ # json.child! do
44
+ # json.view 'button-v1'
45
+ # json.text 'Submit'
46
+ # json.onClick do
47
+ # json.action 'forms/submit-v1'
48
+ # end
49
+ # end
50
+
51
+ # json.child! do
52
+ # json.view 'fab-v1'
53
+ # json.icon do
54
+ # json.materialName 'send'
55
+ # end
56
+ # json.onClick do
57
+ # json.action 'forms/submit-v1'
58
+ # end
59
+ # end
60
+ # end
@@ -2,42 +2,62 @@ json.title 'Forms'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_list json do
6
- json.rows do
7
- json.child! do
8
- json.template 'thumbnail-v1'
9
- json.title 'Basic'
10
- json.onClick do
11
- json.action 'windows/open-v1'
12
- json.url json_ui_garage_url(path: 'forms/basic')
5
+ json_ui_page json do |page|
6
+ page.list firstSection: ->(section) do
7
+ section.rows do |row|
8
+ row.thumbnail title: 'Basic', onClick: ->(action) do
9
+ action.windows_open url: json_ui_garage_url(path: 'forms/basic')
13
10
  end
14
- end
15
-
16
- json.child! do
17
- json.template 'thumbnail-v1'
18
- json.title 'Submit Indicator'
19
- json.onClick do
20
- json.action 'windows/open-v1'
21
- json.url json_ui_garage_url(path: 'forms/submit_indicator')
11
+ row.thumbnail title: 'Submit Indicator', onClick: ->(action) do
12
+ action.windows_open url: json_ui_garage_url(path: 'forms/submit_indicator')
22
13
  end
23
- end
24
-
25
- json.child! do
26
- json.template 'thumbnail-v1'
27
- json.title 'Floating Submit'
28
- json.onClick do
29
- json.action 'windows/open-v1'
30
- json.url json_ui_garage_url(path: 'forms/floating_submit')
14
+ row.thumbnail title: 'Floating Submit', onClick: ->(action) do
15
+ action.windows_open url: json_ui_garage_url(path: 'forms/floating_submit')
31
16
  end
32
- end
33
-
34
- json.child! do
35
- json.template 'thumbnail-v1'
36
- json.title 'File Upload'
37
- json.onClick do
38
- json.action 'windows/open-v1'
39
- json.url json_ui_garage_url(path: 'forms/file_upload')
17
+ row.thumbnail title: 'File Upload', onClick: ->(action) do
18
+ action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
40
19
  end
41
20
  end
21
+
42
22
  end
43
23
  end
24
+
25
+ # json_body_with_list json do
26
+ # json.rows do
27
+ # json.child! do
28
+ # json.template 'thumbnail-v1'
29
+ # json.title 'Basic'
30
+ # json.onClick do
31
+ # json.action 'windows/open-v1'
32
+ # json.url json_ui_garage_url(path: 'forms/basic')
33
+ # end
34
+ # end
35
+
36
+ # json.child! do
37
+ # json.template 'thumbnail-v1'
38
+ # json.title 'Submit Indicator'
39
+ # json.onClick do
40
+ # json.action 'windows/open-v1'
41
+ # json.url json_ui_garage_url(path: 'forms/submit_indicator')
42
+ # end
43
+ # end
44
+
45
+ # json.child! do
46
+ # json.template 'thumbnail-v1'
47
+ # json.title 'Floating Submit'
48
+ # json.onClick do
49
+ # json.action 'windows/open-v1'
50
+ # json.url json_ui_garage_url(path: 'forms/floating_submit')
51
+ # end
52
+ # end
53
+
54
+ # json.child! do
55
+ # json.template 'thumbnail-v1'
56
+ # json.title 'File Upload'
57
+ # json.onClick do
58
+ # json.action 'windows/open-v1'
59
+ # json.url json_ui_garage_url(path: 'forms/file_upload')
60
+ # end
61
+ # end
62
+ # end
63
+ # end
@@ -7,26 +7,36 @@ options = {
7
7
  method: 'post',
8
8
  padding: { top: 12, left: 20, right: 20, bottom: 12 }
9
9
  }
10
- json_body_with_form json, nil, nil, options do
11
- json.child! do
12
- json.view 'fields/text-v1'
13
- json.name 'user[name]'
14
- json.width 'matchParent'
15
- json.label 'Name'
16
- end
17
10
 
18
- json.child! do
19
- json.view 'panels/split-v1'
20
- json.width 'matchParent'
21
-
22
- json.content do
23
- json.right do
24
- json.view 'button-v1'
25
- json.text 'Submit'
26
- json.onClick do
27
- json.action 'forms/submit-v1'
28
- end
29
- end
11
+ json_ui_page json do |page|
12
+ page.form options.merge(childViews: ->(form) do
13
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
14
+ form.panels_split width: 'matchParent', rightViews: ->(split) do
15
+ split.button text: 'Submit', onClick: ->(action) { action.forms_submit }
30
16
  end
31
- end
17
+ end)
32
18
  end
19
+
20
+ # json_body_with_form json, nil, nil, options do
21
+ # json.child! do
22
+ # json.view 'fields/text-v1'
23
+ # json.name 'user[name]'
24
+ # json.width 'matchParent'
25
+ # json.label 'Name'
26
+ # end
27
+
28
+ # json.child! do
29
+ # json.view 'panels/split-v1'
30
+ # json.width 'matchParent'
31
+
32
+ # json.content do
33
+ # json.right do
34
+ # json.view 'button-v1'
35
+ # json.text 'Submit'
36
+ # json.onClick do
37
+ # json.action 'forms/submit-v1'
38
+ # end
39
+ # end
40
+ # end
41
+ # end
42
+ # end
@@ -2,24 +2,38 @@ json.title 'Lists'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_list json do
6
- json.rows do
7
- json.child! do
8
- json.template 'thumbnail-v1'
9
- json.title 'Templating'
10
- json.onClick do
11
- json.action 'windows/open-v1'
12
- json.url json_ui_garage_url(path: 'lists/templating')
5
+ json_ui_page json do |page|
6
+ page.list firstSection: ->(section) do
7
+ section.rows do |row|
8
+ row.thumbnail title: 'Templating', onClick: ->(action) do
9
+ action.windows_open url: json_ui_garage_url(path: 'lists/templating')
13
10
  end
14
- end
15
-
16
- json.child! do
17
- json.template 'thumbnail-v1'
18
- json.title 'Infinite Scroll'
19
- json.onClick do
20
- json.action 'windows/open-v1'
21
- json.url json_ui_garage_url(path: 'lists/infinite_scroll')
11
+ row.thumbnail title: 'Infinite Scroll', onClick: ->(action) do
12
+ action.windows_open url: json_ui_garage_url(path: 'lists/infinite_scroll')
22
13
  end
23
14
  end
15
+
24
16
  end
25
17
  end
18
+
19
+ # json_body_with_list json do
20
+ # json.rows do
21
+ # json.child! do
22
+ # json.template 'thumbnail-v1'
23
+ # json.title 'Templating'
24
+ # json.onClick do
25
+ # json.action 'windows/open-v1'
26
+ # json.url json_ui_garage_url(path: 'lists/templating')
27
+ # end
28
+ # end
29
+
30
+ # json.child! do
31
+ # json.template 'thumbnail-v1'
32
+ # json.title 'Infinite Scroll'
33
+ # json.onClick do
34
+ # json.action 'windows/open-v1'
35
+ # json.url json_ui_garage_url(path: 'lists/infinite_scroll')
36
+ # end
37
+ # end
38
+ # end
39
+ # end
@@ -2,44 +2,61 @@ json.title 'Lists'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_list json do
6
- json.header do
7
- json.subviews do
8
- json.child! do
9
- json.view 'label-v1'
10
- json.text 'Section Header'
11
- end
5
+ json_ui_page json do |page|
6
+ page.list firstSection: ->(section) do
7
+ section.header(padding: { top: 12, left: 16, right: 16, bottom: 12 }) do |header|
8
+ header.label text: 'Section Header'
12
9
  end
13
- end
14
10
 
15
- json.rows do
16
- json.child! do
17
- json.template 'thumbnail-v1'
18
- json.title 'Click me'
19
- json.onClick do
20
- json.action 'dialogs/alert-v1'
21
- json.message 'Perform action'
11
+ section.rows do |row|
12
+ row.thumbnail title: 'Click me', onClick: ->(action) do
13
+ action.dialogs_alert message: 'Perform action'
22
14
  end
15
+ row.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
16
+ row.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle', imageUrl: @sample_image_url
17
+ row.featured title: 'Item with subtitle', subtitle: 'Item subtitle', imageUrl: @sample_image_url
23
18
  end
19
+ end
20
+ end
24
21
 
25
- json.child! do
26
- json.template 'thumbnail-v1'
27
- json.title 'Item with subtitle'
28
- json.subtitle 'Item subtitle'
29
- end
22
+ # json_body_with_list json do
23
+ # json.header do
24
+ # json.subviews do
25
+ # json.child! do
26
+ # json.view 'label-v1'
27
+ # json.text 'Section Header'
28
+ # end
29
+ # end
30
+ # end
30
31
 
31
- json.child! do
32
- json.template 'thumbnail-v1'
33
- json.title 'Item with thumbnail image'
34
- json.subtitle 'Item subtitle'
35
- json.imageUrl @sample_image_url
36
- end
32
+ # json.rows do
33
+ # json.child! do
34
+ # json.template 'thumbnail-v1'
35
+ # json.title 'Click me'
36
+ # json.onClick do
37
+ # json.action 'dialogs/alert-v1'
38
+ # json.message 'Perform action'
39
+ # end
40
+ # end
37
41
 
38
- json.child! do
39
- json.template 'featured-v1'
40
- json.title 'Featured with featured image'
41
- json.subtitle 'Item subtitle'
42
- json.imageUrl @sample_image_url
43
- end
44
- end
45
- end
42
+ # json.child! do
43
+ # json.template 'thumbnail-v1'
44
+ # json.title 'Item with subtitle'
45
+ # json.subtitle 'Item subtitle'
46
+ # end
47
+
48
+ # json.child! do
49
+ # json.template 'thumbnail-v1'
50
+ # json.title 'Item with thumbnail image'
51
+ # json.subtitle 'Item subtitle'
52
+ # json.imageUrl @sample_image_url
53
+ # end
54
+
55
+ # json.child! do
56
+ # json.template 'featured-v1'
57
+ # json.title 'Featured with featured image'
58
+ # json.subtitle 'Item subtitle'
59
+ # json.imageUrl @sample_image_url
60
+ # end
61
+ # end
62
+ # end
@@ -2,20 +2,28 @@ json.title 'Views'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_scroll json do
6
- json.child! do
7
- json.view 'label-v1'
8
- json.text "\n"
9
- end
10
- json.child! do
11
- json.view 'h1-v1'
12
- json.text 'Map'
13
- end
14
- json.child! do
15
- json.view 'map-v1'
16
- json.latitude 13.4837
17
- json.longitude 144.7917
18
- json.zoom 11
19
- json.height '250px'
5
+ json_ui_page json do |page|
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.label text: "\n"
8
+ scroll.h1 text: 'Map'
9
+ scroll.map latitude: 13.4837, longitude: 144.7917, zoom: 11, height: '250px'
20
10
  end
21
11
  end
12
+
13
+ # json_body_with_scroll json do
14
+ # json.child! do
15
+ # json.view 'label-v1'
16
+ # json.text "\n"
17
+ # end
18
+ # json.child! do
19
+ # json.view 'h1-v1'
20
+ # json.text 'Map'
21
+ # end
22
+ # json.child! do
23
+ # json.view 'map-v1'
24
+ # json.latitude 13.4837
25
+ # json.longitude 144.7917
26
+ # json.zoom 11
27
+ # json.height '250px'
28
+ # end
29
+ # end
@@ -5,96 +5,127 @@ render "#{@path_prefix}/nav_menu", json: json
5
5
  image_url1 = 'http://ichef.bbci.co.uk/news/976/cpsprodpb/18106/production/_97266589_gettyimages-474547165.jpg'
6
6
  image_url2 = 'https://s.abcnews.com/images/International/Guam03-gty-jrl-170809_16x9_992.jpg'
7
7
 
8
- json_body_with_scroll json do
9
- json.child! do
10
- json.view 'label-v1'
11
- json.text "\n"
12
- end
13
- json.child! do
14
- json.view 'h1-v1'
15
- json.text 'Carousel with labels'
16
- end
17
- json.child! do
18
- json.view 'panels/carousel-v1'
19
- json.childViews do
20
- json.child! do
21
- json.view 'label-v1'
22
- json.text "Item 1"
23
- end
8
+ json_ui_page json do |page|
9
+ page.scroll childViews: ->(scroll) do
10
+ scroll.label text: "\n"
11
+ scroll.h1 text: 'Carousel with labels'
12
+ scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
13
+ carousel.label text: 'Item 1'
14
+ carousel.label text: 'Item 2'
15
+ end
24
16
 
25
- json.child! do
26
- json.view 'label-v1'
27
- json.text "Item 2"
28
- end
17
+ scroll.label text: "\n"
18
+ scroll.h1 text: 'Carousel with images'
19
+ scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
20
+ carousel.image url: image_url1, width: 'matchParent'
21
+ carousel.image url: image_url2, width: 'matchParent'
29
22
  end
30
- end
31
23
 
32
- json.child! do
33
- json.view 'label-v1'
34
- json.text "\n"
35
- end
36
- json.child! do
37
- json.view 'h1-v1'
38
- json.text 'Carousel with images'
39
- end
40
- json.child! do
41
- json.view 'panels/carousel-v1'
42
- json.childViews do
43
- json.child! do
44
- json.view 'image-v1'
45
- json.url image_url1
24
+ scroll.label text: "\n"
25
+ scroll.h1 text: 'Carousel with complex layout'
26
+ scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
27
+ carousel.panels_vertical childViews: ->(panel) do
28
+ panel.h3 text: 'Item 1'
29
+ panel.image url: image_url1, width: 'matchParent'
46
30
  end
47
-
48
- json.child! do
49
- json.view 'image-v1'
50
- json.url image_url2
31
+ carousel.panels_vertical childViews: ->(panel) do
32
+ panel.h3 text: 'Item 2'
33
+ panel.image url: image_url2, width: 'matchParent'
51
34
  end
52
35
  end
53
36
  end
37
+ end
54
38
 
55
- json.child! do
56
- json.view 'label-v1'
57
- json.text "\n"
58
- end
59
- json.child! do
60
- json.view 'h1-v1'
61
- json.text 'Carousel with complex layout'
62
- end
63
- json.child! do
64
- json.view 'panels/carousel-v1'
65
- json.width 'matchParent'
66
- json.childViews do
67
- json.child! do
68
- json.view 'panels/vertical-v1'
69
- json.childViews do
70
- json.child! do
71
- json.view 'h3-v1'
72
- json.text "Item 1"
73
- end
74
- json.child! do
75
- json.view 'image-v1'
76
- json.width 'matchParent'
77
- json.url image_url1
78
- end
79
- end
80
- end
39
+ # json_body_with_scroll json do
40
+ # json.child! do
41
+ # json.view 'label-v1'
42
+ # json.text "\n"
43
+ # end
44
+ # json.child! do
45
+ # json.view 'h1-v1'
46
+ # json.text 'Carousel with labels'
47
+ # end
48
+ # json.child! do
49
+ # json.view 'panels/carousel-v1'
50
+ # json.childViews do
51
+ # json.child! do
52
+ # json.view 'label-v1'
53
+ # json.text "Item 1"
54
+ # end
81
55
 
82
- json.child! do
83
- json.view 'panels/vertical-v1'
84
- json.childViews do
85
- json.child! do
86
- json.view 'h3-v1'
87
- json.text "Item 2"
88
- end
89
- json.child! do
90
- json.view 'image-v1'
91
- json.width 'matchParent'
92
- json.url image_url2
93
- end
94
- end
95
- end
56
+ # json.child! do
57
+ # json.view 'label-v1'
58
+ # json.text "Item 2"
59
+ # end
60
+ # end
61
+ # end
96
62
 
97
- end
98
- end
63
+ # json.child! do
64
+ # json.view 'label-v1'
65
+ # json.text "\n"
66
+ # end
67
+ # json.child! do
68
+ # json.view 'h1-v1'
69
+ # json.text 'Carousel with images'
70
+ # end
71
+ # json.child! do
72
+ # json.view 'panels/carousel-v1'
73
+ # json.childViews do
74
+ # json.child! do
75
+ # json.view 'image-v1'
76
+ # json.url image_url1
77
+ # end
99
78
 
100
- end
79
+ # json.child! do
80
+ # json.view 'image-v1'
81
+ # json.url image_url2
82
+ # end
83
+ # end
84
+ # end
85
+
86
+ # json.child! do
87
+ # json.view 'label-v1'
88
+ # json.text "\n"
89
+ # end
90
+ # json.child! do
91
+ # json.view 'h1-v1'
92
+ # json.text 'Carousel with complex layout'
93
+ # end
94
+ # json.child! do
95
+ # json.view 'panels/carousel-v1'
96
+ # json.width 'matchParent'
97
+ # json.childViews do
98
+ # json.child! do
99
+ # json.view 'panels/vertical-v1'
100
+ # json.childViews do
101
+ # json.child! do
102
+ # json.view 'h3-v1'
103
+ # json.text "Item 1"
104
+ # end
105
+ # json.child! do
106
+ # json.view 'image-v1'
107
+ # json.width 'matchParent'
108
+ # json.url image_url1
109
+ # end
110
+ # end
111
+ # end
112
+
113
+ # json.child! do
114
+ # json.view 'panels/vertical-v1'
115
+ # json.childViews do
116
+ # json.child! do
117
+ # json.view 'h3-v1'
118
+ # json.text "Item 2"
119
+ # end
120
+ # json.child! do
121
+ # json.view 'image-v1'
122
+ # json.width 'matchParent'
123
+ # json.url image_url2
124
+ # end
125
+ # end
126
+ # end
127
+
128
+ # end
129
+ # end
130
+
131
+ # end
@@ -2,55 +2,76 @@ json.title 'Views'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_scroll json do
6
- json.child! do
7
- json.view 'label-v1'
8
- json.text "\n"
9
- end
10
- json.child! do
11
- json.view 'h1-v1'
12
- json.text 'Image with URL'
13
- end
14
- json.child! do
15
- json.view 'image-v1'
16
- json.width 100
17
- json.url @sample_image_url
18
- end
19
-
20
- json.child! do
21
- json.view 'label-v1'
22
- json.text "\n"
23
- end
24
- json.child! do
25
- json.view 'h1-v1'
26
- json.text 'Image with base64 data'
27
- end
28
- json.child! do
29
- json.view 'image-v1'
30
- json.height 100
31
- json.base64Data 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzY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wCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
32
- end
5
+ json_ui_page json do |page|
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.label text: "\n"
8
+ scroll.h1 text: 'Image with URL'
9
+ scroll.image width: 100, url: @sample_image_url
10
+ scroll.label text: "\n"
11
+ scroll.h1 text: 'Image with base64 data'
12
+ scroll.image height: 100, base64Data: 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9m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xgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
13
+ scroll.label text: "\n"
14
+ scroll.h1 text: 'QR Code as base64 image'
33
15
 
34
- json.child! do
35
- json.view 'label-v1'
36
- json.text "\n"
37
- end
38
- json.child! do
39
- json.view 'h1-v1'
40
- json.text 'QR Code as base64 image'
41
- end
42
-
43
- if defined? RQRCode
44
- json.child! do
45
- json.view 'image-v1'
16
+ if defined? RQRCode
46
17
  qr_content = { version: 1, message: 'This is a test' }
47
18
  qr = RQRCode::QRCode.new(qr_content.to_json)
48
- json.base64Data qr.as_png(size: 300).to_data_url
49
- end
50
- else
51
- json.child! do
52
- json.view 'label-v1'
53
- json.text 'Include "rqrcode" gem to enable this'
19
+ scroll.image base64Data: qr.as_png(size: 300).to_data_url
20
+ else
21
+ scroll.label text: 'Include "rqrcode" gem to enable this'
54
22
  end
55
23
  end
56
24
  end
25
+
26
+ # json_body_with_scroll json do
27
+ # json.child! do
28
+ # json.view 'label-v1'
29
+ # json.text "\n"
30
+ # end
31
+ # json.child! do
32
+ # json.view 'h1-v1'
33
+ # json.text 'Image with URL'
34
+ # end
35
+ # json.child! do
36
+ # json.view 'image-v1'
37
+ # json.width 100
38
+ # json.url @sample_image_url
39
+ # end
40
+
41
+ # json.child! do
42
+ # json.view 'label-v1'
43
+ # json.text "\n"
44
+ # end
45
+ # json.child! do
46
+ # json.view 'h1-v1'
47
+ # json.text 'Image with base64 data'
48
+ # end
49
+ # json.child! do
50
+ # json.view 'image-v1'
51
+ # json.height 100
52
+ # json.base64Data 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcL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LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
53
+ # end
54
+
55
+ # json.child! do
56
+ # json.view 'label-v1'
57
+ # json.text "\n"
58
+ # end
59
+ # json.child! do
60
+ # json.view 'h1-v1'
61
+ # json.text 'QR Code as base64 image'
62
+ # end
63
+
64
+ # if defined? RQRCode
65
+ # json.child! do
66
+ # json.view 'image-v1'
67
+ # qr_content = { version: 1, message: 'This is a test' }
68
+ # qr = RQRCode::QRCode.new(qr_content.to_json)
69
+ # json.base64Data qr.as_png(size: 300).to_data_url
70
+ # end
71
+ # else
72
+ # json.child! do
73
+ # json.view 'label-v1'
74
+ # json.text 'Include "rqrcode" gem to enable this'
75
+ # end
76
+ # end
77
+ # end
@@ -2,33 +2,50 @@ json.title 'Views'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_list json do
6
- json.rows do
7
- json.child! do
8
- json.template 'thumbnail-v1'
9
- json.title 'Basic'
10
- json.onClick do
11
- json.action 'windows/open-v1'
12
- json.url json_ui_garage_url(path: 'views/basic')
5
+ json_ui_page json do |page|
6
+ page.list firstSection: ->(section) do
7
+ section.rows do |row|
8
+ row.thumbnail title: 'Basic', onClick: ->(action) do
9
+ action.windows_open url: json_ui_garage_url(path: 'views/basic')
13
10
  end
14
- end
15
-
16
- json.child! do
17
- json.template 'thumbnail-v1'
18
- json.title 'Images'
19
- json.onClick do
20
- json.action 'windows/open-v1'
21
- json.url json_ui_garage_url(path: 'views/images')
11
+ row.thumbnail title: 'Images', onClick: ->(action) do
12
+ action.windows_open url: json_ui_garage_url(path: 'views/images')
22
13
  end
23
- end
24
-
25
- json.child! do
26
- json.template 'thumbnail-v1'
27
- json.title 'Carousels'
28
- json.onClick do
29
- json.action 'windows/open-v1'
30
- json.url json_ui_garage_url(path: 'views/carousels')
14
+ row.thumbnail title: 'Carousel', onClick: ->(action) do
15
+ action.windows_open url: json_ui_garage_url(path: 'views/carousels')
31
16
  end
32
17
  end
18
+
33
19
  end
34
20
  end
21
+
22
+ # json_body_with_list json do
23
+ # json.rows do
24
+ # json.child! do
25
+ # json.template 'thumbnail-v1'
26
+ # json.title 'Basic'
27
+ # json.onClick do
28
+ # json.action 'windows/open-v1'
29
+ # json.url json_ui_garage_url(path: 'views/basic')
30
+ # end
31
+ # end
32
+
33
+ # json.child! do
34
+ # json.template 'thumbnail-v1'
35
+ # json.title 'Images'
36
+ # json.onClick do
37
+ # json.action 'windows/open-v1'
38
+ # json.url json_ui_garage_url(path: 'views/images')
39
+ # end
40
+ # end
41
+
42
+ # json.child! do
43
+ # json.template 'thumbnail-v1'
44
+ # json.title 'Carousels'
45
+ # json.onClick do
46
+ # json.action 'windows/open-v1'
47
+ # json.url json_ui_garage_url(path: 'views/carousels')
48
+ # end
49
+ # end
50
+ # end
51
+ # 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.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''