nexcoding / image-manager-ci4
此包最新版本(0.0.1)没有可用的许可证信息。
0.0.1
2023-08-10 22:10 UTC
This package is not auto-updated.
Last update: 2024-09-21 03:04:36 UTC
README
CodeIgniter Image Manager Package 提供了一种方便的方法来管理处理 CodeIgniter 4 项目中的图像上传和选择。
特性
- 轻松上传图像。
- 列出已上传图像。
- 从列表中选择图像。
安装
您可以通过 Composer 安装此包
composer require nexcoding/image-manager-ci4创建新报告 <script> document.addEventListener("DOMContentLoaded", function () { const openModalButtons = document.querySelectorAll('[data-media-ci4-library]'); const myModal = new bootstrap.Modal(document.getElementById('modalId')); openModalButtons.forEach(button => { button.addEventListener('click', function () { const targetInputId = button.getAttribute('data-media-ci4-target-input-id'); myModal.show(); myModal._element.setAttribute('data-target-input-id', targetInputId); }); }); window.addEventListener('message', function(event) { if (event.data.type === 'imageSelected') { const selectedImage = event.data.image; const targetInputId = myModal._element.getAttribute('data-target-input-id'); document.getElementById(targetInputId).value = selectedImage; myModal.hide(); } }); }); </script>