blacklight-frontend 8.0.0-pre.1 → 8.0.0-pre.2
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.
- package/app/assets/javascripts/blacklight/blacklight.js +8 -8
- package/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- package/app/assets/stylesheets/blacklight/_header.scss +0 -12
- package/app/assets/stylesheets/blacklight/_mixins.scss +20 -0
- package/app/assets/stylesheets/blacklight/_search_form.scss +12 -1
- package/package.json +1 -1
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
})(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
7
|
const Blacklight = function() {
|
|
8
|
-
|
|
8
|
+
const buffer = new Array;
|
|
9
9
|
return {
|
|
10
10
|
onLoad: function(func) {
|
|
11
11
|
buffer.push(func);
|
|
12
12
|
},
|
|
13
13
|
|
|
14
14
|
activate: function() {
|
|
15
|
-
for(
|
|
15
|
+
for(let i = 0; i < buffer.length; i++) {
|
|
16
16
|
buffer[i].call();
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
listeners: function () {
|
|
21
|
-
|
|
21
|
+
const listeners = [];
|
|
22
22
|
if (typeof Turbo !== 'undefined') {
|
|
23
23
|
listeners.push('turbo:load');
|
|
24
24
|
} else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
|
|
@@ -346,16 +346,16 @@
|
|
|
346
346
|
};
|
|
347
347
|
|
|
348
348
|
modal.hide = function (el) {
|
|
349
|
-
|
|
349
|
+
const dom = document.querySelector(Blacklight.modal.modalSelector);
|
|
350
350
|
|
|
351
|
-
if (!dom.open) return
|
|
351
|
+
if (!dom.open) return
|
|
352
352
|
dom.close();
|
|
353
353
|
};
|
|
354
354
|
|
|
355
355
|
modal.show = function(el) {
|
|
356
|
-
|
|
356
|
+
const dom = document.querySelector(Blacklight.modal.modalSelector);
|
|
357
357
|
|
|
358
|
-
if (dom.open) return
|
|
358
|
+
if (dom.open) return
|
|
359
359
|
dom.showModal();
|
|
360
360
|
};
|
|
361
361
|
|
|
@@ -382,7 +382,7 @@
|
|
|
382
382
|
// this is the Rails.handleMethod with a couple adjustments, described inline:
|
|
383
383
|
// first, we're attaching this directly to the event handler, so we can check for meta-keys
|
|
384
384
|
Blacklight.handleSearchContextMethod = function(event) {
|
|
385
|
-
|
|
385
|
+
const link = this;
|
|
386
386
|
|
|
387
387
|
// instead of using the normal href, we need to use the context href instead
|
|
388
388
|
let href = link.getAttribute('data-context-href');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n var buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(var i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n var listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n this.cssClass = 'toggle-bookmark'\n\n //View needs to set data-doc-id so we know a unique value\n //for making DOM id\n const uniqueId = this.form.getAttribute('data-doc-id') || Math.random();\n const id = `${this.cssClass}_${uniqueId}`\n this.checkbox = this._buildCheckbox(this.cssClass, id)\n this.span = this._buildSpan()\n this.label = this._buildLabel(id, this.cssClass, this.checkbox, this.span)\n\n // if form is currently using method delete to change state,\n // then checkbox is currently checked\n this.checked = (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0);\n }\n\n _buildCheckbox(cssClass, id) {\n const checkbox = document.createElement('input')\n checkbox.setAttribute('type', 'checkbox')\n checkbox.classList.add(cssClass)\n checkbox.id = id\n return checkbox\n }\n\n _buildLabel(id, cssClass, checkbox, span) {\n const label = document.createElement('label')\n label.classList.add(cssClass)\n label.for = id\n\n label.appendChild(checkbox)\n label.appendChild(document.createTextNode(' '))\n label.appendChild(span)\n return label\n }\n\n _buildSpan() {\n return document.createElement('span')\n }\n\n _buildCheckboxDiv() {\n const checkboxDiv = document.createElement('div')\n checkboxDiv.classList.add('checkbox')\n checkboxDiv.classList.add(this.cssClass)\n checkboxDiv.appendChild(this.label)\n return checkboxDiv\n }\n\n render() {\n const children = this.form.children\n Array.from(children).forEach((child) => child.classList.add('hidden'))\n\n //We're going to use the existing form to actually send our add/removes\n //This works conveneintly because the exact same action href is used\n //for both bookmarks/$doc_id. But let's take out the irrelevant parts\n //of the form to avoid any future confusion.\n this.form.querySelectorAll('input[type=submit]').forEach((el) => this.form.removeChild(el))\n this.form.appendChild(this._buildCheckboxDiv())\n this.updateStateFor(this.checked)\n\n this.checkbox.onclick = this._clicked.bind(this)\n }\n\n async _clicked(evt) {\n this.span.innerHTML = this.form.getAttribute('data-inprogress')\n this.label.setAttribute('disabled', 'disabled');\n this.checkbox.setAttribute('disabled', 'disabled');\n const response = await fetch(this.form.getAttribute('action'), {\n body: new FormData(this.form),\n method: this.form.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest'\n }\n })\n this.label.removeAttribute('disabled')\n this.checkbox.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.checked = !this.checked\n this.updateStateFor(this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n updateStateFor(state) {\n this.checkbox.checked = state\n\n if (state) {\n this.label.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.form.querySelector('input[name=_method]').value = 'delete'\n this.span.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.label.classList.remove('checked')\n this.form.querySelector('input[name=_method]').value = 'put'\n this.span.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.querySelectorAll(Blacklight.doBookmarkToggleBehavior.selector).forEach((el) => {\n new CheckboxSubmit(el).render()\n })\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.onLoad(function() {\n Blacklight.doBookmarkToggleBehavior();\n });\n})()\n\nexport default BookmarkToggle\n","import Blacklight from './core'\n\nconst ButtonFocus = (() => {\n Blacklight.onLoad(function() {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n document.querySelectorAll('button.collapse-toggle').forEach((button) => {\n button.addEventListener('click', () => {\n event.target.focus();\n });\n });\n });\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for extreme\n // network errors.\n modal.onFailure = function (jqXHR, textStatus, errorThrown) {\n console.error('Server error:', this.url, jqXHR.status, errorThrown);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-dismiss=\"modal\" data-bs-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.type} ${this.url}\\n${jqXHR.status}: ${errorThrown}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\nmodal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n const elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n var dom = document.querySelector(Blacklight.modal.modalSelector);\n\n if (!dom.open) return;\n dom.close()\n }\n\n modal.show = function(el) {\n var dom = document.querySelector(Blacklight.modal.modalSelector);\n\n if (dom.open) return;\n dom.showModal()\n }\n\n Blacklight.onLoad(function() {\n modal.setupModal();\n });\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n const elements = document.querySelectorAll('a[data-context-href]')\n const nodes = Array.from(elements)\n\n nodes.forEach(function(element) {\n element.addEventListener('click', function(e) {\n Blacklight.handleSearchContextMethod.call(e.currentTarget, e)\n })\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n var link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n event.stopPropagation()\n };\n\n Blacklight.onLoad(function() {\n Blacklight.doSearchContextBehavior();\n });\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA,MAAM,UAAU,GAAG,WAAW;EAC9B,EAAE,IAAI,MAAM,GAAG,IAAI,KAAK,CAAC;EACzB,EAAE,OAAO;EACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;EAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACxB,KAAK;AACL;EACA,IAAI,QAAQ,EAAE,WAAW;EACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;EAC7C,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;EACzB,OAAO;EACP,KAAK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C,WAAW,CAAC,IAAI,EAAC;EACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;EACA,IAAI,KAAK,CAAC,cAAc,GAAE;EAC1B,IAAI,KAAK,CAAC,eAAe,GAAE;EAC3B,GAAG,CAAC;AACJ;EACA,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW;EAC/B,IAAI,UAAU,CAAC,uBAAuB,EAAE,CAAC;EACzC,GAAG,CAAC,CAAC;EACL,CAAC;;ACxDD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n this.cssClass = 'toggle-bookmark'\n\n //View needs to set data-doc-id so we know a unique value\n //for making DOM id\n const uniqueId = this.form.getAttribute('data-doc-id') || Math.random();\n const id = `${this.cssClass}_${uniqueId}`\n this.checkbox = this._buildCheckbox(this.cssClass, id)\n this.span = this._buildSpan()\n this.label = this._buildLabel(id, this.cssClass, this.checkbox, this.span)\n\n // if form is currently using method delete to change state,\n // then checkbox is currently checked\n this.checked = (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0);\n }\n\n _buildCheckbox(cssClass, id) {\n const checkbox = document.createElement('input')\n checkbox.setAttribute('type', 'checkbox')\n checkbox.classList.add(cssClass)\n checkbox.id = id\n return checkbox\n }\n\n _buildLabel(id, cssClass, checkbox, span) {\n const label = document.createElement('label')\n label.classList.add(cssClass)\n label.for = id\n\n label.appendChild(checkbox)\n label.appendChild(document.createTextNode(' '))\n label.appendChild(span)\n return label\n }\n\n _buildSpan() {\n return document.createElement('span')\n }\n\n _buildCheckboxDiv() {\n const checkboxDiv = document.createElement('div')\n checkboxDiv.classList.add('checkbox')\n checkboxDiv.classList.add(this.cssClass)\n checkboxDiv.appendChild(this.label)\n return checkboxDiv\n }\n\n render() {\n const children = this.form.children\n Array.from(children).forEach((child) => child.classList.add('hidden'))\n\n //We're going to use the existing form to actually send our add/removes\n //This works conveneintly because the exact same action href is used\n //for both bookmarks/$doc_id. But let's take out the irrelevant parts\n //of the form to avoid any future confusion.\n this.form.querySelectorAll('input[type=submit]').forEach((el) => this.form.removeChild(el))\n this.form.appendChild(this._buildCheckboxDiv())\n this.updateStateFor(this.checked)\n\n this.checkbox.onclick = this._clicked.bind(this)\n }\n\n async _clicked(evt) {\n this.span.innerHTML = this.form.getAttribute('data-inprogress')\n this.label.setAttribute('disabled', 'disabled');\n this.checkbox.setAttribute('disabled', 'disabled');\n const response = await fetch(this.form.getAttribute('action'), {\n body: new FormData(this.form),\n method: this.form.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest'\n }\n })\n this.label.removeAttribute('disabled')\n this.checkbox.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.checked = !this.checked\n this.updateStateFor(this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n updateStateFor(state) {\n this.checkbox.checked = state\n\n if (state) {\n this.label.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.form.querySelector('input[name=_method]').value = 'delete'\n this.span.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.label.classList.remove('checked')\n this.form.querySelector('input[name=_method]').value = 'put'\n this.span.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.querySelectorAll(Blacklight.doBookmarkToggleBehavior.selector).forEach((el) => {\n new CheckboxSubmit(el).render()\n })\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.onLoad(function() {\n Blacklight.doBookmarkToggleBehavior();\n });\n})()\n\nexport default BookmarkToggle\n","import Blacklight from './core'\n\nconst ButtonFocus = (() => {\n Blacklight.onLoad(function() {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n document.querySelectorAll('button.collapse-toggle').forEach((button) => {\n button.addEventListener('click', () => {\n event.target.focus();\n });\n });\n });\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for extreme\n // network errors.\n modal.onFailure = function (jqXHR, textStatus, errorThrown) {\n console.error('Server error:', this.url, jqXHR.status, errorThrown);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-dismiss=\"modal\" data-bs-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.type} ${this.url}\\n${jqXHR.status}: ${errorThrown}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\nmodal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n const elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n Blacklight.onLoad(function() {\n modal.setupModal()\n });\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n const elements = document.querySelectorAll('a[data-context-href]')\n const nodes = Array.from(elements)\n\n nodes.forEach(function(element) {\n element.addEventListener('click', function(e) {\n Blacklight.handleSearchContextMethod.call(e.currentTarget, e)\n })\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n event.stopPropagation()\n };\n\n Blacklight.onLoad(function() {\n Blacklight.doSearchContextBehavior();\n });\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA,MAAM,UAAU,GAAG,WAAW;EAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;EAC3B,EAAE,OAAO;EACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;EAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACxB,KAAK;AACL;EACA,IAAI,QAAQ,EAAE,WAAW;EACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MA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AK,CAAC,OAAO,GAAG,OAAM;EAC/B,IAAI,IAAI,CAAC,SAAS,GAAG,YAAW;EAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;EACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;EACA,IAAI,KAAK,CAAC,cAAc,GAAE;EAC1B,IAAI,KAAK,CAAC,eAAe,GAAE;EAC3B,GAAG,CAAC;AACJ;EACA,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW;EAC/B,IAAI,UAAU,CAAC,uBAAuB,EAAE,CAAC;EACzC,GAAG,CAAC,CAAC;EACL,CAAC;;ACxDD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
|
|
@@ -40,18 +40,6 @@
|
|
|
40
40
|
@extend .col-lg-8;
|
|
41
41
|
padding-left: 0;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
.submit-search-text {
|
|
45
|
-
// hide 'search' label at very small screens
|
|
46
|
-
@media screen and (max-width: breakpoint-max(xs)) {
|
|
47
|
-
@if mixin-exists(sr-only) {
|
|
48
|
-
@include sr-only();
|
|
49
|
-
}
|
|
50
|
-
@if mixin-exists(visually-hidden) {
|
|
51
|
-
@include visually-hidden();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
43
|
}
|
|
56
44
|
|
|
57
45
|
#skip-link {
|
|
@@ -13,3 +13,23 @@
|
|
|
13
13
|
fill: #fff;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
// define a visually-hidden class that applies to a given breakpoint and below
|
|
18
|
+
// https://getbootstrap.com/docs/5.2/helpers/visually-hidden/
|
|
19
|
+
@if mixin-exists(visually-hidden) {
|
|
20
|
+
@each $infix, $breakpoint in $grid-breakpoints {
|
|
21
|
+
.visually-hidden-#{$infix} {
|
|
22
|
+
@include media-breakpoint-down($breakpoint) {
|
|
23
|
+
@include visually-hidden;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} @else if mixin-exists(sr-only) { // Bootstrap 4 version
|
|
28
|
+
@each $infix, $breakpoint in $grid-breakpoints {
|
|
29
|
+
.visually-hidden-#{$infix} {
|
|
30
|
+
@include media-breakpoint-down($breakpoint) {
|
|
31
|
+
@include sr-only;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -6,14 +6,25 @@
|
|
|
6
6
|
|
|
7
7
|
.input-group > .search-autocomplete-wrapper {
|
|
8
8
|
@extend .form-control;
|
|
9
|
+
display: inline-block;
|
|
9
10
|
flex-grow: 4;
|
|
10
11
|
padding: 0;
|
|
11
|
-
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
12
14
|
.search-q {
|
|
13
15
|
border: 0;
|
|
14
16
|
height: 100%;
|
|
15
17
|
width: 100%;
|
|
16
18
|
}
|
|
19
|
+
|
|
20
|
+
ul {
|
|
21
|
+
@extend .dropdown-menu;
|
|
22
|
+
display: block;
|
|
23
|
+
|
|
24
|
+
li {
|
|
25
|
+
@extend .dropdown-item;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
.search-btn {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blacklight-frontend",
|
|
3
|
-
"version": "8.0.0-pre.
|
|
3
|
+
"version": "8.0.0-pre.2",
|
|
4
4
|
"description": "[](https://travis-ci.com/projectblacklight/blacklight) [](http://badge.fury.io/rb/blacklight) [](https://coveralls.io/github/projectblacklight/blacklight?branch=main)",
|
|
5
5
|
"main": "app/assets/javascripts/blacklight",
|
|
6
6
|
"scripts": {
|