芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.7/com_languages/js/admin-language-edit-change-flag.js
/** * @copyright (C) 2018 Open Source Matters, Inc.
* @license GNU General Public License version 2 or later; see LICENSE.txt */ document.addEventListener('DOMContentLoaded', () => { document.getElementById('jform_image').addEventListener('change', ({ currentTarget }) => { const flagSelectedValue = currentTarget.value; const flagimage = document.getElementById('flag').querySelector('img'); const src = `${Joomla.getOptions('system.paths').rootFull}/media/mod_languages/images/${flagSelectedValue}.gif`; if (flagSelectedValue) { flagimage.setAttribute('src', src); flagimage.setAttribute('alt', flagSelectedValue); } else { flagimage.removeAttribute('src'); flagimage.setAttribute('alt', ''); } }, false); });