glib-web 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/glib/json_ui/page_helper.rb +26 -14
  3. data/app/views/json_ui/garage/_nav_menu.json.jbuilder +112 -70
  4. data/app/views/json_ui/garage/actions/index.json.jbuilder +10 -11
  5. data/app/views/json_ui/garage/forms/basic.json.jbuilder +4 -55
  6. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +2 -2
  7. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +2 -31
  8. data/app/views/json_ui/garage/forms/index.json.jbuilder +7 -7
  9. data/app/views/json_ui/garage/forms/submit_indicator.json.jbuilder +2 -26
  10. data/app/views/json_ui/garage/home/index.json.jbuilder +9 -9
  11. data/app/views/json_ui/garage/lists/index.json.jbuilder +5 -27
  12. data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +17 -10
  13. data/app/views/json_ui/garage/lists/templating.json.jbuilder +7 -49
  14. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +46 -38
  15. data/app/views/json_ui/garage/pages/index.json.jbuilder +6 -39
  16. data/app/views/json_ui/garage/pages/layout.json.jbuilder +2 -34
  17. data/app/views/json_ui/garage/pages/nav_buttons.json.jbuilder +2 -31
  18. data/app/views/json_ui/garage/pages/tab_bar.json.jbuilder +2 -2
  19. data/app/views/json_ui/garage/panels/carousel.json.jbuilder +2 -2
  20. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +2 -123
  21. data/app/views/json_ui/garage/panels/index.json.jbuilder +7 -38
  22. data/app/views/json_ui/garage/panels/split.json.jbuilder +16 -16
  23. data/app/views/json_ui/garage/panels/vertical.json.jbuilder +2 -93
  24. data/app/views/json_ui/garage/views/basic.json.jbuilder +2 -20
  25. data/app/views/json_ui/garage/views/carousels.json.jbuilder +2 -96
  26. data/app/views/json_ui/garage/views/images.json.jbuilder +2 -55
  27. data/app/views/json_ui/garage/views/index.json.jbuilder +6 -37
  28. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +1 -1
  29. metadata +1 -2
  30. data/app/helpers/glib/json_ui/json_ui_helper.rb +0 -94
@@ -1,20 +1,20 @@
1
1
  json.title 'Forms'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
6
  page.list firstSection: ->(section) do
7
- section.rows do |row|
8
- row.thumbnail title: 'Basic', onClick: ->(action) do
7
+ section.rows builder: ->(template) do
8
+ template.thumbnail title: 'Basic', onClick: ->(action) do
9
9
  action.windows_open url: json_ui_garage_url(path: 'forms/basic')
10
10
  end
11
- row.thumbnail title: 'Submit Indicator', onClick: ->(action) do
11
+ template.thumbnail title: 'Submit Indicator', onClick: ->(action) do
12
12
  action.windows_open url: json_ui_garage_url(path: 'forms/submit_indicator')
13
13
  end
14
- row.thumbnail title: 'Floating Submit', onClick: ->(action) do
14
+ template.thumbnail title: 'Floating Submit', onClick: ->(action) do
15
15
  action.windows_open url: json_ui_garage_url(path: 'forms/floating_submit')
16
16
  end
17
- row.thumbnail title: 'File Upload', onClick: ->(action) do
17
+ template.thumbnail title: 'File Upload', onClick: ->(action) do
18
18
  action.windows_open url: json_ui_garage_url(path: 'forms/file_upload')
19
19
  end
20
20
  end
@@ -1,7 +1,5 @@
1
1
  json.title 'Forms'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
