glib-web 0.4.62 → 0.4.63

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: 05f8e86292395e22c1ee9ef711abdf5fbd9b9115
4
- data.tar.gz: 3181f098ac9d09879b8ee8fa84dfe2f173317d90
3
+ metadata.gz: 476424036977faf25b0358602efe85377258d2f6
4
+ data.tar.gz: d0e7c51ee8a6bc550d91251fd0a178821d5b15b9
5
5
  SHA512:
6
- metadata.gz: 6138e1485e762613e802890ab940a6bf82078f074909bd1fc6af4b50c4602b4a5918f8fde84162d4dfb525c166bf7945cb5c0adb7fc3b6a2277c74aeb3f50acf
7
- data.tar.gz: e3757f1d6da865c8d4b3dfdfc962b5e04d5d52b3d0acc7a8fc4cedefb211490d9d8101eca06f62018c52c0a32451319657d21f8704feecfda88fd7507785e96f
6
+ metadata.gz: b81e49f36b5c37d4cd0b5058b8047c956f7d253a15e436aa514d1b10084a1aa4e7e61dfc3384f3abdac0d08dc756986d3ee3a815b2c448e48153ef618932e8db
7
+ data.tar.gz: 740a4c70fdb8d48f9ce39c4109f71cd75dd132bc7731fe8abd454d816dd7a77df389a5d20f56ca106196636afc06ea591565d9c3e70dfc7220c257d3f447fc03
@@ -58,7 +58,9 @@ module Glib::Json::Libs
58
58
  include Glib::Json::Traversal
59
59
  include Glib::Json::NewDynamicText
60
60
 
61
- before_action :__json_ui_start
61
+ before_action do
62
+ __json_ui_start(options)
63
+ end
62
64
 
63
65
  # Note that after_action gets executed in reverse
64
66
  after_action do
@@ -31,15 +31,15 @@ module Glib::Json::Ui
31
31
  @__json_ui_activated
32
32
  end
33
33
 
34
- def __json_ui_start
34
+ def __json_ui_start(options)
35
35
  @__json_ui_activated = false
36
- @__json_ui_rendering = false
37
- if params[:_render].present?
36
+ @__json_ui_rendering = nil
37
+ if options[:when] == :always || params[:_render] == 'v1'
38
38
  @__json_ui_activated = true
39
39
  request.variant = :ui
40
40
 
41
41
  if request.format.html? && params[:_skip_render] != 'true'
42
- @__json_ui_rendering = true
42
+ @__json_ui_rendering = :vue
43
43
  request.format = 'json'
44
44
  end
45
45
  end
@@ -48,14 +48,12 @@ module Glib::Json::Ui
48
48
  def __json_ui_commit(options)
49
49
  return if response.status >= 300
50
50
 
51
- if @__json_ui_rendering
52
- case params[:_render]
53
- when 'v1'
54
- if (hash = json_transformation_start).is_a?(Hash)
55
- __json_ui_vue(hash, options)
56
- else
57
- raise "Invalid JSON UI payload: #{hash}"
58
- end
51
+ case @__json_ui_rendering
52
+ when :vue
53
+ if (hash = json_transformation_start).is_a?(Hash)
54
+ __json_ui_vue(hash, options)
55
+ else
56
+ raise "Invalid JSON UI payload: #{hash}"
59
57
  end
60
58
  end
61
59
  end
@@ -189,13 +189,23 @@ module Glib
189
189
  end
190
190
 
191
191
  json.set!(propName) do
192
- data[:material] ||= {}
193
- data[:material][:name] = name if name
192
+ if name
193
+ data[:material] ||= {}
194
+ data[:material][:name] = name
195
+ end
194
196
 
195
- material = data[:material]
196
- json.material do
197
- json.name material[:name]
198
- json.size material[:size] if material[:size]
197
+ if (material = data[:material])
198
+ json.material do
199
+ json.name material[:name]
200
+ json.size material[:size] if material[:size]
201
+ end
202
+ end
203
+
204
+ if (fa = data[:fa])
205
+ json.fa do
206
+ json.name fa[:name]
207
+ json.size fa[:size] if fa[:size]
208
+ end
199
209
  end
200
210
 
201
211
  if (custom = data[:custom])
@@ -80,6 +80,7 @@ module Glib
80
80
  end
81
81
 
82
82
  class Markdown < AbstractText
83
+ bool :previewVideo
83
84
  end
84
85
 
85
86
  class Label < AbstractText
@@ -5,7 +5,7 @@ json_ui_page json do |page|
5
5
 
6
6
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
7
  scroll.spacer height: 20
8
- scroll.h2 text: 'Paragraph'
8
+ scroll.h2 text: 'Markdown'
9
9
  scroll.spacer height: 6
10
10
  scroll.markdown text:
11
11
  '# h1 Heading' + "\n" +
@@ -25,6 +25,17 @@ json_ui_page json do |page|
25
25
  "\n" +
26
26
  '_This is italic text_' + "\n" +
27
27
  "\n" +
28
- '~~Strikethrough~~' + "\n"
28
+ '~~Strikethrough~~' + "\n" +
29
+ "\n" +
30
+ 'https://www.google.com' + "\n"
31
+
32
+ scroll.spacer height: 20
33
+ scroll.h2 text: 'Markdown with preview (Web Only)'
34
+ scroll.spacer height: 6
35
+ scroll.markdown text: 'Here is the video: https://www.youtube.com/watch?v=947op8yKJRY', previewVideo: true
36
+
37
+ scroll.spacer height: 10
38
+ scroll.markdown text: 'Some videos: https://youtu.be/ATnpEOo3GJA, https://www.youtube.com/watch?v=947op8yKJRY', previewVideo: true
39
+
29
40
  end
30
41
  end
@@ -15,9 +15,6 @@ module Glib
15
15
  @depth = -1
16
16
  @logger = logger
17
17
  @visitor = Glib::Json::Traversal::Visitor.new
18
-
19
- # @store_action = store_action
20
-
21
18
  @read_only_actions = Set.new
22
19
  end
23
20
 
@@ -36,15 +33,10 @@ module Glib
36
33
  @depth += 1
37
34
  child = case action
38
35
  when 'initiate_navigation'
39
- # @@crawler_actions.add([action, params['url']]) if @@store_action
40
36
  @read_only_actions.add([action, params['url']])
41
37
  JsonCrawler::NavInitiate.new(http, params, action)
42
38
  when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1'
43
- # TODO: Shouldn't dialog be crawled as well?
44
- # unless action == 'dialogs/open-v1'
45
- # @@crawler_actions.add([action, params['url']]) if @@store_action
46
- @read_only_actions.add([action, params['url']])
47
- # end
39
+ @read_only_actions.add([action, params['url']])
48
40
  JsonCrawler::WindowsOpen.new(http, params, action)
49
41
  when 'http/post-v1'
50
42
  JsonCrawler::ActionHttp.new(:post, http, params, action)
@@ -54,7 +46,6 @@ module Glib
54
46
  JsonCrawler::FormsSubmit.new(http, params, action, forms.last)
55
47
  else
56
48
  unless ['http/delete-v1', 'dialogs/oauth-v1', 'windows/openWeb-v1'].include?(action)
57
- # @@crawler_actions.add([action, params['url']]) if @@store_action
58
49
  @read_only_actions.add([action, params['url']])
59
50
  end
60
51
  self.log action, params['url']
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.62
4
+ version: 0.4.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''