glib-web 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,212 +2,184 @@ json.title 'Panels'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_scroll json do
6
- json.child! do
7
- json.view 'h1-v1'
8
- json.text 'Horizontal panel'
9
- end
10
- json.child! do
11
- json.view 'panels/horizontal-v1'
12
- json.backgroundColor '#b3bac2'
13
- json.subviews do
14
- json.child! do
15
- json.view 'button-v1'
16
- json.text '1'
17
- end
18
-
19
- json.child! do
20
- json.view 'button-v1'
21
- json.text '2'
22
- end
23
-
24
- json.child! do
25
- json.view 'button-v1'
26
- json.text '3'
27
- end
5
+ json_ui_page json do |page|
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.h1 text: 'Horizontal panel'
8
+ scroll.panels_horizontal backgroundColor: '#b3bac2', childViews: ->(panel) do
9
+ panel.button text: '1'
10
+ panel.button text: '2'
11
+ panel.button text: '3'
28
12
  end
29
- end
30
-
31
- json.child! do
32
- json.view 'label-v1'
33
- json.text "\n"
34
- end
35
- json.child! do
36
- json.view 'h1-v1'
37
- json.text 'Horizontal panel with equal filling'
38
- end
39
- json.child! do
40
- json.view 'panels/horizontal-v1'
41
- json.backgroundColor '#b3bac2'
42
- json.width 300
43
- json.distribution 'fillEqually'
44
- json.subviews do
45
- json.child! do
46
- json.view 'button-v1'
47
- json.text '1'
48
- end
49
13
 
50
- json.child! do
51
- json.view 'button-v1'
52
- json.text '2'
53
- json.height 50
54
- end
55
-
56
- json.child! do
57
- json.view 'button-v1'
58
- json.text '3'
59
- json.height 70
60
- end
14
+ scroll.label text: "\n"
15
+ scroll.h1 text: 'Horizontal panel with equal filling'
16
+ scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'fillEqually', childViews: ->(panel) do
17
+ panel.button text: '1'
18
+ panel.button text: '2', height: 50
19
+ panel.button text: '3', height: 70
61
20
  end
62
- end
63
21
 
64
- json.child! do
65
- json.view 'label-v1'
66
- json.text "\n"
67
- end
68
- json.child! do
69
- json.view 'h1-v1'
70
- json.text 'Horizontal panel with equal spacing'
71
- end
72
- json.child! do
73
- json.view 'panels/horizontal-v1'
74
- json.backgroundColor '#b3bac2'
75
- json.width 300
76
- json.distribution 'spaceEqually'
77
- json.subviews do
78
- json.child! do
79
- json.view 'button-v1'
80
- json.text '1'
81
- end
82
-
83
- json.child! do
84
- json.view 'button-v1'
85
- json.text '2'
86
- end
87
-
88
- json.child! do
89
- json.view 'button-v1'
90
- json.text '3'
91
- end
22
+ scroll.label text: "\n"
23
+ scroll.h1 text: 'Horizontal panel with equal spacing'
24
+ scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
25
+ panel.button text: '1'
26
+ panel.button text: '2'
27
+ panel.button text: '3'
92
28
  end
93
- end
94
29
 
95
- json.child! do
96
- json.view 'label-v1'
97
- json.text "\n"
98
- end
99
- json.child! do
100
- json.view 'h1-v1'
101
- json.text 'Horizontal panel (containing vertical panel)'
102
- end
103
- json.child! do
104
- json.view 'panels/horizontal-v1'
105
- json.subviews do
106
- json.child! do
107
- json.view 'button-v1'
108
- json.text '1'
109
- end
110
-
111
- json.child! do
112
- json.view 'panels/vertical-v1'
113
- json.subviews do
114
- json.child! do
115
- json.view 'button-v1'
116
- json.text 'A'
117
- end
118
-
119
- json.child! do
120
- json.view 'button-v1'
121
- json.text 'B'
122
- end
123
- end
124
- end
125
-
126
- json.child! do
127
- json.view 'button-v1'
128
- json.text '3'
30
+ scroll.label text: "\n"
31
+ scroll.h1 text: 'Horizontal panel (containing vertical panel)'
32
+ scroll.panels_horizontal distribution: 'spaceEqually', childViews: ->(panel) do
33
+ panel.button text: '1'
34
+ panel.panels_vertical childViews: ->(v) do
35
+ v.button text: 'A'
36
+ v.button text: 'B'
129
37
  end
38
+ panel.button text: '3'
130
39
  end
