glib-web 0.15.1 → 0.15.2

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
  SHA256:
3
- metadata.gz: 6ee300b7e05299ffaed9427513fada06ef2f248c68f8329bc6d07de7faf947a0
4
- data.tar.gz: 8c11c15ae46e15b7fcfaf5c43744fbe2f872a6b6ea2e185e75f882759473c3db
3
+ metadata.gz: 71cb6d54bc1fbb2c25ccbeffe5c3973a9c6623a796a0bdf34ce76d6f83598ea6
4
+ data.tar.gz: 78d7afacf9d015032060e8da2d77bb3ae88d31676ac22a5bb39776007e70cb2e
5
5
  SHA512:
6
- metadata.gz: 4b97228f7f53ea4f1fb86877c08c1cecadf12aaee9536e2ee8488eed58ffff4502c253984c9bc38d0e7df839e46283a5ac5aebbc6b63de63dcc98fa968e77bd6
7
- data.tar.gz: b5a3e5a45469e5486465a7b5f3c12400d15ade17bcee01c237528cda747b404478cbc500347b5442992a1a8ae84efd0895f8fb9eefa4ef91493a340977d0df6a
6
+ metadata.gz: b550f286f9f170a4a4bff70aca2d0f42a4f5327941d9228a47c172a832106af08d1bc525d6756b2902277e112c3b7ca5f146e6472cf4b27f642ba94f5e777e80
7
+ data.tar.gz: 14ffeb553fff62702924f8a558245f2cb9703f39d2873d9ad9a2e3b1831ab35edd75f6961d95b9d80fd090e5cb641e52843d4b2e4a15e07891cc3e958ca65e24
@@ -26,6 +26,8 @@ class Glib::JsonUi::ActionBuilder
26
26
  class Show < Action
27
27
  panels_builder :content, :body
28
28
  bool :showClose
29
+ string :fullscreen # mobile, always
30
+ length :width
29
31
 
30
32
  # Future plan
31
33
  # panels_builder :content, :body, :footer
@@ -34,12 +36,16 @@ class Glib::JsonUi::ActionBuilder
34
36
  class Open < Action
35
37
  string :url, cache: true
36
38
  bool :showClose
39
+ string :fullscreen
40
+ length :width
37
41
  end
38
42
 
39
43
  class Reload < Action
40
44
  panels_builder :content, :body
41
45
  string :url, cache: true
42
46
  bool :showClose
47
+ string :fullscreen # mobile, always
48
+ length :width
43
49
  end
44
50
 
45
51
  class Close < Action
@@ -59,7 +59,11 @@ section.rows builder: ->(template) do
59
59
  end
60
60
 
61
61
  template.thumbnail title: 'dialogs/open', onClick: ->(action) do
62
- action.dialogs_open url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
62
+ action.dialogs_open width: 950, url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
63
+ end
64
+
65
+ template.thumbnail title: 'dialogs/open (fullscreen on mobile)', onClick: ->(action) do
66
+ action.dialogs_open fullscreen: 'mobile', url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
63
67
  end
64
68
 
65
69
  template.thumbnail title: 'dialogs/oauth', onClick: ->(action) do
@@ -13,7 +13,7 @@ action.send "dialogs_#{dialog_mode}", showClose: true, content: ->(dialog) do
13
13
  split.left childViews: ->(left) do
14
14
  left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
15
15
  horizontal.label text: 'Open current', onClick: ->(subaction) do
16
- subaction.dialogs_reload url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog_reload')
16
+ subaction.dialogs_reload width: 900, fullscreen: 'mobile', url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog_reload')
17
17
  end
18
18
  end
19
19
  end
@@ -49,6 +49,7 @@ page.scroll childViews: ->(scroll) do
49
49
  childViews: ->(form) do
50
50
  form.h3 text: 'Perform custom actions on submit'
51
51
  form.spacer height: 6
52
+ # See https://stackoverflow.com/questions/4196681/form-not-submitting-when-pressing-enter
52
53
  form.label text: 'This also works when you press ENTER in the following text fields'
53
54
  form.spacer height: 6
54
55
 
@@ -1,17 +1,22 @@
1
+
1
2
  module Glib
2
3
  module JsonCrawler
3
4
  class Router
4
- attr_reader :read_only_actions, :logger, :page_spec
5
+ attr_reader :read_only_actions, :logger
5
6
  attr_accessor :host
6
7
 
7
8
  def log(action, url, response = nil)
8
- @logger +=' ' * @depth + [
9
+ @logger += ' ' * @depth + [
9
10
  action,
10
11
  response.present? ? response.code : nil,
11
12
  url
12
13
  ].compact.join(' :: ') + "\n"
13
14
  end
14
15
 
16
+ def _puts(text)
17
+ puts ' ' * @depth + text
18
+ end
19
+
15
20
  def initialize
16
21
  @depth = -1
17
22
  @logger = ''
@@ -19,7 +24,7 @@ module Glib
19
24
  @read_only_actions = Set.new
20
25
  # default rails's development host
21
26
  @host ||= 'localhost:3000'
22
- @page_spec = nil
27
+ @page_specs = []
23
28
  end
24
29
 
25
30
  def step(http, args)
@@ -95,13 +100,17 @@ module Glib
95
100
  end
96
101
 
97
102
  def begin_page(spec)
98
- @page_spec = spec
99
- @visitor.begin_page spec
103
+ @page_specs << spec
104
+ @visitor.begin_page(spec)
100
105
  end
101
106
 
102
107
  def end_page(spec)
103
- @page_spec = nil
104
- @visitor.end_page spec
108
+ @page_specs.pop
109
+ @visitor.end_page(spec)
110
+ end
111
+
112
+ def page_spec
113
+ @page_specs.last
105
114
  end
106
115
 
107
116
  def allowed?(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.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''