Jump to content

User:PrimeHunter/In MonoBook.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by PrimeHunter (talk | contribs) at 21:11, 14 November 2022 (Create script to add sidebar link to view the current page in MonoBook). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Add a "MonoBook" sidebar link to reload the current page in the MonoBook skin.
   Changes in the edit box and elsewhere will be lost.
   Install with this in your [[Special:MyPage/vector.js]] if Vector is your normal skin:

   importScript('User:PrimeHunter/In MonoBook.js'); // Linkback: [[User:PrimeHunter/In MonoBook.js]]
*/

$( document ).ready( function() {
  mw.util.addPortletLink(
    'p-tb',
    location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'useskin=monobook',
    'In MonoBook',
    't-inmonobook',
    'Reload page in MonoBook (discards anything you have entered)'
  );
});