glib-web 0.6.10 → 0.6.14

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: caea1800c7d255e83399effe4e38a4231fb7642c43a42112c788c54e5f7d5f6e
4
- data.tar.gz: f9c676108ecdfcbf638c9a3714610514665a8cda37e8b22da87431b681b40769
3
+ metadata.gz: 0c56cc5b0cb3eac25758cb566dcf2b69f10470a65df7fa00d25325db8958961d
4
+ data.tar.gz: 5d2d0bdef7274ec75442b5c8f6a2336463c51f73b07a40905ff5916168eaa349
5
5
  SHA512:
6
- metadata.gz: cb8f985c5765648db0631ed057ce22b6a7b040176e3a2d98dbe6f08d31ad5d62c4eb7bd5ec473ee3c15599bab15f6b4d520e66259d851473cf2cd0585aa13862
7
- data.tar.gz: 61bb69710386e0aa798654efa5714fa87bff71e2206dd852849cc581abbfbf0d14e9bfbc3f607450c9695b0b4571de81d8d29d9abc5e6a8802e59e51b8861fdc
6
+ metadata.gz: fa471dad31b61bd7f6562627ece6574b56e68260d456c3f0b4a5f5b3e2ed344cccb6b682654ec286b1b4761a5bcdc51524cb96729dd8896fbc92adff0f141149
7
+ data.tar.gz: 281c3ceba5a2a22320ff553420d4c0a962e41123a35ebcf868127af880742c6e04cc6b2314413191d62b3cc9f0b71f08a9fd727ef2421f709f7209ea839f77ac
@@ -35,14 +35,26 @@ module Glib::Analytics
35
35
  action = request.headers['GApp-Analytics-Referer-Action']
36
36
  segment = request.headers['GApp-Analytics-Referer-Segment']
37
37
  placement = request.headers['GApp-Analytics-Referer-Placement']
38
-
39
- if group.nil? && action.nil? && !request.headers['referer'].nil?
40
- host = URI.parse(request.headers['referer']).host
41
- if host == request.host || !/^(.*).#{request.host.sub('www','')}/.match(host).nil?
42
-
43
- route = Rails.application.routes.recognize_path(request.headers['referer'].delete_suffix('/'))
44
- group = route[:controller]
45
- action = route[:action]
38
+ referrer_url = request.headers['referer'] # Notice that the HTTP header uses one "r"
39
+ if group.nil? && action.nil? && !referrer_url.nil?
40
+ current_host = request.host
41
+ referrer_host = URI.parse(referrer_url).host
42
+
43
+ # Replace the subdomain portion with regex so it will only match the non-subdomain part.
44
+ # This will allow cross-subdomain referral, but it will not work if the host is a bare domain,
45
+ # which is something that we should avoid doing anyway.
46
+ regex = '^([^\.]*)\.'
47
+ if current_host == referrer_host || !/#{current_host.sub(/#{regex}/, regex)}/.match(referrer_host).nil?
48
+ referrer_url = referrer_url.delete_suffix('/')
49
+
50
+ begin
51
+ route = Rails.application.routes.recognize_path(referrer_url)
52
+ group = route[:controller]
53
+ action = route[:action]
54
+ rescue ActionController::RoutingError
55
+ # Do nothing. This may happen when the referrer is from the same domain,
56
+ # but not from the same Rails app.
57
+ end
46
58
  end
47
59
  end
48
60
 
@@ -54,6 +54,8 @@ module Glib
54
54
  end
55
55
 
56
56
  class Thumbnail < Standard
57
+ menu :leftOuterButtons
58
+ int :imageSize
57
59
  end
58
60
 
59
61
  class CommentOutgoing < Standard
@@ -225,6 +225,8 @@ class Glib::JsonUi::ViewBuilder
225
225
  string :directUploadUrl
226
226
  string :fileUrl
227
227
  string :fileTitle
228
+ string :uploadText
229
+ string :uploadIcon
228
230
  hash :placeholderView
229
231
  end
230
232
 
@@ -35,6 +35,8 @@ module Glib
35
35
  hash :analytics
36
36
  hash :tooltip
37
37
  hash :tour
38
+ array :extensions
39
+
38
40
 
39
41
  # def initialize(json, page)
40
42
  # super(json, page)
@@ -12,7 +12,7 @@ json_ui_page json do |page|
12
12
  template.thumbnail title: 'Click me', onClick: ->(action) do
13
13
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
14
14
  end
15
- template.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
15
+ template.thumbnail title: 'Item with icon and subtitle', subtitle: 'Item subtitle', icon: 'facebook'
16
16
  template.thumbnail title: 'Item with chips', chips: ->(menu) do
17
17
  menu.button text: 'Finished', styleClass: 'info'
18
18
  menu.button props: { text: 'Succeeded', styleClass: 'success' }
@@ -24,6 +24,8 @@ page.table sections: [
24
24
  action.windows_reload url: json_ui_garage_url(path: 'tables/layout', orders: reversed_order_params(order_key))
25
25
  end
26
26
  end
27
+
28
+ header.label text: "Markdown"
27
29
  end
28
30
 
29
31
  items = [1, 2, 3]
@@ -32,8 +34,11 @@ page.table sections: [
32
34
  column_indexes.each do |i|
33
35
  cell.label text: "Data #{item}"
34
36
  end
35
- end, onClick: ->(action) do
36
- action.windows_open url: json_ui_garage_url(path: 'home/blank')
37
+
38
+ markdown = "* [Item 1](#{json_ui_garage_url(path: 'home/blank')})\n"\
39
+ "* Item 2\n"\
40
+ '* Item 3'
41
+ cell.markdown text: markdown
37
42
  end
38
43
  end
39
44
  end
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.6.10
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''