glib-web 0.0.3 → 0.0.4

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 +5 -5
  2. metadata +3 -41
  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 -11
  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/floating_submit.json.jbuilder +0 -48
  16. data/app/views/forms/generic_post.json.jbuilder +0 -6
  17. data/app/views/forms/index.json.jbuilder +0 -34
  18. data/app/views/forms/submit_indicator.json.jbuilder +0 -32
  19. data/app/views/forms/submit_indicator_post.json.jbuilder +0 -12
  20. data/app/views/home/index.json.jbuilder +0 -92
  21. data/app/views/lists/_infinite_scroll_section.json.jbuilder +0 -10
  22. data/app/views/lists/index.json.jbuilder +0 -25
  23. data/app/views/lists/infinite_scroll.json.jbuilder +0 -27
  24. data/app/views/lists/templating.json.jbuilder +0 -45
  25. data/app/views/pages/full_width_height.json.jbuilder +0 -39
  26. data/app/views/pages/index.json.jbuilder +0 -35
  27. data/app/views/pages/layout.json.jbuilder +0 -35
  28. data/app/views/pages/nav_buttons.json.jbuilder +0 -32
  29. data/app/views/panels/horizontal.json.jbuilder +0 -213
  30. data/app/views/panels/index.json.jbuilder +0 -34
  31. data/app/views/panels/split.json.jbuilder +0 -360
  32. data/app/views/panels/vertical.json.jbuilder +0 -94
  33. data/app/views/views/basic.json.jbuilder +0 -21
  34. data/app/views/views/carousels.json.jbuilder +0 -100
  35. data/app/views/views/images.json.jbuilder +0 -48
  36. data/app/views/views/index.json.jbuilder +0 -34
  37. data/config/routes.rb +0 -4
  38. data/lib/glib-web.rb +0 -2
  39. data/lib/glib/engine.rb +0 -7
  40. data/lib/glib/version.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 9fc3dad45f3ec17ec7fcdbfebd5324917c08f0464930e2268dc189dbe5ebd122
4
- data.tar.gz: 6ee165f54418afae4430d91cbce584cecb019e8abff187f92ca1fd49af02e0d8
2
+ SHA1:
3
+ metadata.gz: 5f1ac6240d706daaa3e4855af5b67b1e077b1d9d
4
+ data.tar.gz: e70d4713ddcb3ea3498046beb834da9c93f889bd
5
5
  SHA512:
6
- metadata.gz: cbba99ee28d629efe9bd8833da5e7b82d647c39eb19883d328f1a29f11ea15783df9dc72848028d8b0c8fe004670ea2a5f5bfe7764bcd6bd968149d0d8527f9a
7
- data.tar.gz: 753c3769dd1851b663081b0c4e157645658c2c7ea5267891d2813f8558e1d32f558416b92cdf4e6d5230c54fbf599a06b385bb9bd5e97aad1d4022380ceef0b2
6
+ metadata.gz: 2023ebcdce0666fec8f1bf02491691540373074a31de0deb1569239c4e85b67d0d142a4ef93832a80bab25a3aac41f25911f91723f172b196bcd91601979da8e
7
+ data.tar.gz: 03fd0cfb0f069735878a8f17e92139b771cfe4c0102beaa028c0e54c44d461853287719fc7edaaca8565471f9c7deb9fb240df60c3ad42e6e3df6121d09b1ca2
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -15,45 +15,7 @@ email: ''
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
- files:
19
- - app/controllers/concerns/.keep
20
- - app/controllers/concerns/application/json/libs.rb
21
- - app/controllers/concerns/application/json/transformation.rb
22
- - app/controllers/concerns/application/json/ui.rb
23
- - app/controllers/concerns/application/json/validation.rb
24
- - app/controllers/home_controller.rb
25
- - app/helpers/glib/web/json_ui_helper.rb
26
- - app/views/_nav_menu.json.jbuilder
27
- - app/views/actions/index.json.jbuilder
28
- - app/views/app/views/json_ui/vue/renderer.html.slim
29
- - app/views/forms/basic.json.jbuilder
30
- - app/views/forms/basic_post.json.jbuilder
31
- - app/views/forms/floating_submit.json.jbuilder
32
- - app/views/forms/generic_post.json.jbuilder
33
- - app/views/forms/index.json.jbuilder
34
- - app/views/forms/submit_indicator.json.jbuilder
35
- - app/views/forms/submit_indicator_post.json.jbuilder
36
- - app/views/home/index.json.jbuilder
37
- - app/views/lists/_infinite_scroll_section.json.jbuilder
38
- - app/views/lists/index.json.jbuilder
39
- - app/views/lists/infinite_scroll.json.jbuilder
40
- - app/views/lists/templating.json.jbuilder
41
- - app/views/pages/full_width_height.json.jbuilder
42
- - app/views/pages/index.json.jbuilder
43
- - app/views/pages/layout.json.jbuilder
44
- - app/views/pages/nav_buttons.json.jbuilder
45
- - app/views/panels/horizontal.json.jbuilder
46
- - app/views/panels/index.json.jbuilder
47
- - app/views/panels/split.json.jbuilder
48
- - app/views/panels/vertical.json.jbuilder
49
- - app/views/views/basic.json.jbuilder
50
- - app/views/views/carousels.json.jbuilder
51
- - app/views/views/images.json.jbuilder
52
- - app/views/views/index.json.jbuilder
53
- - config/routes.rb
54
- - lib/glib-web.rb
55
- - lib/glib/engine.rb
56
- - lib/glib/version.rb
18
+ files: []
57
19
  homepage:
58
20
  licenses: []
59
21
  metadata: {}
@@ -73,7 +35,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
35
  version: '0'
74
36
  requirements: []
75
37
  rubyforge_project:
76
- rubygems_version: 2.7.6
38
+ rubygems_version: 2.6.8
77
39
  signing_key:
78
40
  specification_version: 4
79
41
  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,11 +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
- 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1')
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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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 Glib::Web::Engine.routes.url_helpers.json_ui_garage_path(_render: 'v1', 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