Sindbad~EG File Manager
document.addEventListener('DOMContentLoaded', function () {
var galleryModal = document.getElementById('galleryModal');
var modalContent = document.getElementById('modalContent');
galleryModal.addEventListener('show.bs.modal', function (event) {
var button = event.relatedTarget;
var type = button.getAttribute('data-bs-type');
var src = button.getAttribute('data-bs-src');
if (type === 'image') {
var img = document.createElement('img');
img.src = button.src;
img.className = 'img-fluid';
modalContent.innerHTML = '';
modalContent.appendChild(img);
} else if (type === 'video') {
var iframe = document.createElement('iframe');
iframe.src = src;
iframe.className = 'w-100';
iframe.style.height = '500px';
iframe.setAttribute('frameborder', '0');
iframe.setAttribute('allowfullscreen', '');
modalContent.innerHTML = '';
modalContent.appendChild(iframe);
}
});
galleryModal.addEventListener('hidden.bs.modal', function () {
modalContent.innerHTML = ''; // Clear modal content on close
});
});
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists