betterplace-content 0.7.110 → 0.7.113

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/_layouts/default.html +27 -9
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af1e4ab569a623ebc5f176034173046e62466abf446490e4eb8a89e8a129692b
4
- data.tar.gz: 17cbee4e700bdfc8ef850365bca8452c04b98ad5aef702ecfd0dcc899c311b06
3
+ metadata.gz: ce3b385ede297a78abda000a636b83b46b76b0d325bbdbfe89def175e6b82ce0
4
+ data.tar.gz: 6926abc0e908ec56e63673546ed71c340fdcac65e8c831b68cc15ac4477485f4
5
5
  SHA512:
6
- metadata.gz: ebcbdbd9a8564d079ef365265708fac8ce705216089f84a8f3d272068dd23f00f77e2fccf6b1acbf3e44a8a79a81014e6ca032a079108200579bd38a0daf9f1e
7
- data.tar.gz: 75835f1a67dfad949cbcbc5f282648fee444e96155b0ad9aec2988b052f7b425c395596b1590028121c2673a96df7c5ccee1f97a85dd35732bec17974612a593
6
+ metadata.gz: 14ee258b0076621c43874dc8a141b237b4ae3c195a32e64ebf3b99a3e69a0ff2faa139355300d7ff1821016a31b2a1d6ca9fa2fbb2d3849b5ece7f9ca408eafc
7
+ data.tar.gz: db46b151b18598ab65eb273097866461119cf8b4ecf0817d86cc57508eb7e8f1f935c32dcb468d3bee77cf6b7a21bc139e78f716566dd79cf8a38a24eb7d9221
data/README.md CHANGED
@@ -22,7 +22,7 @@ And then execute:
22
22
 
23
23
  ## Development
24
24
 
25
- To set up your environment to develop this theme, run the `script/bootstrap` script. Note that
25
+ To set up your environment to develop this theme, run the [`script/bootstrap`](script/bootstrap) script. Note that
26
26
  this will check out **all** betterplace content repositories and install their bundles.
27
27
 
28
28
  The installation script will ask you for a personal github access token with repo access.
@@ -56,7 +56,7 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
56
56
  <link rel="stylesheet" href="{{ style_host }}{{ site.baseurl }}{{ site._options.content.styles }}" />
57
57
  {% endif %}
58
58
 
59
- <link rel="stylesheet" href="{{ style_host }}/de/layouts/current_stylesheet/utils" />
59
+ <link rel="stylesheet" href="{{ style_host }}/de/layouts/current_stylesheet/application" />
60
60
 
61
61
  <link rel="shortcut icon" href="https://betterplace-assets.betterplace.org/static-images/logos/favicon.png" />
62
62
 
@@ -110,11 +110,7 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
110
110
 
111
111
  </div>
112
112
 
113
- <script src="{{ style_host }}/de/layouts/current_pack/utils"></script>
114
- <script src="{{ style_host }}/de/layouts/current_pack/locale_{{ site.lang }}"></script>
115
- <script src="{{ style_host }}/de/layouts/current_pack/homepage"></script>
116
113
  <script>
117
- // Make sure we can test the Rails-staging CSS on jekyll-staging.
118
114
  {% comment -%}
119
115
  // For Staging: Simulate the environment by replacing the URLs.
120
116
  // For Development: This does nothing, unless you force `JEKYLL_ENV=production`.
@@ -126,18 +122,40 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
126
122
  // app.cloudcannon.com, proxy.cloudcannon.com: do nothing
127
123
  // www.bp42.com: replace
128
124
  {% endcomment -%}
129
- const prd = window.location.hostname.indexOf('.org') !== -1
130
- const dev = window.location.hostname.indexOf('.dev') !== -1
131
- const edit = window.location.hostname.indexOf('.cloud') !== -1
132
- if (!prd && !dev && !edit) {
125
+
126
+ const replaceHost = () => {
127
+ if (!/\.(?:org|dev|cloud)/.test(window.location.hostname)) return
128
+
133
129
  document.querySelectorAll("[href]").forEach(element => {
134
130
  if (element.href.includes('www.betterplace.org')) {
135
131
  element.href = element.href.replace('www.betterplace.org', window.location.hostname)
136
132
  element.setAttribute('data-host-replaced', 'true')
137
133
  }
138
134
  })
135
+
136
+ {% comment -%}
137
+ // Some URLs in the header files are stored in data attributes for use in React.
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
+ {% endcomment -%}
141
+ ;['data-login-url', 'data-login-check-url', 'data-search-url'].forEach(dataAttr => {
142
+ document.querySelectorAll("[" + dataAttr + "]").forEach(element => {
143
+ const modifiedUrl = element.getAttribute(dataAttr).replace('www.betterplace.org', window.location.hostname)
144
+ element.setAttribute(dataAttr, modifiedUrl)
145
+ element.setAttribute('data-host-replaced', 'true')
146
+ })
147
+ })
139
148
  }
149
+
150
+ document.addEventListener('DOMContentLoaded', replaceHost)
140
151
  </script>
141
152
 
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>
159
+
142
160
  </body>
143
161
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betterplace-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.110
4
+ version: 0.7.113
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace.org Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  - !ruby/object:Gem::Version
218
218
  version: '0'
219
219
  requirements: []
220
- rubygems_version: 3.3.5
220
+ rubygems_version: 3.3.15
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: betterplace.org's Jekyll Content Theme