User:Iamunknown/monobook.js

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
  • Konqueror: simply click the Reload button, or press F5;
  • Opera users may need to completely clear their cache in Tools→Preferences.
// <pre><nowiki>

// Script includer
function winc(s) {
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=' + s
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}

// winc('User:Jsimlo/shortcuts.js');                        // [[User:Jsimlo/shortcuts.js]]
winc('User:Lupin/popups.js');                            // [[w:User:Lupin/popups.js]]
winc('User:Invitatious/unsigned2.js');                   // [[w:User:Invitatious/unsigned2.js]]
winc('Wikipedia:WikiProject User scripts/Scripts/Time'); // Add date and time to top-right corner
// winc('User:Haza-w.debug/cactions.js');                   // [[:w:en:User:Haza-w/cactions.js]]

/* function shortcutsInit ()
{
shortcutsAddLink ('templates', 'Wikibooks:Template messages');
shortcutsAddLink ('monobook', 'User:Iamunknown/monobook.js');
shortcutsAddLink ('watchlist', 'User:Iamunknown/Watchlist');
shortcutsAddLink ('external links', 'User:Herbythyme/Over EL pages');
} */

popupAdminLinks=true;

// Death to editing on redlinks //
// From [[w:User:Essjay/monobook.js]]...he is amazing //
addOnloadHook(function stopRedlinksEditing(){ 
    var len=document.links.length;
    for(var i=0; i<len; ++i) {
        var l=document.links[i];
        if (l.className=='new') {
            l.href=l.href.replace('&action=edit', '');
        }
    }
});

/* Soft redirect */
    /* See [[WS:SCRIPTS]]; adds "soft redirect" tab in Firefox. */
       document.write('<script type="text/javascript"'
       + 'src="http://en.wikisource.org/w/index.php?title=User:Bookofjude/softredirect.js'
       + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// </pre></nowiki>

if (window.location.href.indexOf('Special:Movepage')!=-1) {
 addOnloadHook(function() {
  document.getElementById('wpReason').value='move per [[Wikibooks:Naming policy]]';
 });
}