glib-web 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. metadata +3 -42
  3. data/app/controllers/concerns/.keep +0 -0
  4. data/app/controllers/concerns/application/json/libs.rb +0 -26
  5. data/app/controllers/concerns/application/json/transformation.rb +0 -11
  6. data/app/controllers/concerns/application/json/ui.rb +0 -61
  7. data/app/controllers/concerns/application/json/validation.rb +0 -13
  8. data/app/controllers/home_controller.rb +0 -20
  9. data/app/helpers/glib/web/json_ui_helper.rb +0 -58
  10. data/app/views/_nav_menu.json.jbuilder +0 -84
  11. data/app/views/actions/index.json.jbuilder +0 -25
  12. data/app/views/app/views/json_ui/vue/renderer.html.slim +0 -24
  13. data/app/views/forms/basic.json.jbuilder +0 -53
  14. data/app/views/forms/basic_post.json.jbuilder +0 -10
  15. data/app/views/forms/file_upload.json.jbuilder +0 -38
  16. data/app/views/forms/floating_submit.json.jbuilder +0 -48
  17. data/app/views/forms/generic_post.json.jbuilder +0 -6
  18. data/app/views/forms/index.json.jbuilder +0 -43
  19. data/app/views/forms/submit_indicator.json.jbuilder +0 -32
  20. data/app/views/forms/submit_indicator_post.json.jbuilder +0 -12
  21. data/app/views/home/index.json.jbuilder +0 -61
  22. data/app/views/lists/_infinite_scroll_section.json.jbuilder +0 -10
  23. data/app/views/lists/index.json.jbuilder +0 -25
  24. data/app/views/lists/infinite_scroll.json.jbuilder +0 -27
  25. data/app/views/lists/templating.json.jbuilder +0 -45
  26. data/app/views/pages/full_width_height.json.jbuilder +0 -39
  27. data/app/views/pages/index.json.jbuilder +0 -35
  28. data/app/views/pages/layout.json.jbuilder +0 -35
  29. data/app/views/pages/nav_buttons.json.jbuilder +0 -32
  30. data/app/views/panels/horizontal.json.jbuilder +0 -213
  31. data/app/views/panels/index.json.jbuilder +0 -34
  32. data/app/views/panels/split.json.jbuilder +0 -360
  33. data/app/views/panels/vertical.json.jbuilder +0 -94
  34. data/app/views/views/basic.json.jbuilder +0 -21
  35. data/app/views/views/carousels.json.jbuilder +0 -100
  36. data/app/views/views/images.json.jbuilder +0 -56
  37. data/app/views/views/index.json.jbuilder +0 -34
  38. data/config/routes.rb +0 -4
  39. data/lib/glib/engine.rb +0 -7
  40. data/lib/glib/version.rb +0 -5
  41. data/lib/glib-web.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 3252e95797df15a1e72061db9583704fbf49d55b62ba5389e4e275d8b9c949c7
4
- data.tar.gz: 325e4ccb344878566840aaf9dd8051ff32b8382dc5c7fefef2a2d00f6f7b327a
2
+ SHA1:
3
+ metadata.gz: 664a40041c3bd90043d897af1209c272d3bec911
4
+ data.tar.gz: e6c4ea202254454e6f4ba2dd84cb84b92e5ef4d7
5
5
  SHA512:
