MediaWiki:Common.js

From Bemar leit
Revision as of 05:51, 20 October 2026 by Bjarni Bemar (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Breyta &printable=yes í &action=render í öllum hlekkjum á síðunni
mw.hook('wikipage.content').add(function ($content) {
    $content.find('a[href*="printable=yes"]').each(function () {
        var $link = $(this);
        var href = $link.attr('href');
        
        // Skipta út printable=yes fyrir action=render
        var newHref = href.replace('printable=yes', 'action=render');
        $link.attr('href', newHref);
    });
});