glib-web 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/application/json/libs.rb +26 -0
  3. data/app/controllers/concerns/application/json/transformation.rb +11 -0
  4. data/app/controllers/concerns/application/json/ui.rb +73 -0
  5. data/app/controllers/concerns/application/json/validation.rb +13 -0
  6. data/app/controllers/home_controller.rb +21 -0
  7. data/app/helpers/glib/web/json_ui_helper.rb +58 -0
  8. data/app/views/app/views/json_ui/vue/renderer.html.erb +29 -0
  9. data/app/views/json_ui/garage/_nav_menu.json.jbuilder +84 -0
  10. data/app/views/json_ui/garage/actions/index.json.jbuilder +25 -0
  11. data/app/views/json_ui/garage/forms/basic.json.jbuilder +53 -0
  12. data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +10 -0
  13. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +38 -0
  14. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +48 -0
  15. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +6 -0
  16. data/app/views/json_ui/garage/forms/index.json.jbuilder +43 -0
  17. data/app/views/json_ui/garage/forms/submit_indicator.json.jbuilder +32 -0
  18. data/app/views/json_ui/garage/forms/submit_indicator_post.json.jbuilder +12 -0
  19. data/app/views/json_ui/garage/home/index.json.jbuilder +61 -0
  20. data/app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder +10 -0
  21. data/app/views/json_ui/garage/lists/index.json.jbuilder +25 -0
  22. data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +27 -0
  23. data/app/views/json_ui/garage/lists/templating.json.jbuilder +45 -0
  24. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +39 -0
  25. data/app/views/json_ui/garage/pages/index.json.jbuilder +35 -0
  26. data/app/views/json_ui/garage/pages/layout.json.jbuilder +35 -0
  27. data/app/views/json_ui/garage/pages/nav_buttons.json.jbuilder +32 -0
  28. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +213 -0
  29. data/app/views/json_ui/garage/panels/index.json.jbuilder +34 -0
  30. data/app/views/json_ui/garage/panels/split.json.jbuilder +360 -0
  31. data/app/views/json_ui/garage/panels/vertical.json.jbuilder +94 -0
  32. data/app/views/json_ui/garage/views/basic.json.jbuilder +21 -0
  33. data/app/views/json_ui/garage/views/carousels.json.jbuilder +100 -0
  34. data/app/views/json_ui/garage/views/images.json.jbuilder +56 -0
  35. data/app/views/json_ui/garage/views/index.json.jbuilder +34 -0
  36. data/config/routes.rb +4 -0
  37. data/lib/glib/engine.rb +7 -0
  38. data/lib/glib/version.rb +5 -0
  39. data/lib/glib-web.rb +2 -0
  40. metadata +40 -2
