Files
Lexema-HRM/docs/javascripts/extra.js

32 lines
798 B
JavaScript
Raw Normal View History

2025-07-16 12:44:48 +05:00
!function() {
const myTitle = {
'note': 'Примечание',
'caution': 'Осторожно',
'info': 'Информация',
'danger': 'Опасно',
'hint': 'Совет',
'warning': 'Внимание'
}
for (let item of document.getElementsByClassName('admonition-title')) {
if (item.parentNode.classList[1] && myTitle[item.parentNode.classList[1]]) {
item.firstChild.nodeValue = myTitle[item.parentNode.classList[1]];
}
}
for (let item of document.getElementsByClassName('imgPreview')) {
item.onclick = function(s) {
window.open(s.target.src, '_blank').focus();
}
}
document.querySelectorAll('.zoom').forEach(item => {
item.addEventListener('click', function () {
this.classList.toggle('image-zoom-large');
})
});
//console.log('HI');
}();