glib-web 0.5.2 → 0.5.3

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: 030e8fab91840b4a4337ebb8e867f56b9b658ec8932716afae41f1ebb84f93ee
4
- data.tar.gz: 1dc8364b2e509891eeed48c55f4aa8f9d8c89c3b9dad8dc700720d14e2b55e15
3
+ metadata.gz: 8472590ad38171de55b2e30bd3f37cceb15987354bc55ec7a1f892bd597d349f
4
+ data.tar.gz: eb88de5c1b0e2a85f51e70270735245f96af992085a7749f4afe54ee7a98377c
5
5
  SHA512:
6
- metadata.gz: c94b19ff196e16ed430d973f295b64a4aa92e4a89f685e74731e5ecadb0a23a3ea39ab7aafe049e7bff46ffadb4d67f59d9a6b1791613cffcf63f66df611e806
7
- data.tar.gz: 9175751c633b836d10cfc4aa67d4af2e4e7ea8b837a99dfc34bf6fe91efc3ddf932a1aa227d13097cfbdb5aaab63ca9ecdd14fd3410a114e926c2896e36c6df0
6
+ metadata.gz: 46f2e0c0c52abf0c9f6e48fd8b9a42183108494c76b6849300482a97449acadb17ccb3603727641871478ed09f3b4192cd676d7e69a85f6f0bae76456108f136
7
+ data.tar.gz: 2777afc7ab675a44a67824514bef69d1afada4b4fd608136f485e6333cd5e464c9bceae3a50582a3611f0753ae5df31d85457c25f316fb2ad184ce7f7469aa2f
@@ -41,6 +41,11 @@ module Glib
41
41
 
42
42
  class Custom < Thumbnail
43
43
  string :template
44
+
45
+ # TODO: Experimental
46
+ hash :extra
47
+
48
+ # TODO: Deprecate
44
49
  hash :data
45
50
  end
46
51
  end
@@ -17,22 +17,27 @@ module Glib
17
17
  @__json_ui_page
18
18
  end
19
19
 
20
- # Use this only if you need to generate json independently from the current `json_ui_page`
21
- def json_ui_menu(&block)
22
- @__json_ui_menu_page ||= Page.new(Jbuilder.new, self)
23
- json = @__json_ui_menu_page.json
24
- json.nil!
25
- block&.call @__json_ui_menu_page.menu_builder
26
- json.attributes!
27
- end
28
-
29
- # Use this only if you need to generate json independently from the current `json_ui_page`
30
- def json_ui_panel(&block)
31
- @__json_ui_panel_page ||= Page.new(Jbuilder.new, self)
32
- json = @__json_ui_panel_page.json
33
- json.nil!
34
- block&.call @__json_ui_panel_page.view_builder
35
- json.attributes!
20
+ # # Use this only if you need to generate json independently from the current `json_ui_page`
21
+ # def json_ui_menu(&block)
22
+ # @__json_ui_menu_page ||= Page.new(Jbuilder.new, self)
23
+ # json = @__json_ui_menu_page.json
24
+ # json.nil!
25
+ # block&.call @__json_ui_menu_page.menu_builder
26
+ # json.attributes!
27
+ # end
28
+
29
+ # # Use this only if you need to generate json independently from the current `json_ui_page`
30
+ # def json_ui_panel(&block)
31
+ # @__json_ui_panel_page ||= Page.new(Jbuilder.new, self)
32
+ # json = @__json_ui_panel_page.json
33
+ # json.nil!
34
+ # block&.call @__json_ui_panel_page.view_builder
35
+ # json.attributes!
36
+ # end
37
+
38
+ def json_ui_section(json, &block)
39
+ @__json_ui_section ||= Page.new(json, self)
40
+ @__json_ui_section.list_section_builder
36
41
  end
37
42
 
38
43
  class Page
@@ -81,14 +81,17 @@ section.rows builder: ->(template) do
81
81
  template.thumbnail title: 'dialogs/oauth', onClick: ->(action) do
82
82
  provider = {
83
83
  name: "facebook",
84
- webRequestUrl: "https://www.facebook.com/v3.1/dialog/oauth?auth_type=rerequest&client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Fwww.lvh.me%3A3000%2Foauth_callback%2Ffacebook&response_type=code&scope=email",
85
- requestUrl: "https://www.facebook.com/v3.1/dialog/oauth",
86
- clientId: "CLIENT_ID",
87
- redirectUrl: "http://www.lvh.me:3000/oauth_callback/facebook.json"
84
+ webRequestUrl: user_facebook_omniauth_authorize_url(format: nil, _render: nil),
85
+ requestUrl: user_facebook_omniauth_authorize_url(format: nil),
86
+ clientId: Devise.omniauth_configs[:facebook].strategy[:client_id],
87
+ permissions: Devise.omniauth_configs[:facebook].strategy[:scope],
88
+ redirectUrl: user_facebook_omniauth_callback_url(format: nil)
88
89
  }
89
90
 
90
91
  action.dialogs_oauth provider: provider, providerParamName: "session[oauth_provider]", callbackUrlParamName: "session[[oauth_callback_url]", onSuccess: ->(action) do
91
- action.http_post url: 'TODO: post params to server'
92
+ action.http_post url: json_ui_garage_url(path: 'actions/dialogs_oauth_post'), formData: {
93
+ authenticity_token: form_authenticity_token
94
+ }
92
95
  end
93
96
  end
94
97
 
