User:GunnarRene/monobook.js

Source: Wikipedia, the free encyclopedia.
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.
importScript('Wikipedia:WikiProject User scripts/Scripts/addLink');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add_edit_section_0');
Gerbrant = {fw: {load: [ 
"Gerbrant.edit.regexReplace"
]},

edit: {regexReplace: {
    lang: "en", 
    presets:
    {
        Caps:
        {
            regex: "[A-Z]{2,}",
            caseSens: true,
            replace: function(a)
            {
                return a.slice(0,1) +
                    a.slice(1).toLowerCase();
            }
        },
        Avex:
        {
            regex: "\\[\\[avex( records| trax)?(\\|avex trax|\\|avex(?=\\]\\]))?",
            replace: "[[Avex Trax"
        },
        SG1:
        {
            regex: "\\{\\{sgspoiler\\|[0-9]*",
            replace: function(a)
            {
                return "{{spoiler-season|"+ a.slice(12)+"|episodelist=List of Stargate SG-1 episodes#Season "+ a.slice(12);
             }
        }
     }
        }     }
}
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Gerbrant/fw.js&action=raw&ctype=text/javascript');