From 5c18c64afbdc8b888fdedf2d7cc45e1930225f02 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 16 Jan 2021 16:11:30 -0500 Subject: Change integration configuration page (#3372) I've refactored the user query code to be able to use it also on the integration configuration page. Now, items can be re-organized as in the user query list. --- p/scripts/extra.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'p/scripts/extra.js') diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 3cb7b93aa..a78b5b10d 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -93,46 +93,6 @@ function init_crypto_form() { } // -function init_share_observers() { - let shares = document.querySelectorAll('.group-share').length; - const shareAdd = document.querySelector('.share.add'); - if (shareAdd) { - shareAdd.onclick = function (ev) { - const s = this.parentElement.querySelector('select'), - opt = s.options[s.selectedIndex]; - let row = this.closest('form').getAttribute('data-' + opt.getAttribute('data-form')); - row = row.replace(/##label##/g, opt.text); - row = row.replace(/##type##/g, opt.value); - row = row.replace(/##help##/g, opt.getAttribute('data-help')); - row = row.replace(/##key##/g, shares); - row = row.replace(/##method##/g, opt.getAttribute('data-method')); - row = row.replace(/##field##/g, opt.getAttribute('data-field')); - this.closest('.form-group').insertAdjacentHTML('beforebegin', row); - shares++; - return false; - }; - } -} - - -function init_remove_observers() { - document.querySelectorAll('.post').forEach(function (div) { - div.onclick = function (ev) { - const a = ev.target.closest('a.remove'); - if (a) { - const remove_what = a.getAttribute('data-remove'); - if (remove_what !== undefined) { - const d = document.getElementById(remove_what); - if (d) { - d.remove(); - } - } - return false; - } - }; - }); -} - function init_password_observers() { document.querySelectorAll('.toggle-password').forEach(function (a) { a.onmousedown = function (ev) { @@ -248,8 +208,6 @@ function init_extra() { return; } init_crypto_form(); - init_share_observers(); - init_remove_observers(); init_password_observers(); init_select_observers(); init_slider_observers(); -- cgit v1.2.3