6
- metadata.gz: 0a608d6aa4fbf6d36f3ec05123b2a908fa982fc2370c4e9cc8bc214e7dfeb7a3e491af31a7ea507316fd8cdf37328532797a46450de7609877eb014027155a13
7
- data.tar.gz: 60581c14e70e9a53ab273593cba687969f8cec04b81f9867cabbc7e806f64f431f047d536df6c4f6338bef3d99ae70eee1ef8b80e4976eaab6ab1d81280f4466
6
+ metadata.gz: 1fade6072e77809c761b192b2d0efb61f9f4c170d0c8c45aebbb338c492fed021891e0b9a020a0a0b6fc739ed1192cc7b1665273e8586e992cbcb6aa6c4bbb6e
7
+ data.tar.gz: 37ee0021f571efdb4f6c4b125b7a0b6f5cef4e7611d41e4e0fab61253ce1c93b3eaabcc2cd5937cdf3f3511c82fc8e56d3a5b837f3b9f34c5b3f3532cae504be
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -29,46 +29,7 @@ email: ''
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
- files:
33
- - app/controllers/concerns/.keep
34
- - app/controllers/concerns/application/json/libs.rb
35
- - app/controllers/concerns/application/json/transformation.rb
36
- - app/controllers/concerns/application/json/ui.rb
37
- - app/controllers/concerns/application/json/validation.rb
38
- - app/controllers/home_controller.rb
39
- - app/helpers/glib/web/json_ui_helper.rb
40
- - app/views/_nav_menu.json.jbuilder
41
- - app/views/actions/index.json.jbuilder
42
- - app/views/app/views/json_ui/vue/renderer.html.slim
43
- - app/views/forms/basic.json.jbuilder
44
- - app/views/forms/basic_post.json.jbuilder
45
- - app/views/forms/file_upload.json.jbuilder
46
- - app/views/forms/floating_submit.json.jbuilder
47
- - app/views/forms/generic_post.json.jbuilder
48
- - app/views/forms/index.json.jbuilder
49
- - app/views/forms/submit_indicator.json.jbuilder
50
- - app/views/forms/submit_indicator_post.json.jbuilder
51
- - app/views/home/index.json.jbuilder
52
- - app/views/lists/_infinite_scroll_section.json.jbuilder
53
- - app/views/lists/index.json.jbuilder
54
- - app/views/lists/infinite_scroll.json.jbuilder
55
- - app/views/lists/templating.json.jbuilder
56
- - app/views/pages/full_width_height.json.jbuilder
57
- - app/views/pages/index.json.jbuilder
58
- - app/views/pages/layout.json.jbuilder
59
- - app/views/pages/nav_buttons.json.jbuilder
60
- - app/views/panels/horizontal.json.jbuilder
61
- - app/views/panels/index.json.jbuilder
62
- - app/views/panels/split.json.jbuilder
63
- - app/views/panels/vertical.json.jbuilder
64
- - app/views/views/basic.json.jbuilder
65
- - app/views/views/carousels.json.jbuilder
66
- - app/views/views/images.json.jbuilder
67
- - app/views/views/index.json.jbuilder
68
- - config/routes.rb
69
- - lib/glib-web.rb
70
- - lib/glib/engine.rb
71
- - lib/glib/version.rb
32
+ files: []
72
33
  homepage:
73
34
  licenses: []
74
35
  metadata: {}
@@ -88,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
49
  version: '0'
89
50
  requirements: []
90
51
  rubyforge_project:
91
- rubygems_version: 2.7.6
52
+ rubygems_version: 2.6.8
92
53
  signing_key:
93
54
  specification_version: 4
94
55
  summary: ''
