Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/glightbox/src/js/slides/ drwxrwxr-x | |
| Viewing file: Select action/file-type: /**
* Set slide inline content
* we'll extend this to make http
* requests using the fetch api
* but for now we keep it simple
*
* @param {node} slide
* @param {object} data
* @param {int} index
* @param {function} callback
*/
import { has, addClass, addEvent, createHTML, isString, isNode, isFunction } from '../utils/helpers.js';
export default function slideInline(slide, data, index, callback) {
const slideMedia = slide.querySelector('.gslide-media');
const hash = has(data, 'href') && data.href ? data.href.split('#').pop().trim() : false;
const content = has(data, 'content') && data.content ? data.content : false;
let innerContent;
if (content) {
if (isString(content)) {
innerContent = createHTML(`<div class="ginlined-content">${content}</div>`);
}
if (isNode(content)) {
if (content.style.display == 'none') {
content.style.display = 'block';
}
const container = document.createElement('div');
container.className = 'ginlined-content';
container.appendChild(content);
innerContent = container;
}
}
if (hash) {
let div = document.getElementById(hash);
if (!div) {
return false;
}
const cloned = div.cloneNode(true);
cloned.style.height = data.height;
cloned.style.maxWidth = data.width;
addClass(cloned, 'ginlined-content');
innerContent = cloned;
}
if (!innerContent) {
console.error('Unable to append inline slide content', data);
return false;
}
slideMedia.style.height = data.height;
slideMedia.style.width = data.width;
slideMedia.appendChild(innerContent);
this.events['inlineclose' + hash] = addEvent('click', {
onElement: slideMedia.querySelectorAll('.gtrigger-close'),
withCallback: (e) => {
e.preventDefault();
this.close();
}
});
if (isFunction(callback)) {
callback();
}
return;
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0282 ]-- |