`;
// Ajoutez le code CSS personnalisé
const style = document.createElement('style');
style.textContent = `
#ejournal24-links-widget .modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.4);
}
#ejournal24-links-widget .modal-content {
background-color: #fff;
margin: 5% auto;
padding: 20px;
border: 1px solid #ddd;
width: 90%;
height: 80%;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#ejournal24-links-widget .close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
#ejournal24-links-widget .close:hover,
#ejournal24-links-widget .close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
#ejournal24-links-widget #external-iframe {
width: 100%;
height: 100%;
border: none;
}
/* Personnalisation de la barre de défilement (si nécessaire) */
#ejournal24-links-widget #external-iframe::-webkit-scrollbar {
width: 8px;
}
#ejournal24-links-widget #external-iframe::-webkit-scrollbar-track {
background: #f1f1f1;
}
#ejournal24-links-widget #external-iframe::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
#ejournal24-links-widget #external-iframe::-webkit-scrollbar-thumb:hover {
background: #555;
}
`;
// Ajoutez le conteneur et le style au corps de la page
document.body.appendChild(widgetContainer);
document.head.appendChild(style);
// Ajoutez le code JavaScript pour la fonctionnalité du widget
const modal = document.getElementById('external-modal');
const iframe = document.getElementById('external-iframe');
const closeBtn = document.getElementsByClassName('close')[0];
const links = document.getElementsByClassName('external-link');
for (let link of links) {
link.addEventListener('click', function(event) {
event.preventDefault();
iframe.src = this.href;
modal.style.display = 'block';
});
}
closeBtn.onclick = function() {
modal.style.display = 'none';
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = 'none';
}
}
})();