glib-web 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +6 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +5 -1
- data/app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +1 -0
- data/lib/glib/json_crawler/router.rb +16 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71cb6d54bc1fbb2c25ccbeffe5c3973a9c6623a796a0bdf34ce76d6f83598ea6
|
4
|
+
data.tar.gz: 78d7afacf9d015032060e8da2d77bb3ae88d31676ac22a5bb39776007e70cb2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
@
|
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
|
-
@
|
99
|
-
@visitor.begin_page
|
103
|
+
@page_specs << spec
|
104
|
+
@visitor.begin_page(spec)
|
100
105
|
end
|
101
106
|
|
102
107
|
def end_page(spec)
|
103
|
-
@
|
104
|
-
@visitor.end_page
|
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)
|