@@ -0,0 +1,94 @@
1
+ json.title 'Panels'
2
+
3
+ render "#{@path_prefix}/nav_menu", json: json
4
+
5
+ json_body_with_scroll json do
6
+ json.child! do
7
+ json.view 'h1-v1'
8
+ json.text 'Vertical Panel'
9
+ end
10
+ json.child! do
11
+ json.view 'panels/vertical-v1'
12
+ json.backgroundColor '#b3bac2'
13
+ json.subviews do
14
+ json.child! do
15
+ json.view 'button-v1'
16
+ json.text 'Button1'
17
+ end
18
+
19
+ json.child! do
20
+ json.view 'button-v1'
21
+ json.width 200
22
+ json.text 'Button2'
23
+ end
24
+
25
+ json.child! do
26
+ json.view 'button-v1'
27
+ json.width 300
28
+ json.text 'Button3'
29
+ end
30
+ end
31
+ end
32
+
33
+ json.child! do
34
+ json.view 'label-v1'
35
+ json.text "\n"
36
+ end
37
+ json.child! do
38
+ json.view 'h1-v1'
39
+ json.text 'Vertical Panel with equal filling'
40
+ end
41
+ json.child! do
42
+ json.view 'panels/vertical-v1'
43
+ json.backgroundColor '#b3bac2'
44
+ json.distribution 'fillEqually'
45
+ json.height 300
46
+ json.subviews do
47
+ json.child! do
48
+ json.view 'button-v1'
49
+ json.text 'Button1'
50
+ end
51
+
52
+ json.child! do
53
+ json.view 'button-v1'
54
+ json.text 'Button2'
55
+ end
56
+
57
+ json.child! do
58
+ json.view 'button-v1'
59
+ json.text 'Button3'
60
+ end
61
+ end
62
+ end
63
+
64
+ json.child! do
65
+ json.view 'label-v1'
66
+ json.text "\n"
67
+ end
68
+ json.child! do
69
+ json.view 'h1-v1'
70
+ json.text 'Vertical Panel with equal spacing'
71
+ end
72
+ json.child! do
73
+ json.view 'panels/vertical-v1'
74
+ json.backgroundColor '#b3bac2'
75
+ json.distribution 'spaceEqually'
76
+ json.height 300
77
+ json.subviews do
78
+ json.child! do
79
+ json.view 'button-v1'
80
+ json.text 'Button1'
81
+ end
82
+
83
+ json.child! do
84
+ json.view 'button-v1'
85
+ json.text 'Button2'
86
+ end
87
+
88
+ json.child! do
89
+ json.view 'button-v1'
90
+ json.text 'Button3'
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,21 @@
1
+ json.title 'Views'
2
+
3
+ render "#{@path_prefix}/nav_menu", json: json
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'
20
+ end
21
+ end
@@ -0,0 +1,100 @@
1
+ json.title 'Views'
2
+
3
+ render "#{@path_prefix}/nav_menu", json: json
4
+
5
+ image_url1 = 'http://ichef.bbci.co.uk/news/976/cpsprodpb/18106/production/_97266589_gettyimages-474547165.jpg'
6
+ image_url2 = 'https://s.abcnews.com/images/International/Guam03-gty-jrl-170809_16x9_992.jpg'
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.subviews do
20
+ json.child! do
21
+ json.view 'label-v1'
22
+ json.text "Item 1"
23
+ end
24
+
25
+ json.child! do
26
+ json.view 'label-v1'
27
+ json.text "Item 2"
28
+ end
29
+ end
30
+ end
31
+
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.subviews do
43
+ json.child! do
44
+ json.view 'image-v1'
45
+ json.url image_url1
46
+ end
47
+
48
+ json.child! do
49
+ json.view 'image-v1'
50
+ json.url image_url2
51
+ end
52
+ end
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 'Carousel with complex layout'
62
+ end
63
+ json.child! do
64
+ json.view 'panels/carousel-v1'
65
+ json.width 'matchParent'
66
+ json.subviews do
67
+ json.child! do
68
+ json.view 'panels/vertical-v1'
69
+ json.subviews 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
81
+
82
+ json.child! do
83
+ json.view 'panels/vertical-v1'
84
+ json.subviews 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
96
+
97
+ end
98
+ end
99
+
100
+ end
@@ -0,0 +1,56 @@
1
+ json.title 'Views'
2
+
3
+ render "#{@path_prefix}/nav_menu", json: json
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/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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yovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
32
+ end
33
+
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'
46
+ qr_content = { version: 1, message: 'This is a test' }
47
+ 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'
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,34 @@
1
+ json.title 'Views'
2
+
3
+ render "#{@path_prefix}/nav_menu", json: json
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')
13
+ 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')
22
+ 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')
31
+ end
32
+ end
33
+ end
34
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Glib::Web::Engine.routes.draw do
2
+ get 'json_ui_garage', to: 'home#json_ui_garage'
3
+ post 'json_ui_garage', to: 'home#json_ui_garage'
4
+ end
@@ -0,0 +1,7 @@
1
+ module Glib
2
+ module Web
3
+ class Engine < ::Rails::Engine
4
+ # isolate_namespace Glib::Web
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Glib
2
+ module Web
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
data/lib/glib-web.rb ADDED
@@ -0,0 +1,2 @@
1
+ require "glib/version"
2
+ require "glib/engine" if defined?(::Rails)
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -29,7 +29,45 @@ email: ''
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
- files: []
32
+ files:
33
+ - app/controllers/concerns/application/json/libs.rb
34
+ - app/controllers/concerns/application/json/transformation.rb
35
+ - app/controllers/concerns/application/json/ui.rb
36
+ - app/controllers/concerns/application/json/validation.rb
37
+ - app/controllers/home_controller.rb
38
+ - app/helpers/glib/web/json_ui_helper.rb
39
+ - app/views/app/views/json_ui/vue/renderer.html.erb
40
+ - app/views/json_ui/garage/_nav_menu.json.jbuilder
41
+ - app/views/json_ui/garage/actions/index.json.jbuilder
42
+ - app/views/json_ui/garage/forms/basic.json.jbuilder
43
+ - app/views/json_ui/garage/forms/basic_post.json.jbuilder
44
+ - app/views/json_ui/garage/forms/file_upload.json.jbuilder
45
+ - app/views/json_ui/garage/forms/floating_submit.json.jbuilder
46
+ - app/views/json_ui/garage/forms/generic_post.json.jbuilder
47
+ - app/views/json_ui/garage/forms/index.json.jbuilder
48
+ - app/views/json_ui/garage/forms/submit_indicator.json.jbuilder
49
+ - app/views/json_ui/garage/forms/submit_indicator_post.json.jbuilder
50
+ - app/views/json_ui/garage/home/index.json.jbuilder
51
+ - app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder
52
+ - app/views/json_ui/garage/lists/index.json.jbuilder
53
+ - app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder
54
+ - app/views/json_ui/garage/lists/templating.json.jbuilder
55
+ - app/views/json_ui/garage/pages/full_width_height.json.jbuilder
56
+ - app/views/json_ui/garage/pages/index.json.jbuilder
57
+ - app/views/json_ui/garage/pages/layout.json.jbuilder
58
+ - app/views/json_ui/garage/pages/nav_buttons.json.jbuilder
59
+ - app/views/json_ui/garage/panels/horizontal.json.jbuilder
60
+ - app/views/json_ui/garage/panels/index.json.jbuilder
61
+ - app/views/json_ui/garage/panels/split.json.jbuilder
62
+ - app/views/json_ui/garage/panels/vertical.json.jbuilder
63
+ - app/views/json_ui/garage/views/basic.json.jbuilder
64
+ - app/views/json_ui/garage/views/carousels.json.jbuilder
65
+ - app/views/json_ui/garage/views/images.json.jbuilder
66
+ - app/views/json_ui/garage/views/index.json.jbuilder
67
+ - config/routes.rb
68
+ - lib/glib-web.rb
69
+ - lib/glib/engine.rb
70
+ - lib/glib/version.rb
33
71
  homepage:
34
72
  licenses: []
35
73
  metadata: {}