131
- end
132
-
133
- json.child! do
134
- json.view 'label-v1'
135
- json.text "\n"
136
- end
137
- json.child! do
138
- json.view 'h1-v1'
139
- json.text 'Horizontal panel with equal filling (containing vertical panel)'
140
- end
141
- json.child! do
142
- json.view 'panels/horizontal-v1'
143
- json.width 'matchParent'
144
- json.distribution 'fillEqually'
145
- json.subviews do
146
- json.child! do
147
- json.view 'button-v1'
148
- json.text '1'
149
- end
150
40
 
151
- json.child! do
152
- json.view 'panels/vertical-v1'
153
- json.subviews do
154
- json.child! do
155
- json.view 'button-v1'
156
- json.text 'A'
157
- end
158
-
159
- json.child! do
160
- json.view 'button-v1'
161
- json.text 'B'
162
- end
163
- end
41
+ scroll.label text: "\n"
42
+ scroll.h1 text: 'Horizontal panel with equal filling (containing vertical panel)'
43
+ scroll.panels_horizontal width: 'matchParent', distribution: 'fillEqually', childViews: ->(panel) do
44
+ panel.button text: '1'
45
+ panel.panels_vertical childViews: ->(v) do
46
+ v.button text: 'A'
47
+ v.button text: 'B'
164
48
  end
49
+ panel.button text: '3'
50
+ end
165
51
 
166
- json.child! do
167
- json.view 'button-v1'
168
- json.text '3'
52
+ scroll.label text: "\n"
53
+ scroll.h1 text: 'Horizontal panel with equal spacing (containing vertical panel)'
54
+ scroll.panels_horizontal width: 'matchParent', distribution: 'spaceEqually', childViews: ->(panel) do
55
+ panel.button text: '1'
56
+ panel.panels_vertical childViews: ->(v) do
57
+ v.button text: 'A'
58
+ v.button text: 'B'
169
59
  end
60
+ panel.button text: '3'
170
61
  end
171
- end
172
62
 
173
- json.child! do
174
- json.view 'label-v1'
175
- json.text "\n"
176
- end
177
- json.child! do
178
- json.view 'h1-v1'
179
- json.text 'Horizontal panel with equal spacing (containing vertical panel)'
180
63
  end
181
- json.child! do
182
- json.view 'panels/horizontal-v1'
183
- json.width 'matchParent'
184
- json.distribution 'spaceEqually'
185
- json.subviews do
186
- json.child! do
187
- json.view 'button-v1'
188
- json.text '1'
189
- end
190
-
191
- json.child! do
192
- json.view 'panels/vertical-v1'
193
- json.subviews do
194
- json.child! do
195
- json.view 'button-v1'
196
- json.text 'A'
197
- end
198
-
199
- json.child! do
200
- json.view 'button-v1'
201
- json.text 'B'
202
- end
203
- end
204
- end
64
+ end
205
65
 
206
- json.child! do
207
- json.view 'button-v1'
208
- json.text '3'
209
- end
210
- end
211
- end
212
66
 