@@ -0,0 +1,6 @@
1
+ facebook_graph = Koala::Facebook::API.new(params[:credentials][:token])
2
+ profile = facebook_graph.get_object('me')
3
+
4
+ json_ui_response json do |action|
5
+ action.dialogs_alert message: profile
6
+ end
@@ -6,18 +6,33 @@ if page < 2
6
6
  json.nextPageUrl json_ui_garage_url(path: 'forms/dynamic_select_data', page: page + 1)
7
7
  end
8
8
 
9
- json.rows do
9
+ # json.rows do
10
10
 
11
+ # count_per_page = 20
12
+ # count_per_page.times do |i|
13
+ # json.child! do
14
+ # index = page * count_per_page + i
15
+ # json.template 'thumbnail'
16
+ # json.title "City #{index} (#{params[:q]})"
17
+ # json.subtitle "State #{index}"
18
+ # json.subsubtitle "Country #{index}"
19
+ # json.value "id#{index}"
20
+ # json.text "Item #{index}"
21
+ # end
22
+ # end
23
+ # end
24
+
25
+ section = json_ui_section json
26
+ section.rows builder: ->(row) do
11
27
  count_per_page = 20
12
28
  count_per_page.times do |i|
13
- json.child! do
14
- index = page * count_per_page + i
15
- json.template 'thumbnail'
16
- json.title "City #{index} (#{params[:q]})"
17
- json.subtitle "State #{index}"
18
- json.subsubtitle "Country #{index}"
19
- json.value "id#{index}"
20
- json.text "Item #{index}"
21
- end
29
+ index = page * count_per_page + i
30
+ row.custom title: "City #{index} (#{params[:q]})",
31
+ subtitle: "State #{index}",
32
+ subsubtitle: "Country #{index}",
33
+ extra: {
34
+ value: "id#{index}",
35
+ text: "Item #{index}"
36
+ }
22
37
  end
23
38
  end
@@ -8,18 +8,18 @@ options = {
8
8
 
9
9
  json_ui_page json do |page|
10
10
  render "#{@path_prefix}/nav_menu", json: json, page: page
11
-
11
+
12
12
  page.form options.merge(childViews: ->(form) do
13
13
  rules1 = { fileType: "image/*", maxFileSize: 5000 }
14
14
  rules2 = { fileType: "image/*", maxFileSize: 1, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
15
- form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Photo', accepts: rules1, directUploadUrl: rails_direct_uploads_url,
15
+ form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Landscape Photo', accepts: rules1, directUploadUrl: rails_direct_uploads_url,
16
16
  value: 'eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4',
17
17
  fileUrl: 'https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100',
18
18
  fileTitle: '1 month ago',
19
- placeholderView: { type: 'image', width: 100, height: 100 }
19
+ placeholderView: { type: 'image', width: 100, height: 75, url: 'https://www.atms.com.au/wp-content/uploads/2019/10/placeholder-1-1024x683.png?x93630' }
20
20
 
21
- form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Photo', accepts: rules2, directUploadUrl: rails_direct_uploads_url,
22
- placeholderView: { type: 'avatar', width: 100, height: 100 }
21
+ form.fields_file name: 'user[photo][]', width: 'matchParent', label: 'Avatar', accepts: rules2, directUploadUrl: rails_direct_uploads_url,
22
+ placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQED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1C+5o4rLyDq48KIwgCTseNUAsuVx2IGXtJYYCNbDjWqOBJm3Dsg+mRL1CFoiwZcv3itzyDq48KUWWOAEjj+5IONF0PgbcDu+y0ESxQYREQEREBERAREQEREBERARfTGE4BdDGNbiaoNbYUhN3QfdbQy9penJYZMGbsONao4EmbcO3OiAHX6YbUL7uj+6rLyDq48KURpAEjj+5VQC25XHYgbfrhsWGAjWw41R4J1cOFKoMllyo5IGX6lYYCDN2HdHgkzbh2QGvv0NNqF93RWXkGjce1EaQBJ2Pf1QC25UV2IGXtL90WGAjWw71RwJM24dudEBrr9DTasRDLRIn819PIOrj2ojSAJOx7+qD4iWbce60uYRiF0MBGth3qskkmYw/exByIustacBPlRa3QW4TIPGvyQaEW91nl7QWPw53hBpRbhZydo7p5FZFwQaUXSYDRiSshu1rRLf8APFBoZDJwC2CEAZEzO4LbEde1T9FgESkdb67KoPqJo1HKWxfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' }
23
23
 
24
24
  form.fields_submit text: 'Submit'
25
25
  # form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
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.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -114,6 +114,7 @@ files:
114
114
  - app/views/json_ui/garage/actions/_snackbars.json.jbuilder
115
115
  - app/views/json_ui/garage/actions/_timeouts.json.jbuilder
116
116
  - app/views/json_ui/garage/actions/_windows.json.jbuilder
117
+ - app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder
117
118
  - app/views/json_ui/garage/actions/index.json.jbuilder
118
119
  - app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder
119
120
  - app/views/json_ui/garage/forms/basic.json.jbuilder
@@ -234,7 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
235
  - !ruby/object:Gem::Version
235
236
  version: '0'
236
237
  requirements: []
237
- rubygems_version: 3.1.2
238
+ rubyforge_project:
239
+ rubygems_version: 2.7.6
238
240
  signing_key:
239
241
  specification_version: 4
240
242
  summary: ''