Jump to content

User:Yaris678/monobook.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Amorymeltzer (talk | contribs) at 16:11, 5 February 2021 (Remove legacy globals per phab:T72470 (see VPT notice; revert and ping me if broken!) (via WP:JWB)). 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.
// Code by [[User:Jarry1250]] to stop the "return" key taking effect in the "edit summary" box
$(".mw-summary").keypress(function(e){ if (e.which == 13) { return false; } } );

// Code to add an "improve" button to the history page
if (mw.config.get('wgAction') == 'history') //add a link to call histComb.js
addOnloadHook(function(){
 var pagehis = document.getElementById('pagehistory');
 if (!pagehis) return;
 var lnk = document.createElement('a');
 lnk.style.marginLeft = '10px';
 lnk.href = '#';
 lnk.appendChild(document.createTextNode('Improve…'));
 lnk.onclick=function(){this.parentNode.removeChild(this);importScript('User:Alex_Smotrov/histcomb.js')}
 pagehis.parentNode.insertBefore(lnk, pagehis);
})