3
  options = {
6
4
  url: json_ui_garage_url(path: 'forms/submit_indicator_post'),
7
5
  method: 'post',
@@ -9,6 +7,8 @@ options = {
9
7
  }
10
8
 
11
9
  json_ui_page json do |page|
10
+ render "#{@path_prefix}/nav_menu", json: json, page: page
11
+
12
12
  page.form options.merge(childViews: ->(form) do
13
13
  form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
14
14
  form.panels_split width: 'matchParent', rightViews: ->(split) do
@@ -16,27 +16,3 @@ json_ui_page json do |page|
16
16
  end
17
17
  end)
18
18
  end
19
-
20
- # json_body_with_form json, nil, nil, options do
21
- # json.child! do
22
- # json.view 'fields/text-v1'
23
- # json.name 'user[name]'
24
- # json.width 'matchParent'
25
- # json.label 'Name'
26
- # end
27
-
28
- # json.child! do
29
- # json.view 'panels/split-v1'
30
- # json.width 'matchParent'
31
-
32
- # json.content do
33
- # json.right do
34
- # json.view 'button-v1'
35
- # json.text 'Submit'
36
- # json.onClick do
37
- # json.action 'forms/submit-v1'
38
- # end
39
- # end
40
- # end
41
- # end
42
- # end
@@ -1,26 +1,26 @@
1
1
  json.title 'Home'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
6
  page.list firstSection: ->(section) do
7
- section.rows do |row|
8
- row.thumbnail title: 'Pages', onClick: ->(action) do
7
+ section.rows builder: ->(template) do
8
+ template.thumbnail title: 'Pages', onClick: ->(action) do
9
9
  action.windows_open url: json_ui_garage_url(path: 'pages/index')
10
10
  end
11
- row.thumbnail title: 'Lists', onClick: ->(action) do
11
+ template.thumbnail title: 'Lists', onClick: ->(action) do
12
12
  action.windows_open url: json_ui_garage_url(path: 'lists/index')
13
13
  end
14
- row.thumbnail title: 'Forms', onClick: ->(action) do
14
+ template.thumbnail title: 'Forms', onClick: ->(action) do
15
15
  action.windows_open url: json_ui_garage_url(path: 'forms/index')
16
16
  end
17
- row.thumbnail title: 'Panels', onClick: ->(action) do
17
+ template.thumbnail title: 'Panels', onClick: ->(action) do
18
18
  action.windows_open url: json_ui_garage_url(path: 'panels/index')
19
19
  end
20
- row.thumbnail title: 'Views', onClick: ->(action) do
20
+ template.thumbnail title: 'Views', onClick: ->(action) do
21
21
  action.windows_open url: json_ui_garage_url(path: 'views/index')
22
22
  end
23
- row.thumbnail title: 'Actions', onClick: ->(action) do
23
+ template.thumbnail title: 'Actions', onClick: ->(action) do
24
24
  action.windows_open url: json_ui_garage_url(path: 'actions/index')
25
25
  end
26
26
  end
@@ -1,39 +1,17 @@
1
1
  json.title 'Lists'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
6
  page.list firstSection: ->(section) do
7
- section.rows do |row|
8
- row.thumbnail title: 'Templating', onClick: ->(action) do
7
+ section.rows builder: ->(template) do
8
+ template.thumbnail title: 'Templating', onClick: ->(action) do
9
9
  action.windows_open url: json_ui_garage_url(path: 'lists/templating')
10
10
  end
11
- row.thumbnail title: 'Infinite Scroll', onClick: ->(action) do
11
+ template.thumbnail title: 'Infinite Scroll', onClick: ->(action) do
12
12
  action.windows_open url: json_ui_garage_url(path: 'lists/infinite_scroll')
13
13
  end
14
14
  end
15
15
 
16
16
  end
17
17
  end
18
-
19
- # json_body_with_list json do
20
- # json.rows do
21
- # json.child! do
22
- # json.template 'thumbnail-v1'
23
- # json.title 'Templating'
24
- # json.onClick do
25
- # json.action 'windows/open-v1'
26
- # json.url json_ui_garage_url(path: 'lists/templating')
27
- # end
28
- # end
29
-
30
- # json.child! do
31
- # json.template 'thumbnail-v1'
32
- # json.title 'Infinite Scroll'
33
- # json.onClick do
34
- # json.action 'windows/open-v1'
35
- # json.url json_ui_garage_url(path: 'lists/infinite_scroll')
36
- # end
37
- # end
38
- # end
39
- # end
@@ -1,7 +1,7 @@
1
1
 
2
- page = params[:page].to_i
3
- nextPage = {
4
- url: json_ui_garage_url(path: 'lists/infinite_scroll', page: page + 1, section_only: 'v1'),
2
+ page_index = params[:page].to_i
3
+ next_page = {
4
+ url: json_ui_garage_url(path: 'lists/infinite_scroll', page: page_index + 1, section_only: 'v1'),
5
5
  autoLoad: true
6
6
  }
7
7
 
@@ -9,19 +9,26 @@ nextPage = {
9
9
  # - for SEO: one URL for a standalone page and one URL for pagination only
10
10
  # - for generic approach, e.g. excluding nav_menu when there is no change
11
11
  if params[:section_only].present?
12
- json.nextPage nextPage
12
+ json.nextPage next_page
13
13
  json.sections do
14
14
  json.child! do
15
- render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
15
+ render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page_index
16
16
  end
17
17
  end
18
18
  else
19
19
  json.title 'Lists'
20
20
 
21
- render "#{@path_prefix}/nav_menu", json: json
22
-
23
- options = { nextPage: nextPage }
24
- json_body_with_list json, nil, nil, options do
25
- render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
21
+ # options = { nextPage: nextPage }
22
+ # json_body_with_list json, nil, nil, options do
23
+ # render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page
24
+ # end
25
+
26
+ json_ui_page json do |page|
27
+ render "#{@path_prefix}/nav_menu", json: json, page: page
28
+
29
+ page.list nextPage: next_page, firstSection: ->(section) do
30
+ render 'json_ui/garage/lists/infinite_scroll_section', json: json, page: page_index
31
+ end
26
32
  end
33
+
27
34
  end
@@ -1,62 +1,20 @@
1
1
  json.title 'Lists'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
6
  page.list firstSection: ->(section) do
7
7
  section.header(padding: { top: 12, left: 16, right: 16, bottom: 12 }) do |header|
8
8
  header.label text: 'Section Header'
9
9
  end
10
10
 
11
- section.rows do |row|
12
- row.thumbnail title: 'Click me', onClick: ->(action) do
11
+ section.rows builder: ->(template) do
12
+ template.thumbnail title: 'Click me', onClick: ->(action) do
13
13
  action.dialogs_alert message: 'Perform action'
14
14
  end
15
- row.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
16
- row.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle', imageUrl: @sample_image_url
17
- row.featured title: 'Item with subtitle', subtitle: 'Item subtitle', imageUrl: @sample_image_url
15
+ template.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
16
+ template.thumbnail title: 'Item with thumbnail image', subtitle: 'Item subtitle', imageUrl: @sample_image_url
17
+ template.featured title: 'Featured with featured image', subtitle: 'Item subtitle', imageUrl: @sample_image_url
18
18
  end
19
19
  end
20
20
  end
21
-
22
- # json_body_with_list json do
23
- # json.header do
24
- # json.subviews do
25
- # json.child! do
26
- # json.view 'label-v1'
27
- # json.text 'Section Header'
28
- # end
29
- # end
30
- # end
31
-
32
- # json.rows do
33
- # json.child! do
34
- # json.template 'thumbnail-v1'
35
- # json.title 'Click me'
36
- # json.onClick do
37
- # json.action 'dialogs/alert-v1'
38
- # json.message 'Perform action'
39
- # end
40
- # end
41
-
42
- # json.child! do
43
- # json.template 'thumbnail-v1'
44
- # json.title 'Item with subtitle'
45
- # json.subtitle 'Item subtitle'
46
- # end
47
-
48
- # json.child! do
49
- # json.template 'thumbnail-v1'
50
- # json.title 'Item with thumbnail image'
51
- # json.subtitle 'Item subtitle'
52
- # json.imageUrl @sample_image_url
53
- # end
54
-
55
- # json.child! do
56
- # json.template 'featured-v1'
57
- # json.title 'Featured with featured image'
58
- # json.subtitle 'Item subtitle'
59
- # json.imageUrl @sample_image_url
60
- # end
61
- # end
62
- # end
@@ -1,53 +1,61 @@
1
1
  json.title 'Pages'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
- json.header do
6
- json.padding(left: 20, right: 20, top: 5, bottom: 5)
7
- json.backgroundColor '#b3bac2'
8
- json.subviews do
9
- json.child! do
10
- json.view 'h1-v1'
11
- json.text 'Header'
12
- end
13
- end
14
- end
3
+ # json.header do
4
+ # render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ # json.padding(left: 20, right: 20, top: 5, bottom: 5)
7
+ # json.backgroundColor '#b3bac2'
8
+ # json.subviews do
9
+ # json.child! do
10
+ # json.view 'h1-v1'
11
+ # json.text 'Header'
12
+ # end
13
+ # end
14
+ # end
15
15
 
16
- json.content do
17
- json.height 'matchParent'
18
- json.padding(top: 15, left: 20, right: 20, bottom: 15)
19
- json.subviews do
20
- json.child! do
21
- json.view 'button-v1'
22
- json.width 'matchParent'
23
- json.height 'matchParent'
24
- json.text 'Full Width/Height'
25
- end
26
- end
27
- end
16
+ # json.content do
17
+ # json.height 'matchParent'
18
+ # json.padding(top: 15, left: 20, right: 20, bottom: 15)
19
+ # json.subviews do
20
+ # json.child! do
21
+ # json.view 'button-v1'
22
+ # json.width 'matchParent'
23
+ # json.height 'matchParent'
24
+ # json.text 'Full Width/Height'
25
+ # end
26
+ # end
27
+ # end
28
28
 
29
- json.footer do
30
- json.height 80
31
- json.padding(left: 20, right: 20, top: 5, bottom: 5)
32
- json.backgroundColor '#b3bac2'
33
- json.subviews do
34
- json.child! do
35
- json.view 'h1-v1'
36
- json.text 'Footer'
37
- end
38
- end
39
- end
29
+ # json.footer do
30
+ # json.height 80
31
+ # json.padding(left: 20, right: 20, top: 5, bottom: 5)
32
+ # json.backgroundColor '#b3bac2'
33
+ # json.subviews do
34
+ # json.child! do
35
+ # json.view 'h1-v1'
36
+ # json.text 'Footer'
37
+ # end
38
+ # end
39
+ # end
40
40
 
41
41
  json_ui_page json do |page|
42
+ render "#{@path_prefix}/nav_menu", json: json, page: page
43
+
42
44
  page.header padding: {top: 12, left: 20, right: 20, bottom: 12}, backgroundColor: '#b3bac2', childViews: ->(header) do
43
45
  header.h1 text: 'Header'
44
46
  end
45
47
 
48
+ page.body height: 'matchParent', padding: {top: 15, left: 20, right: 20, bottom: 15}, childViews: ->(body) do
49
+ body.panels_scroll width: 'matchParent', height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
50
+ scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
51
+ end
52
+ end
53
+
46
54
  page.footer height: 80, padding: {top: 12, left: 20, right: 20, bottom: 12}, backgroundColor: '#b3bac2', childViews: ->(footer) do
47
55
  footer.h1 text: 'Footer'
48
56
  end
49
57
 
50
- page.scroll height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
51
- scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
52
- end
58
+ # page.scroll height: 'matchParent', padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
59
+ # scroll.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
60
+ # end
53
61
  end
@@ -1,56 +1,23 @@
1
1
  json.title 'Pages'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
- # json_body_with_list json do
6
- # json.rows do
7
- # json.child! do
8
- # json.template 'thumbnail-v1'
9
- # json.title 'Nav Buttons'
10
- # json.onClick do
11
- # json.action 'windows/open-v1'
12
- # json.url json_ui_garage_url(path: 'pages/nav_buttons')
13
- # end
14
- # end
15
-
16
- # json.child! do
17
- # json.template 'thumbnail-v1'
18
- # json.title 'Hamburger Layout'
19
- # json.onClick do
20
- # json.action 'windows/open-v1'
21
- # json.url json_ui_garage_url(path: 'pages/layout')
22
- # end
23
- # end
24
-
25
- # json.child! do
26
- # json.template 'thumbnail-v1'
27
- # json.title 'Full Width/Height'
28
- # json.onClick do
29
- # json.action 'windows/open-v1'
30
- # json.url json_ui_garage_url(path: 'pages/full_width_height')
31
- # end
32
- # end
33
-
34
- # end
35
- # end
36
-
37
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
38
5
 
39
6
  page.list firstSection: ->(section) do
40
- section.rows do |row|
41
- row.thumbnail title: 'Nav Buttons', onClick: ->(action) do
7
+ section.rows builder: ->(template) do
8
+ template.thumbnail title: 'Nav Buttons', onClick: ->(action) do
42
9
  action.windows_open url: json_ui_garage_url(path: 'pages/nav_buttons')
43
10
  end
44
11
 
45
- row.thumbnail title: 'Hamburger Layout', onClick: ->(action) do
12
+ template.thumbnail title: 'Hamburger Layout', onClick: ->(action) do
46
13
  action.windows_open url: json_ui_garage_url(path: 'pages/layout')
47
14
  end
48
15
 
49
- row.thumbnail title: 'Full Width/Height', onClick: ->(action) do
16
+ template.thumbnail title: 'Full Width/Height', onClick: ->(action) do
50
17
  action.windows_open url: json_ui_garage_url(path: 'pages/full_width_height')
51
18
  end
52
19
 
53
- row.thumbnail title: 'Tab Bar', onClick: ->(action) do
20
+ template.thumbnail title: 'Tab Bar', onClick: ->(action) do
54
21
  action.windows_open url: json_ui_garage_url(path: 'pages/tab_bar')
55
22
  end
56
23
  end
@@ -1,40 +1,8 @@
1
1
  json.title 'Pages'
2
2
 
3
- render "#{@path_prefix}/nav_menu", json: json
4
-
5
- # header = Jbuilder.new do |json|
6
- # json.padding(top: 12, left: 20, right: 20, bottom: 12)
7
- # json.backgroundColor '#b3bac2'
8
- # json.subviews do
9
- # json.child! do
10
- # json.view 'h1-v1'
11
- # json.text 'Header'
12
- # end
13
- # end
14
- # end
15
-
16
- # footer = Jbuilder.new do |json|
17
- # json.padding(top: 12, left: 20, right: 20, bottom: 12)
18
- # json.backgroundColor '#b3bac2'
19
- # json.subviews do
20
- # json.child! do
21
- # json.view 'h1-v1'
22
- # json.text 'Footer'
23
- # end
24
- # end
25
- # end
26
-
27
- # options = {padding: {top: 20, left: 20, right: 20, bottom: 20}}
28
- # json_body_with_scroll json, header, footer, options do
29
- # (1..100).each do |index|
30
- # json.child! do
31
- # json.view 'label-v1'
32
- # json.text 'Content'
33
- # end
34
- # end
35
- # end
36
-
37
3
  json_ui_page json do |page|
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
38
6
  page.header padding: {top: 12, left: 20, right: 20, bottom: 12}, backgroundColor: '#b3bac2', childViews: ->(header) do
39
7
  header.h1 text: 'Header'
40
8
  end