betterplace-content 0.7.112 → 0.7.115
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_layouts/default.html +12 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 635e38ae2266d1885d8621b6d69f0bd78a45581d1a95505b4315ddc9c3483317
|
4
|
+
data.tar.gz: d5887fc99523b488835aae75f6272e468dbcb8c9378b1f39640e1efc8e4a1268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9dcc5bbae5dc82bd7edf9414155abfbd827cdd9411233733cb0b5ce69e17038321b045300fe7ad0c06170f229335342b7edbf0da4dc9b1edae201809dbd87db
|
7
|
+
data.tar.gz: dee07c5f339f2b7371f279398b58d8a57bd99bb450acecef2f19f0888789079758837b25adf8c562bc028508152aaf206539352b324f10b459f437d985a2230c
|
data/_layouts/default.html
CHANGED
@@ -111,7 +111,6 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
|
|
111
111
|
</div>
|
112
112
|
|
113
113
|
<script>
|
114
|
-
// Make sure we can test the Rails-staging CSS on jekyll-staging.
|
115
114
|
{% comment -%}
|
116
115
|
// For Staging: Simulate the environment by replacing the URLs.
|
117
116
|
// For Development: This does nothing, unless you force `JEKYLL_ENV=production`.
|
@@ -123,10 +122,10 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
|
|
123
122
|
// app.cloudcannon.com, proxy.cloudcannon.com: do nothing
|
124
123
|
// www.bp42.com: replace
|
125
124
|
{% endcomment -%}
|
126
|
-
|
127
|
-
const
|
128
|
-
|
129
|
-
|
125
|
+
|
126
|
+
const replaceHost = () => {
|
127
|
+
if (/\.(?:org|dev|cloud)/.test(window.location.hostname)) return
|
128
|
+
|
130
129
|
document.querySelectorAll("[href]").forEach(element => {
|
131
130
|
if (element.href.includes('www.betterplace.org')) {
|
132
131
|
element.href = element.href.replace('www.betterplace.org', window.location.hostname)
|
@@ -137,17 +136,23 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
|
|
137
136
|
{% comment -%}
|
138
137
|
// Some URLs in the header files are stored in data attributes for use in React.
|
139
138
|
// These cases can be found by searching for /data[^'"]*['"]http/ in this repo.
|
139
|
+
// The preceding semicolon is required in browser JS land ;)
|
140
140
|
{% endcomment -%}
|
141
|
-
['data-login-url', 'data-login-check-url', 'data-search-url'].forEach(dataAttr => {
|
142
|
-
document.querySelectorAll("["+ dataAttr + "]").forEach(element => {
|
141
|
+
;['data-login-url', 'data-login-check-url', 'data-search-url'].forEach(dataAttr => {
|
142
|
+
document.querySelectorAll("[" + dataAttr + "]").forEach(element => {
|
143
143
|
const modifiedUrl = element.getAttribute(dataAttr).replace('www.betterplace.org', window.location.hostname)
|
144
144
|
element.setAttribute(dataAttr, modifiedUrl)
|
145
145
|
element.setAttribute('data-host-replaced', 'true')
|
146
146
|
})
|
147
147
|
})
|
148
148
|
}
|
149
|
+
|
150
|
+
document.addEventListener('DOMContentLoaded', replaceHost)
|
149
151
|
</script>
|
150
152
|
|
153
|
+
{% comment -%}
|
154
|
+
// These scripts must be loaded AFTER the DOMContentLoaded listener above is defined.
|
155
|
+
{% endcomment -%}
|
151
156
|
<script src="{{ style_host }}/de/layouts/current_pack/application"></script>
|
152
157
|
<script src="{{ style_host }}/de/layouts/current_pack/locale_{{ site.lang }}"></script>
|
153
158
|
<script src="{{ style_host }}/de/layouts/current_pack/homepage"></script>
|