Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/blueversion/wp-content/plugins/mailchimp-for-wp/assets/src/js/admin/ |
Upload File : |
const showIfElements = document.querySelectorAll('[data-showif]');
[].forEach.call(showIfElements, function (element) {
const config = JSON.parse(element.getAttribute('data-showif'))
const parentElements = document.querySelectorAll('[name="' + config.element + '"]')
const inputs = element.querySelectorAll('input,select,textarea:not([readonly])')
const hide = config.hide === undefined || config.hide
function toggleElement () {
// do nothing with unchecked radio inputs
if (this.type === 'radio' && !this.checked) {
return
}
const value = (this.type === 'checkbox') ? this.checked : this.value
const conditionMet = (String(value) === String(config.value))
if (hide) {
element.style.display = conditionMet ? '' : 'none'
element.style.visibility = conditionMet ? '' : 'hidden'
} else {
element.style.opacity = conditionMet ? '' : '0.4'
}
// disable input fields to stop sending their values to server
[].forEach.call(inputs, function (inputElement) {
inputElement.readOnly = !conditionMet
})
}
// find checked element and call toggleElement function
[].forEach.call(parentElements, function (el) {
el.addEventListener('change', toggleElement)
toggleElement.call(el)
})
})