blacklight-frontend
Advanced tools
Comparing version 7.10.0 to 7.20.0
@@ -39,3 +39,7 @@ Blacklight = function () { | ||
}); | ||
$('.no-js').removeClass('no-js').addClass('js'); | ||
Blacklight.onLoad(function () { | ||
const elem = document.querySelector('.no-js'); | ||
elem.classList.remove('no-js'); | ||
elem.classList.add('js'); | ||
}); | ||
/*global Bloodhound */ | ||
@@ -103,2 +107,3 @@ | ||
// Safari both do not set focus to a button on button click. | ||
// See https://zellwk.com/blog/inconsistent-button-behavior/ for background information | ||
document.querySelectorAll('button.collapse-toggle').forEach(button => { | ||
@@ -354,4 +359,5 @@ button.addEventListener('click', () => { | ||
Blacklight.modal.onFailure = function (data) { | ||
var contents = '<div class="modal-header">' + '<div class="modal-title">Network Error</div>' + '<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">×</span>' + '</button>'; | ||
Blacklight.modal.onFailure = function (jqXHR, textStatus, errorThrown) { | ||
console.error('Server error:', this.url, jqXHR.status, errorThrown); | ||
var contents = '<div class="modal-header">' + '<div class="modal-title">There was a problem with your request.</div>' + '<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + ' <span aria-hidden="true">×</span>' + '</button></div>' + ' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + '<pre>' + this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + '</pre></div>'; | ||
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents); | ||
@@ -450,3 +456,7 @@ $(Blacklight.modal.modalSelector).modal('show'); | ||
}); | ||
}; // this is the Rails.handleMethod with a couple adjustments, described inline: | ||
}; | ||
Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content; | ||
Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content; // this is the Rails.handleMethod with a couple adjustments, described inline: | ||
// first, we're attaching this directly to the event handler, so we can check for meta-keys | ||
@@ -465,4 +475,4 @@ | ||
let target = link.getAttribute('target'); | ||
let csrfToken = Rails.csrfToken(); | ||
let csrfParam = Rails.csrfParam(); | ||
let csrfToken = Blacklight.csrfToken(); | ||
let csrfParam = Blacklight.csrfParam(); | ||
let form = document.createElement('form'); | ||
@@ -496,3 +506,2 @@ form.method = 'post'; | ||
event.stopPropagation(); | ||
event.stopImmediatePropagation(); | ||
}; | ||
@@ -499,0 +508,0 @@ |
Blacklight.onLoad(function() { | ||
// Button clicks should change focus. As of 10/3/19, Firefox for Mac and | ||
// Safari both do not set focus to a button on button click. | ||
// See https://zellwk.com/blog/inconsistent-button-behavior/ for background information | ||
document.querySelectorAll('button.collapse-toggle').forEach((button) => { | ||
@@ -5,0 +6,0 @@ button.addEventListener('click', () => { |
@@ -41,2 +41,6 @@ Blacklight = function() { | ||
$('.no-js').removeClass('no-js').addClass('js'); | ||
Blacklight.onLoad(function () { | ||
const elem = document.querySelector('.no-js') | ||
elem.classList.remove('no-js') | ||
elem.classList.add('js') | ||
}) |
@@ -104,8 +104,14 @@ /* | ||
// network errors. | ||
Blacklight.modal.onFailure = function(data) { | ||
var contents = '<div class="modal-header">' + | ||
'<div class="modal-title">Network Error</div>' + | ||
'<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="Close">' + | ||
Blacklight.modal.onFailure = function(jqXHR, textStatus, errorThrown) { | ||
console.error('Server error:', this.url, jqXHR.status, errorThrown); | ||
var contents = '<div class="modal-header">' + | ||
'<div class="modal-title">There was a problem with your request.</div>' + | ||
'<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" aria-label="Close">' + | ||
' <span aria-hidden="true">×</span>' + | ||
'</button>'; | ||
'</button></div>' + | ||
' <div class="modal-body"><p>Expected a successful response from the server, but got an error</p>' + | ||
'<pre>' + | ||
this.type + ' ' + this.url + "\n" + jqXHR.status + ': ' + errorThrown + | ||
'</pre></div>'; | ||
$(Blacklight.modal.modalSelector).find('.modal-content').html(contents); | ||
@@ -112,0 +118,0 @@ $(Blacklight.modal.modalSelector).modal('show'); |
@@ -18,2 +18,5 @@ Blacklight.doSearchContextBehavior = function() { | ||
Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content | ||
Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content | ||
// this is the Rails.handleMethod with a couple adjustments, described inline: | ||
@@ -31,4 +34,4 @@ // first, we're attaching this directly to the event handler, so we can check for meta-keys | ||
let target = link.getAttribute('target') | ||
let csrfToken = Rails.csrfToken() | ||
let csrfParam = Rails.csrfParam() | ||
let csrfToken = Blacklight.csrfToken() | ||
let csrfParam = Blacklight.csrfParam() | ||
let form = document.createElement('form') | ||
@@ -64,3 +67,2 @@ form.method = 'post' | ||
event.stopPropagation() | ||
event.stopImmediatePropagation() | ||
}; | ||
@@ -67,0 +69,0 @@ |
{ | ||
"name": "blacklight-frontend", | ||
"version": "7.10.0", | ||
"description": "[![Build Status](https://travis-ci.org/projectblacklight/blacklight.png?branch=master)](https://travis-ci.org/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)", | ||
"version": "7.20.0", | ||
"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)", | ||
"main": "app/assets/javascripts/blacklight", | ||
@@ -13,2 +13,6 @@ "scripts": { | ||
}, | ||
"files": [ | ||
"app/assets", | ||
"app/javascript" | ||
], | ||
"author": "", | ||
@@ -27,3 +31,3 @@ "license": "Apache-2.0", | ||
"bloodhound-js": "^1.2.3", | ||
"bootstrap": "^4.3.1", | ||
"bootstrap": ">=4.3.1 <6.0.0", | ||
"jquery": "^3.5.1", | ||
@@ -30,0 +34,0 @@ "typeahead.js": "^0.11.1" |
# Blacklight | ||
[![Build Status](https://travis-ci.org/projectblacklight/blacklight.png?branch=master)](https://travis-ci.org/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Test Coverage](https://api.codeclimate.com/v1/badges/83fd270492c136594e59/test_coverage)](https://codeclimate.com/github/projectblacklight/blacklight/test_coverage) | ||
Blacklight is an open source Solr user interface discovery platform. | ||
@@ -40,3 +38,3 @@ You can use Blacklight to enable searching and browsing of your collections. | ||
* Bundler | ||
* Rails 5.1+ | ||
* Rails 5.2+ | ||
@@ -43,0 +41,0 @@ ## Contributing Code |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
63558
36
879
63
+ Added@popperjs/core@2.11.8(transitive)
+ Addedbootstrap@5.3.3(transitive)
- Removedbootstrap@4.6.2(transitive)
- Removedpopper.js@1.16.1(transitive)
Updatedbootstrap@>=4.3.1 <6.0.0