betterplace-content 0.7.112 → 0.7.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_layouts/default.html +15 -10
- 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: ce3b385ede297a78abda000a636b83b46b76b0d325bbdbfe89def175e6b82ce0
|
|
4
|
+
data.tar.gz: 6926abc0e908ec56e63673546ed71c340fdcac65e8c831b68cc15ac4477485f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14ee258b0076621c43874dc8a141b237b4ae3c195a32e64ebf3b99a3e69a0ff2faa139355300d7ff1821016a31b2a1d6ca9fa2fbb2d3849b5ece7f9ca408eafc
|
|
7
|
+
data.tar.gz: db46b151b18598ab65eb273097866461119cf8b4ecf0817d86cc57508eb7e8f1f935c32dcb468d3bee77cf6b7a21bc139e78f716566dd79cf8a38a24eb7d9221
|
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,20 +136,26 @@ 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
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
{% comment -%}
|
|
154
|
+
// These scripts must be loaded AFTER the DOMContentLoaded listener above is defined.
|
|
155
|
+
{% endcomment -%}
|
|
156
|
+
<script src="https://betterplace.dev/de/layouts/current_pack/application"></script>
|
|
157
|
+
<script src="https://betterplace.dev/de/layouts/current_pack/locale_{{ site.lang }}"></script>
|
|
158
|
+
<script src="https://betterplace.dev/de/layouts/current_pack/homepage"></script>
|
|
154
159
|
|
|
155
160
|
</body>
|
|
156
161
|
</html>
|