From b91196f4b73fff91997b8077619ae25b6d04a59e Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 16 May 2022 18:26:49 +0200 Subject: Add confirmation page when importing blocked domains (#1773) * Move glitch-soc-specific strings to glitch-soc-specific locale files * Add confirmation page when importing blocked domains --- app/javascript/core/admin.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/core/admin.js b/app/javascript/core/admin.js index ef0a8f267..c1b9f07a4 100644 --- a/app/javascript/core/admin.js +++ b/app/javascript/core/admin.js @@ -102,6 +102,12 @@ ready(() => { const registrationMode = document.getElementById('form_admin_settings_registrations_mode'); if (registrationMode) onChangeRegistrationMode(registrationMode); + const checkAllElement = document.querySelector('#batch_checkbox_all'); + if (checkAllElement) { + checkAllElement.checked = [].every.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked); + checkAllElement.indeterminate = !checkAllElement.checked && [].some.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked); + } + document.querySelector('a#add-instance-button')?.addEventListener('click', (e) => { const domain = document.getElementById('by_domain')?.value; -- cgit