biosim-lab-explorer / script.js
gradsyntax's picture
this must work without login ...free for all and web app name is biogram
914d413 verified
raw
history blame contribute delete
880 Bytes
document.addEventListener('DOMContentLoaded', () => {
// Initialize tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// External link handler
document.querySelectorAll('a[target="_blank"]').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
window.open(link.href, '_blank', 'noopener,noreferrer');
});
});
});
function trackSimulationCompletion(simulationId) {
const completed = JSON.parse(localStorage.getItem('completedSimulations'));
if (!completed.includes(simulationId)) {
completed.push(simulationId);
localStorage.setItem('completedSimulations', JSON.stringify(completed));
}
}