hubssolib 3.0.2 → 3.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 856e89d2f8189bee83fdc33ec1cfea64c19a14e79d16703c434fd88f8502e933
4
- data.tar.gz: 13d52a8023ec552a6756f4dd9f1e89533cd7d5c30b8898028c15b827d4bb5826
3
+ metadata.gz: 891c5bc596ecfdd5f9f1e9b844ac77eaa443426607d55ba16110cc194baca3a8
4
+ data.tar.gz: 42ffee7f098f4c9cbd1eec9e42e2c0f2e10a700ebd85b083113b517cd6706619
5
5
  SHA512:
6
- metadata.gz: a1c68c61d8a3522cf78299a2163d17fbd1627d19bdcc687de54f764bea4ae5b9e295ffeb6d1bceb3a0605d53234121dfa89bf62216710f47aa89bc30b66fb2e8
7
- data.tar.gz: 6bc61f08b7b633d8ba4c11e794a46f69475fad73fa5e94f9ae2a25c7169fb8c778540b717da807c22c1f2063a3f059573e280874f98ca43968945f8c1a9be71d
6
+ metadata.gz: 7d0046239b22405b6e6cf47d3e8e326bcc9f4c88a58ced4b13a3eab14fd822bb16bc63d3b06523a926abda7d46d53a15211000fdd9b7aff7e071ba2b708afd92
7
+ data.tar.gz: 0a1cd9ccaab6b08ae323ad572f3a563fa002c7a2250073cb0b76848f8f2c8879350828664fe37ee9a0590d134a8949dacb4419a54520569a3468d6a5b86eb3da
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## 3.0.2, 04-Feb 2025
1
+ ## 3.0.3, 10-Feb-2025
2
+
3
+ Change JavaScript code used for the login indicator so that simpler engines such as [Duktape](https://duktape.org) can run it. Operates correctly in script-enabled [NetSurf](https://www.netsurf-browser.org) now.
4
+
5
+ ## 3.0.2, 04-Feb-2025
2
6
 
3
7
  Fixes a bug that could cause cookie deletions for login state indication to sometimes fail to work as expected.
4
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubssolib (3.0.2)
4
+ hubssolib (3.0.3)
5
5
  base64 (~> 0.2)
6
6
  drb (~> 2.2)
7
7
 
@@ -29,7 +29,7 @@ GEM
29
29
  psych (5.2.3)
30
30
  date
31
31
  stringio
32
- rdoc (6.11.0)
32
+ rdoc (6.12.0)
33
33
  psych (>= 4.0.0)
34
34
  reline (0.6.0)
35
35
  io-console (~> 0.5)
@@ -37,7 +37,7 @@ GEM
37
37
  rspec-core (~> 3.13.0)
38
38
  rspec-expectations (~> 3.13.0)
39
39
  rspec-mocks (~> 3.13.0)
40
- rspec-core (3.13.2)
40
+ rspec-core (3.13.3)
41
41
  rspec-support (~> 3.13.0)
42
42
  rspec-expectations (3.13.3)
43
43
  diff-lcs (>= 1.2.0, < 2.0)
data/hubssolib.gemspec CHANGED
@@ -4,7 +4,7 @@ spec = Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = 'hubssolib'
6
6
 
7
- s.version = '3.0.2'
7
+ s.version = '3.0.3'
8
8
  s.author = 'Andrew Hodgkinson and others'
9
9
  s.email = 'ahodgkin@rowing.org.uk'
10
10
  s.homepage = 'http://pond.org.uk/'
data/lib/hub_sso_lib.rb CHANGED
@@ -560,9 +560,14 @@ module HubSsoLib
560
560
  const logged_out_html = "#{helpers.j(logged_out_link)}";
561
561
  const container = document.getElementById('hubssolib_login_indication')
562
562
 
563
+ #{
564
+ # No '?.' support in NetSurf's JS engine, so can't do the match
565
+ # and pop in a single line via "?.pop() || ''".
566
+ }
563
567
  function hubSsoLibLoginStateWriteLink() {
564
568
  const regexp = '#{helpers.j(HUB_LOGIN_INDICATOR_COOKIE)}\\s*=\\s*([^;]+)';
565
- const flag = document.cookie.match(regexp)?.pop() || '';
569
+ const match = document.cookie.match(regexp);
570
+ const flag = (match ? match.pop() : null) || '';
566
571
 
567
572
  if (flag === '#{HUB_LOGIN_INDICATOR_COOKIE_VALUE}') {
568
573
  container.innerHTML = logged_in_html;
@@ -576,6 +581,7 @@ module HubSsoLib
576
581
  # login indications should thus arise from cached data.
577
582
  }
578
583
  hubSsoLibLoginStateWriteLink();
584
+ window.addEventListener('load', hubSsoLibLoginStateWriteLink);
579
585
  window.addEventListener('pageshow', hubSsoLibLoginStateWriteLink);
580
586
  </script>
581
587
  HTML
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubssolib
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hodgkinson and others
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-04 00:00:00.000000000 Z
10
+ date: 2025-02-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: drb