glib-web 0.4.17 → 0.4.20

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: '025681707e771829fc38ade19531b445614fea32'
4
- data.tar.gz: d5e74fcf7a3de0baa2f2c7235ac42eb2fe6e5921
3
+ metadata.gz: 5c4c7bc6647854b613fa074f065ecfcb6b33dd50
4
+ data.tar.gz: 8e74f10469c511bac536d56a3756eeac09a2db30
5
5
  SHA512:
6
- metadata.gz: 11c6a435ea67d48b288843d7013a10fc8b8a00fde30f5c739ced1d4b7896f69ce0e17020fdbd8ff756675e33ecb961aacd61ed0ead0bd54fef9f2d6741ca0d95
7
- data.tar.gz: 2d275ae65c9d6e0bdee4bf2cd5eb940115d5cc82d09de72d2cd2fca217f62ba7507494c00354decaa688e9d376c5fd61a5cb1fb12694a1bb4ebdb9e5184d9551
6
+ metadata.gz: 41cb1081d27f1f961ac3c84b486443d51b6bce60661e9a56a2a3b7b9768188eb4a1dc4fe467efd6f1ed18d6d9310378aaaec3a7c56e8c7089f04572fac440b32
7
+ data.tar.gz: 0635cdab21ed355d2f106ba8af3bd215e85403a6d70dc03c2b18040200e11d2b846d5f69537691874d0236177386183a3115d7bb3ba7e962461875aee5992fc1
@@ -39,6 +39,12 @@ module Glib::Json::Libs
39
39
  def json_ui_render(template, args = {})
40
40
  JSON.parse(render_to_string(template, locals: args))
41
41
  end
42
+
43
+ def json_libs_force_json_ui
44
+ if params[:_render] != 'v1'
45
+ redirect_to url_for(params.to_unsafe_h.merge(_render: 'v1'))
46
+ end
47
+ end
42
48
 
43
49
 
44
50
 
@@ -75,11 +81,7 @@ module Glib::Json::Libs
75
81
  end
76
82
 
77
83
  def json_libs_force_json_ui
78
- before_action do
79
- if params[:_render] != 'v1'
80
- redirect_to url_for(params.to_unsafe_h.merge(_render: 'v1'))
81
- end
82
- end
84
+ before_action :json_libs_force_json_ui
83
85
  end
84
86
 
85
87
  def json_libs_rescue_csrf
@@ -79,8 +79,11 @@ module Glib
79
79
  class P < AbstractText
80
80
  end
81
81
 
82
+ class Markdown < AbstractText
83
+ end
84
+
82
85
  class Label < AbstractText
83
- string :format
86
+ # string :format
84
87
  action :onClick
85
88
  end
86
89
 
@@ -53,6 +53,10 @@ if local_assigns[:top_nav] || json_ui_app_is_web?
53
53
  action.windows_open url: json_ui_garage_url
54
54
  end
55
55
 
56
+ menu.button icon: 'refresh', text: 'Reload', onClick: ->(action) do
57
+ action.windows_reload
58
+ end
59
+
56
60
  menu.button icon: { name: 'zoom_in', badge: '!' }, text: 'Diagnostics', onClick: ->(action) do
57
61
  action.dialogs_alert message: %{
58
62
  Bundle ID: #{json_ui_app_bundle_id || '<unknown>'}
@@ -15,9 +15,12 @@ json_ui_page json do |page|
15
15
  form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Photo', accepts: rules1, directUploadUrl: rails_direct_uploads_url,
16
16
  value: 'eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4',
17
17
  fileUrl: 'https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100',
18
- fileTitle: '1 month ago'
18
+ fileTitle: '1 month ago',
19
+ placeholderView: { type: 'image', width: 100, height: 100 }
20
+
19
21
  form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Photo', accepts: rules2, directUploadUrl: rails_direct_uploads_url,
20
- styleClass: 'avatar'
22
+ placeholderView: { type: 'avatar', width: 100, height: 100 }
23
+
21
24
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
22
25
  end)
23
26
  end
@@ -2,12 +2,12 @@ json.title 'Views'
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.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
7
  scroll.spacer height: 20
8
8
  scroll.h2 text: 'Paragraph'
9
9
  scroll.spacer height: 6
10
- scroll.p format: 'markdown', text:
10
+ scroll.markdown text:
11
11
  '# h1 Heading' + "\n" +
12
12
  '## h2 Heading' + "\n" +
13
13
  '### h3 Heading' + "\n" +
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.4.17
4
+ version: 0.4.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''