MediaWiki:Common.js: Rozdiel medzi revíziami
Z STD
| Riadok 12: | Riadok 12: | ||
} | } | ||
| − | function | + | function nextPage() { |
var nextTerm = $('#next-term'); | var nextTerm = $('#next-term'); | ||
if (nextTerm.length) { | if (nextTerm.length) { | ||
Verzia zo dňa a času 14:40, 20. júl 2016
/* Tu uvedený JavaScript sa nahrá všetkým používateľom pri každom nahraní stránky. */
Mousetrap.bind('j', previousPage);
Mousetrap.bind('k', nextPage);
function previousPage() {
var prevTerm = $('#prev-term');
if (prevTerm.length) {
window.location.href = prevTerm.attr('href');
console.log('navigating to previous page');
}
}
function nextPage() {
var nextTerm = $('#next-term');
if (nextTerm.length) {
window.location.href = nextTerm.attr('href');
console.log('navigating to next page');
}
}