213
- end
67
+ # json.child! do
68
+ # json.view 'label-v1'
69
+ # json.text "\n"
70
+ # end
71
+ # json.child! do
72
+ # json.view 'h1-v1'
73
+ # json.text 'Horizontal panel (containing vertical panel)'
74
+ # end
75
+ # json.child! do
76
+ # json.view 'panels/horizontal-v1'
77
+ # json.subviews do
78
+ # json.child! do
79
+ # json.view 'button-v1'
80
+ # json.text '1'
81
+ # end
82
+
83
+ # json.child! do
84
+ # json.view 'panels/vertical-v1'
85
+ # json.subviews do
86
+ # json.child! do
87
+ # json.view 'button-v1'
88
+ # json.text 'A'
89
+ # end
90
+
91
+ # json.child! do
92
+ # json.view 'button-v1'
93
+ # json.text 'B'
94
+ # end
95
+ # end
96
+ # end
97
+
98
+ # json.child! do
99
+ # json.view 'button-v1'
100
+ # json.text '3'
101
+ # end
102
+ # end
103
+ # end
104
+
105
+ # json.child! do
106
+ # json.view 'label-v1'
107
+ # json.text "\n"
108
+ # end
109
+ # json.child! do
110
+ # json.view 'h1-v1'
111
+ # json.text 'Horizontal panel with equal filling (containing vertical panel)'
112
+ # end
113
+ # json.child! do
114
+ # json.view 'panels/horizontal-v1'
115
+ # json.width 'matchParent'
116
+ # json.distribution 'fillEqually'
117
+ # json.subviews do
118
+ # json.child! do
119
+ # json.view 'button-v1'
120
+ # json.text '1'
121
+ # end
122
+
123
+ # json.child! do
124
+ # json.view 'panels/vertical-v1'
125
+ # json.subviews do
126
+ # json.child! do
127
+ # json.view 'button-v1'
128
+ # json.text 'A'
129
+ # end
130
+
131
+ # json.child! do
132
+ # json.view 'button-v1'
133
+ # json.text 'B'
134
+ # end
135
+ # end
136
+ # end
137
+
138
+ # json.child! do
139
+ # json.view 'button-v1'
140
+ # json.text '3'
141
+ # end
142
+ # end
143
+ # end
144
+
145
+ # json.child! do
146
+ # json.view 'label-v1'
147
+ # json.text "\n"
148
+ # end
149
+ # json.child! do
150
+ # json.view 'h1-v1'
151
+ # json.text 'Horizontal panel with equal spacing (containing vertical panel)'
152
+ # end
153
+ # json.child! do
154
+ # json.view 'panels/horizontal-v1'
155
+ # json.width 'matchParent'
156
+ # json.distribution 'spaceEqually'
157
+ # json.subviews do
158
+ # json.child! do
159
+ # json.view 'button-v1'
160
+ # json.text '1'
161
+ # end
162
+
163
+ # json.child! do
164
+ # json.view 'panels/vertical-v1'
165
+ # json.subviews do
166
+ # json.child! do
167
+ # json.view 'button-v1'
168
+ # json.text 'A'
169
+ # end
170
+
171
+ # json.child! do
172
+ # json.view 'button-v1'
173
+ # json.text 'B'
174
+ # end
175
+ # end
176
+ # end
177
+
178
+ # json.child! do
179
+ # json.view 'button-v1'
180
+ # json.text '3'
181
+ # end
182
+ # end
183
+ # end
184
+
185
+ # end
@@ -2,33 +2,50 @@ json.title 'Panels'
2
2
 
3
3
  render "#{@path_prefix}/nav_menu", json: json
4
4
 
5
- json_body_with_list json do
6
- json.rows do
7
- json.child! do
8
- json.template 'thumbnail-v1'
9
- json.title 'Vertical'
10
- json.onClick do
11
- json.action 'windows/open-v1'
12
- json.url json_ui_garage_url(path: 'panels/vertical')
5
+ json_ui_page json do |page|
6
+ page.list firstSection: ->(section) do
7
+ section.rows do |row|
8
+ row.thumbnail title: 'Vertical', onClick: ->(action) do
9
+ action.windows_open url: json_ui_garage_url(path: 'panels/vertical')
13
10
  end
14
- end
15
-
16
- json.child! do
17
- json.template 'thumbnail-v1'
18
- json.title 'Horizontal'
19
- json.onClick do
20
- json.action 'windows/open-v1'
21
- json.url json_ui_garage_url(path: 'panels/horizontal')
11
+ row.thumbnail title: 'Horizontal', onClick: ->(action) do
12
+ action.windows_open url: json_ui_garage_url(path: 'panels/horizontal')
22
13
  end
23
- end
24
-
25
- json.child! do
26
- json.template 'thumbnail-v1'
27
- json.title 'Split'
28
- json.onClick do
29
- json.action 'windows/open-v1'
30
- json.url json_ui_garage_url(path: 'panels/split')
14
+ row.thumbnail title: 'Split', onClick: ->(action) do
15
+ action.windows_open url: json_ui_garage_url(path: 'panels/split')
31
16
  end
32
17
  end
18
+
33
19
  end
34
20
  end
21
+
22
+ # json_body_with_list json do
23
+ # json.rows do
24
+ # json.child! do
25
+ # json.template 'thumbnail-v1'
26
+ # json.title 'Vertical'
27
+ # json.onClick do
28
+ # json.action 'windows/open-v1'
29
+ # json.url json_ui_garage_url(path: 'panels/vertical')
30
+ # end
31
+ # end
32
+
33
+ # json.child! do
34
+ # json.template 'thumbnail-v1'
35
+ # json.title 'Horizontal'
36
+ # json.onClick do
37
+ # json.action 'windows/open-v1'
38
+ # json.url json_ui_garage_url(path: 'panels/horizontal')
39
+ # end
40
+ # end
41
+
42
+ # json.child! do
43
+ # json.template 'thumbnail-v1'
44
+ # json.title 'Split'
45
+ # json.onClick do
46
+ # json.action 'windows/open-v1'
47
+ # json.url json_ui_garage_url(path: 'panels/split')
48
+ # end
49
+ # end
50
+ # end
51
+ # end