MediaWiki:Common.js: Porovnání verzí
Z Wiki JU
Bez shrnutí editace |
Bez shrnutí editace |
||
| Řádek 4: | Řádek 4: | ||
// Zruš jQuery UI vzhled tlačítka | // Zruš jQuery UI vzhled tlačítka | ||
$('.articleFeedbackv5-submit').button('destroy'); | $('.articleFeedbackv5-submit').button('destroy'); | ||
}); | |||
document.addEventListener('DOMContentLoaded', function () { | |||
document.querySelectorAll('.extern-download').forEach(el => { | |||
el.style.cursor = 'pointer'; | |||
el.style.color = '#0645AD'; | |||
el.style.textDecoration = 'underline'; | |||
el.addEventListener('click', () => { | |||
const a = document.createElement('a'); | |||
a.href = el.getAttribute('data-url'); | |||
a.setAttribute('download', ''); | |||
a.style.display = 'none'; | |||
document.body.appendChild(a); | |||
a.click(); | |||
document.body.removeChild(a); | |||
}); | |||
}); | |||
}); | }); | ||
Verze z 23. 7. 2025, 08:16
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky */
$(function () {
// Zruš jQuery UI vzhled tlačítka
$('.articleFeedbackv5-submit').button('destroy');
});
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.extern-download').forEach(el => {
el.style.cursor = 'pointer';
el.style.color = '#0645AD';
el.style.textDecoration = 'underline';
el.addEventListener('click', () => {
const a = document.createElement('a');
a.href = el.getAttribute('data-url');
a.setAttribute('download', '');
a.style.display = 'none';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
});
});
});