glib-web 0.4.54 → 0.4.56

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: ecdaf7a5551b21c24cdaf87798c3d8d23bcad631
4
- data.tar.gz: f286b63e80b6e71459809b245931fc4a55974fbb
3
+ metadata.gz: 91d807eb158b9a9fb64bb7290c8b1184a70edfca
4
+ data.tar.gz: 27188e3bedd04275160d5bf5b516acbb75710f7c
5
5
  SHA512:
6
- metadata.gz: c288e2f16adecd42e54a7f7b2840f6a77c6d10a890e8e22ef6917ed9000b564c9df7934cc021bb86582f53f7c406790f1c2b2631424a0bae78328a4bf841cd02
7
- data.tar.gz: fda78f4480c7be505f7fc0addbfc03586b9d364207845e17d49f69cfb6da27a4a5673439d101e6f7c335e7aec71a7a11cb911ad225b3c033388defbea619d559
6
+ metadata.gz: a2d0de117b9f0920fb7469d9d12fde09d1e482733cdde9ea6b4bd9a78a36c7cf1682438a15ff81a1e9fe1ba4c99ad5fe472f0afeb946759b74f542f438859a01
7
+ data.tar.gz: 27e9ce01d6e2e3c59c332ceb39b8f3c0734e8177a0bd7d2d93259730faf774d63d1ec12d8ea8121adc1c3a9c91be9d744a48e5742d90ee9132ee46f9c0493296
@@ -217,6 +217,8 @@ module Glib
217
217
 
218
218
  end
219
219
 
220
+ # raise "Invalid properties: #{options.keys}" if options.size > 0
221
+
220
222
  # instance_variable_set("@#{propName}", name) if options[:cache]
221
223
 
222
224
  end
@@ -13,10 +13,14 @@ module Glib
13
13
  icon :icon
14
14
  action :onClick
15
15
  bool :disabled
16
- # color :color
17
- # backgroundColor :color
18
16
  singleton_array :styleClass, :styleClasses
19
17
 
18
+ def childItems(block)
19
+ json.childItems do
20
+ block.call page.menu_builder
21
+ end
22
+ end
23
+
20
24
  def created
21
25
  json.type 'button'
22
26
  end
@@ -17,6 +17,24 @@ module Glib
17
17
  @__json_ui_page
18
18
  end
19
19
 
20
+ # Use this only if you need to generate json independently from the current `json_ui_page`
21
+ def json_ui_menu(&block)
22
+ @__json_ui_menu_page ||= Page.new(Jbuilder.new, self)
23
+ json = @__json_ui_menu_page.json
24
+ json.nil!
25
+ block&.call @__json_ui_menu_page.menu_builder
26
+ json.attributes!
27
+ end
28
+
29
+ # Use this only if you need to generate json independently from the current `json_ui_page`
30
+ def json_ui_panel(&block)
31
+ @__json_ui_panel_page ||= Page.new(Jbuilder.new, self)
32
+ json = @__json_ui_panel_page.json
33
+ json.nil!
34
+ block&.call @__json_ui_panel_page.view_builder
35
+ json.attributes!
36
+ end
37
+
20
38
  class Page
21
39
  attr_reader :json, :context, :view_builder, :action_builder, :menu_builder
22
40
  attr_reader :list_section_builder, :table_section_builder, :drawer_content_builder, :split_content_builder
@@ -139,7 +139,6 @@ class Glib::JsonUi::ViewBuilder
139
139
 
140
140
  class Scroll < View
141
141
  views :childViews
142
- string :align
143
142
  end
144
143
 
145
144
  class Split < View
@@ -153,11 +153,11 @@ module Glib
153
153
  end
154
154
 
155
155
  # Should be deprecated
156
- def tabButtons(block)
157
- json.tabButtons do
158
- block.call page.menu_builder
159
- end
160
- end
156
+ # def tabButtons(block)
157
+ # json.tabButtons do
158
+ # block.call page.menu_builder
159
+ # end
160
+ # end
161
161
 
162
162
  # def options(options)
163
163
  # current_url = page.context.request.base_url + page.context.request.fullpath
@@ -124,6 +124,12 @@ module Glib
124
124
  true
125
125
  end
126
126
 
127
+ # TODO: Deprecate `user()`
128
+ private # Used by child
129
+ def current_user
130
+ user
131
+ end
132
+
127
133
  # # TODO: Revise because it seems there is no justification for allowing owner to see any of the deleted entities, which include User, Guild, and Post
128
134
  # private # Used by child
129
135
  # def not_deleted_unless_owner_or_moderator?(&block)
@@ -4,7 +4,7 @@ json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.header childViews: ->(header) do
7
- header.tabBar width: 'matchParent', backgroundColor: '#ffca05', color: '#7f561b', tabButtons: ->(menu) do
7
+ header.tabBar width: 'matchParent', backgroundColor: '#ffca05', color: '#7f561b', buttons: ->(menu) do
8
8
 
9
9
  ['FIRST', 'SECOND', 'THIRD'].each_with_index do |text, index|
10
10
  menu.button text: text, disabled: params[:tab].to_i == index, onClick: ->(action) do
@@ -22,37 +22,6 @@ module Glib
22
22
 
23
23
  def get(url, controller)
24
24
  fetch(:get, url, controller)
25
-
26
- # http_header = {
27
- # 'Client-DeviceOS' => user[:device],
28
- # 'Client-Version' => user[:version],
29
- # }
30
-
31
- # # Allow repeating urls because excluding them makes the test results really hard to analyze.
32
- # # if history.include?(url)
33
-
34
- # if url.blank?
35
- # nil
36
- # else
37
- # @context.assert_match URI_REGEXP, url
38
- # history << url
39
- # @context.get url, params: {}, headers: http_header
40
- # response = @context.response
41
- # JsonCrawler::Router.log controller, url, response
42
- # if (code = response.code.to_i) == 302
43
- # redirect_uri = URI(response.headers['Location'])
44
- # redirect_uri.query = [redirect_uri.query, "format=json"].compact.join('&')
45
- # return get redirect_uri.to_s, controller
46
- # else
47
- # response_times << response.headers['X-Runtime'].to_f
48
- # @context.assert_includes VALID_RESPONSE_CODES, code, "Expected a valid response but was [#{response.code}] #{Rack::Utils::HTTP_STATUS_CODES[response.code.to_i]}:\n#{url}"
49
- # if response.content_type == 'application/json'
50
- # JSON.parse(response.body)
51
- # else
52
- # nil
53
- # end
54
- # end
55
- # end
56
25
  end
57
26
 
58
27
  def post(url, controller, params)
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.54
4
+ version: 0.4.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''