active_material 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_material/font_loader.rb +16 -2
- data/lib/active_material/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0befeef9159040b47e03da4f2d258451c580a0d9ab33b2e0c10e249e8a7ac556
|
4
|
+
data.tar.gz: 550bc54c62434b4c81b1156a7d402283f22e497051b4d47a660ae5631be40790
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0d4ed26ce6857b0837e759b8113e3a6f598a80b6880b79669d9303fdf3f8d320366f2618048ebead4452c0c27cf09490c704c3a0d7fa89edce07c93bcf3a2d6
|
7
|
+
data.tar.gz: 9174bfa663d0b9ae7718de7558883adc9ff8df4c82dc7195e1fa0ee7c1b5fa5dfd3e95e42c25cf872d2a75092ac4f9594614b856b067798291c3ef9d46b999e3
|
@@ -3,10 +3,24 @@ module ActiveMaterial
|
|
3
3
|
def build_active_admin_head
|
4
4
|
within super do
|
5
5
|
uri = URI.parse(ActiveMaterial::Rails::Engine.config.active_material.font_url)
|
6
|
-
|
7
|
-
|
6
|
+
origin = extract_origin(uri)
|
7
|
+
|
8
|
+
link(rel: "preconnect", href: origin)
|
9
|
+
link(rel: "preconnect", href: origin, crossorigin: true)
|
8
10
|
link(rel: "stylesheet", href: uri.to_s)
|
9
11
|
end
|
10
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def extract_origin(uri)
|
17
|
+
origin = "#{uri.scheme}://#{uri.host}"
|
18
|
+
origin += ":#{uri.port}" if uri.port && !default_port?(uri)
|
19
|
+
origin
|
20
|
+
end
|
21
|
+
|
22
|
+
def default_port?(uri)
|
23
|
+
(uri.scheme == 'http' && uri.port == 80) || (uri.scheme == 'https' && uri.port == 443)
|
24
|
+
end
|
11
25
|
end
|
12
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_material
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Kniffin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|