MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Bjarni Bemar (talk | contribs) No edit summary |
Bjarni Bemar (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
// Grípa | // Hluti 1: Grípa smellinn dýnamískt | ||
$(document).ready(function() { | |||
$('body').on('click', 'a', function(e) { | |||
$ | |||
var href = $(this).attr('href'); | var href = $(this).attr('href'); | ||
if (href && href.indexOf('printable=yes') !== -1) { | |||
e.preventDefault(); | |||
var newHref = href.replace('printable=yes', 'action=render'); | |||
window.location.href = newHref; | |||
} | |||
}); | }); | ||
}); | }); | ||
// Hluti 2: Ef notandinn lendir samt á printable síðu, áframsenda strax | |||
if (window.location.href.indexOf('printable=yes') !== -1) { | |||
window.location.href = window.location.href.replace('printable=yes', 'action=render'); | |||
} | |||
Latest revision as of 06:07, 20 October 2026
// Hluti 1: Grípa smellinn dýnamískt
$(document).ready(function() {
$('body').on('click', 'a', function(e) {
var href = $(this).attr('href');
if (href && href.indexOf('printable=yes') !== -1) {
e.preventDefault();
var newHref = href.replace('printable=yes', 'action=render');
window.location.href = newHref;
}
});
});
// Hluti 2: Ef notandinn lendir samt á printable síðu, áframsenda strax
if (window.location.href.indexOf('printable=yes') !== -1) {
window.location.href = window.location.href.replace('printable=yes', 'action=render');
}