File without changes
@@ -1,26 +0,0 @@
1
- module Concerns::Application::Json::Libs
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- extend ClassMethods
6
- end
7
-
8
- module ClassMethods
9
-
10
- def json_libs_init(options)
11
- include Concerns::Application::Json::Transformation
12
- include Concerns::Application::Json::Validation
13
- include Concerns::Application::Json::Ui
14
-
15
- before_action :__json_ui_start
16
-
17
- # Note that after_action gets executed in reverse
18
- after_action do
19
- __json_ui_commit(options[:renderer_path])
20
- end
21
- after_action :__json_transformation_commit
22
- after_action :__json_validate_perform
23
- end
24
-
25
- end
26
- end
@@ -1,11 +0,0 @@
1
- module Concerns::Application::Json::Transformation
2
- def json_transformation_start
3
- if request.format == 'json'
4
- @__transformed_json ||= JSON.parse(response.body) rescue nil
5
- end
6
- end
7
-
8
- def __json_transformation_commit
9
- response.body = @__transformed_json.to_json if @__transformed_json
10
- end
11
- end
@@ -1,61 +0,0 @@
1
- module Concerns::Application::Json::Ui
2
- extend ActiveSupport::Concern
3
-
4
- # NOTE: Override default_url_options and call this method
5
- def json_ui_url_options
6
- options = {}
7
- options[:_render] = params[:_render]
8
- options[:format] = :json if request.format == :json
9
- options
10
- end
11
-
12
- def json_ui_activated
13
- @__json_ui_activated
14
- end
15
-
16
- def __json_ui_start
17
- @__json_ui_activated = false
18
- @__json_ui_rendering = false
19
- if params[:_render].present?
20
- @__json_ui_activated = true
21
- request.variant = :ui
22
-
23
- if request.format.html?
24
- @__json_ui_rendering = true
25
- request.format = 'json'
26
- end
27
- end
28
- end
29
-
30
- def __json_ui_commit(renderer_path)
31
- if @__json_ui_rendering
32
- if (hash = json_transformation_start).is_a?(Hash)
33
- case params[:_render]
34
- when 'v1'
35
- __json_ui_vue(hash, renderer_path)
36
- when 'mdc'
37
- __json_ui_mdc(hash)
38
- when 'vue'
39
- __json_ui_vue(hash)
40
- end
41
- end
42
- end
43
- end
44
-
45
- private
46
-
47
- # TODO: Remove. Deprecated
48
- def __json_ui_mdc(hash)
49
- prepend_view_path 'app/views/json_ui/mdc'
50
- if (next_action = hash['onResponse']).is_a?(Hash)
51
- response.body = render_to_string(file: 'renderer.js', layout: false, content_type: 'text/javascript', locals: { response: next_action })
52
- else
53
- response.body = render_to_string(file: 'renderer.html', layout: false, content_type: 'text/html', locals: { page: hash })
54
- end
55
- end
56
-
57
- def __json_ui_vue(hash, renderer_path)
58
- @__json_ui_orig_page = response.body
59
- response.body = render_to_string(file: renderer_path, layout: false, content_type: 'text/html', locals: { page: hash })
60
- end
61
- end
@@ -1,13 +0,0 @@
1
- module Concerns::Application::Json::Validation
2
- def __json_validate_perform
3
- if Rails.env.development? && params[:_validate] == 'true'
4
- if (hash = json_transformation_start).is_a?(Hash)
5
- json_validate = JSONValidate.new(hash)
6
- response_message = json_validate.valid?
7
- hash[:_json] = {
8
- validationErrors: response_message
9
- }
10
- end
11
- end
12
- end
13
- end
@@ -1,20 +0,0 @@
1
- class HomeController < ApplicationController
2
-
3
- def json_ui_garage
4
- @sample_image_url = 'https://cdn-images-1.medium.com/max/1200/1*Qc0XxYm-qAZL-7tjjlNfrg.png'
5
-
6
- # prepend_view_path 'app/views/json_ui/garage'
7
- path = "#{params[:path] || 'index'}"
8
- render path
9
- end
10
-
11
- def json_ui_garage_url(options = {})
12
- Glib::Web::Engine.routes.url_helpers.json_ui_garage_url(options.merge(
13
- host: request.host,
14
- port: request.port,
15
- _render: params[:_render], format: params[:format])
16
- )
17
- end
18
-
19
- helper_method :json_ui_garage_url
20
- end
@@ -1,58 +0,0 @@
1
- module Glib
2
- module Web
3
- module JsonUiHelper
4
- def json_body_with_list(json, header = nil, footer = nil, options = {})
5
- json.header header
6
- json.content do
7
- json.subviews [1] do
8
- json.view 'panels/list-v1'
9
- json.width 'matchParent'
10
- json.nextPage options[:nextPage]
11
- json.sections [1] do
12
- yield
13
- end
14
- end
15
- end
16
- json.footer footer
17
- end
18
-
19
- def json_body_with_scroll(json, header = nil, footer = nil, options = {})
20
- json.header header
21
- json.content do
22
- json.subviews [1] do
23
- json.view 'panels/scroll-v1'
24
- json.width 'matchParent'
25
- json.padding options[:padding]
26
- json.subviews do
27
- yield
28
- end
29
- end
30
- end
31
- json.footer footer
32
- end
33
-
34
- def json_body_with_form(json, header = nil, footer = nil, options = {})
35
- json.header header
36
- json_body_with_scroll json do
37
- json.child! do
38
- json.view 'panels/form-v1'
39
- json.width 'matchParent'
40
- json.(options, :url, :method)
41
- json.padding options[:padding]
42
- json.local options[:local]
43
- json.subviews do
44
- json.child! do
45
- json.view 'fields/hidden-v1'
46
- json.name 'authenticity_token'
47
- json.value form_authenticity_token
48
- end
49
-
50
- yield
51
- end
52
- end
53
- end
54
- json.footer footer
55
- end
56
- end
57
- end
58
- end
@@ -1,84 +0,0 @@
1
- json.leftDrawer do
2
- json.items do
3
- json.child! do
4
- json.icon do
5
- json.materialName 'home'
6
- end
7
- json.text 'Home'
8
- json.onClick do
9
- json.action 'windows/open-v1'
10
- json.url json_ui_garage_url
11
- end
12
- end
13
- end
14
-
15
- json.items do
16
- json.child! do
17
- json.text 'Pages'
18
- json.onClick do
19
- json.action 'windows/open-v1'
20
- json.url json_ui_garage_url(path: 'pages/index')
21
- end
22
- end
23
- end
24
-
25
- json.items do
26
- json.child! do
27
- json.text 'Lists'
28
- json.onClick do
29
- json.action 'windows/open-v1'
30
- json.url json_ui_garage_url(path: 'lists/index')
31
- end
32
- end
33
- end
34
-
35
- json.items do
36
- json.child! do
37
- json.text 'Forms'
38
- json.onClick do
39
- json.action 'windows/open-v1'
40
- json.url json_ui_garage_url(path: 'forms/index')
41
- end
42
- end
43
- end
44
-
45
- json.items do
46
- json.child! do
47
- json.text 'Panels'
48
- json.onClick do
49
- json.action 'windows/open-v1'
50
- json.url json_ui_garage_url(path: 'panels/index')
51
- end
52
- end
53
- end
54
-
55
- json.items do
56
- json.child! do
57
- json.text 'Views'
58
- json.onClick do
59
- json.action 'windows/open-v1'
60
- json.url json_ui_garage_url(path: 'views/index')
61
- end
62
- end
63
- end
64
-
65
- json.items do
66
- json.child! do
67
- json.text 'Actions'
68
- json.onClick do
69
- json.action 'windows/open-v1'
70
- json.url json_ui_garage_url(path: 'actions/index')
71
- end
72
- end
73
- end
74
-
75
- json.items do
76
- json.child! do
77
- json.text 'Diagnostics'
78
- json.onClick do
79
- json.action 'dialogs/alert-v1'
80
- json.message 'JSON UI v1.0'
81
- end
82
- end
83
- end
84
- end
@@ -1,25 +0,0 @@
1
- json.title 'Components'
2
-
3
- render './nav_menu', json: json
4
-
5
- json_body_with_list json do
6
- json.rows do
7
- json.child! do
8
- json.template 'default-v1'
9
- json.title 'Alert'
10
- json.onClick do
11
- json.action 'dialogs/alert-v1'
12
- json.message 'This is an alert'
13
- end
14
- end
15
-
16
- # json.child! do
17
- # json.template 'default-v1'
18
- # json.title 'Remote Content'
19
- # json.onClick do
20
- # json.action 'dialogs/open-v1'
21
- # json.url ''
22
- # end
23
- # end
24
- end
25
- end
@@ -1,24 +0,0 @@
1
- doctype html
2
- html
3
- head
4
- meta charset="utf-8"
5
- meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"
6
- title App
7
- = csrf_meta_tags
8
-
9
- = javascript_pack_tag 'vue_renderer', defer: true
10
- /= javascript_include_tag 'vue_renderer_extras', defer: true
11
-
12
- = stylesheet_pack_tag 'vue_renderer'
13
- /= stylesheet_link_tag 'vue_renderer_extras', media: 'all'
14
-
15
- link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet"
16
-
17
- body
18
- noscript
19
- Please enable JavaScript to view this web site.
20
-
21
- #app
22
-
23
- javascript:
24
- var __page = #{raw @__json_ui_orig_page};
@@ -1,53 +0,0 @@
1
- json.title 'Forms'
2
-
3
- render './nav_menu', json: json
4
-
5
- options = {
6
- url: json_ui_garage_url(path: 'forms/basic_post'),
7
- method: 'post',
8
- padding: { top: 12, left: 20, right: 20, bottom: 12 }
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.content do
37
- json.right 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
51
- end
52
- end
53
- end