32 lines
798 B
JavaScript
32 lines
798 B
JavaScript
![]() |
!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');
|
||
|
}();
|