MediaWiki:Common.js: Rozdiel medzi revíziami
Z STD
| Riadok 5: | Riadok 5: | ||
function previousPage() { | function previousPage() { | ||
| − | var prevTerm = $('#prev-term'); | + | var prevTerm = $('#prev-term > a'); |
if (prevTerm.length) { | if (prevTerm.length) { | ||
window.location.href = prevTerm.attr('href'); | window.location.href = prevTerm.attr('href'); | ||
| Riadok 13: | Riadok 13: | ||
function nextPage() { | function nextPage() { | ||
| − | var nextTerm = $('#next-term'); | + | var nextTerm = $('#next-term > a'); |
if (nextTerm.length) { | if (nextTerm.length) { | ||
window.location.href = nextTerm.attr('href'); | window.location.href = nextTerm.attr('href'); | ||
Verzia zo dňa a času 14:54, 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 > a');
if (prevTerm.length) {
window.location.href = prevTerm.attr('href');
console.log('navigating to previous page');
}
}
function nextPage() {
var nextTerm = $('#next-term > a');
if (nextTerm.length) {
window.location.href = nextTerm.attr('href');
console.log('navigating to next page');
}
}