blacklight 7.20.0 → 7.20.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 514bb2df051f28fda2f7b1a2f4b309bd20cf79843dbaa74b519232543f36bc70
4
- data.tar.gz: 0bbb3de22863a1e3b9e0aa55d0b9e501550f955fcc2630685e78572b7baf3d05
3
+ metadata.gz: ee4c46b8533bb359a6619ef6dddd96b4de1449b4bfc96db65a357469bebc7cc1
4
+ data.tar.gz: 9eecbab00d1484a3e417bd60245479fc58d6bd9c41a7b16be91d3cef056846a2
5
5
  SHA512:
6
- metadata.gz: c8a023e934c9d2b1365f71104047b53d60d51073f53fecf80d8e159a66edf9dbb5148db8be095b522d04e9d5939cf623fe824fa9607bfc6ed123c3e5cb08dfb7
7
- data.tar.gz: e04a8a63ca946e9d31696ecc76c8da4fca3495687174dba352f613f64388a7802df446d2c902507d99f767b163acea71d2dd021f90f60f2aebe97ae8b115e0d4
6
+ metadata.gz: 97d968403618ee1d25fac527cea64467e3be78040e0d58e8d672463b94c22f272ff7b30fec66af576084bf2a9e8d169a7d3bec9b58b0d1187bb8ffc5bdab2f21
7
+ data.tar.gz: 31855c12d2d58eb7863aa90a4b60c106d208b302460bd0f263fdd32baf8d6025f94025cdf953c82a42220a403c2d0eeae367e7729c7f714f8bc19d23bb561974
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.20.0
1
+ 7.20.1
@@ -38,6 +38,7 @@ Blacklight.listeners().forEach(function (listener) {
38
38
  });
39
39
  Blacklight.onLoad(function () {
40
40
  const elem = document.querySelector('.no-js');
41
+ if (!elem) return;
41
42
  elem.classList.remove('no-js');
42
43
  elem.classList.add('js');
43
44
  });
@@ -450,7 +451,11 @@ Blacklight.doSearchContextBehavior = function () {
450
451
  Blacklight.handleSearchContextMethod.call(e.currentTarget, e);
451
452
  });
452
453
  });
453
- }; // this is the Rails.handleMethod with a couple adjustments, described inline:
454
+ };
455
+
456
+ Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content;
457
+
458
+ Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content; // this is the Rails.handleMethod with a couple adjustments, described inline:
454
459
  // first, we're attaching this directly to the event handler, so we can check for meta-keys
455
460
 
456
461
 
@@ -464,8 +469,8 @@ Blacklight.handleSearchContextMethod = function (event) {
464
469
 
465
470
  let href = link.getAttribute('data-context-href');
466
471
  let target = link.getAttribute('target');
467
- let csrfToken = document.querySelector('meta[name=csrf-token]')?.content
468
- let csrfParam = document.querySelector('meta[name=csrf-param]')?.content
472
+ let csrfToken = Blacklight.csrfToken();
473
+ let csrfParam = Blacklight.csrfParam();
469
474
  let form = document.createElement('form');
470
475
  form.method = 'post';
471
476
  form.action = href;
@@ -39,7 +39,10 @@ Blacklight.listeners().forEach(function(listener) {
39
39
  })
40
40
 
41
41
  Blacklight.onLoad(function () {
42
- const elem = document.querySelector('.no-js')
42
+ const elem = document.querySelector('.no-js');
43
+
44
+ if (!elem) return;
45
+
43
46
  elem.classList.remove('no-js')
44
47
  elem.classList.add('js')
45
48
  })
data/blacklight.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.add_dependency "deprecation"
33
33
  s.add_dependency "i18n", '>= 1.7.0' # added named parameters
34
34
  s.add_dependency "ostruct", '>= 0.3.2'
35
- s.add_dependency "view_component", '~> 2.42.0'
35
+ s.add_dependency "view_component", '~> 2.42'
36
36
 
37
37
  s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
38
38
  s.add_development_dependency "rspec-rails", "~> 4.0.0.beta2"
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-frontend",
3
- "version": "7.20.0",
3
+ "version": "7.20.1",
4
4
  "description": "[![Build Status](https://travis-ci.com/projectblacklight/blacklight.png?branch=master)](https://travis-ci.com/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Coverage Status](https://coveralls.io/repos/github/projectblacklight/blacklight/badge.svg?branch=master)](https://coveralls.io/github/projectblacklight/blacklight?branch=master)",
5
5
  "main": "app/assets/javascripts/blacklight",
6
6
  "scripts": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.20.0
4
+ version: 7.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2021-11-01 00:00:00.000000000 Z
20
+ date: 2021-11-02 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -129,14 +129,14 @@ dependencies:
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 2.42.0
132
+ version: '2.42'
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 2.42.0
139
+ version: '2.42'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: rsolr
142
142
  requirement: !ruby/object:Gem::Requirement
@@ -933,7 +933,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
933
933
  - !ruby/object:Gem::Version
934
934
  version: '0'
935
935
  requirements: []
936
- rubygems_version: 3.1.2
936
+ rubygems_version: 3.1.4
937
937
  signing_key:
938
938
  specification_version: 4
939
939
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)