Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

User:Aemony/common.js

From PCGamingWiki, the wiki about fixing PC games
< User:Aemony
Revision as of 08:56, 5 September 2022 by Aemony (talk | contribs) (test)

Note: After saving, 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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
console.log("User:Aemony/common.js executing...");
console.log("-- Link: https://pcgamingwiki.com/wiki/User:Aemony/common.js");


// Check if we're editing a page.
if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
    // Add a hook handler.
    mw.hook('wikiEditor.toolbarReady').add(function($textarea) {

        // Adds custom byttons to the advanced > insert group
        $textarea.wikiEditor('addToToolbar', {
            'section': 'advanced',
            'group': 'insert',
            'tools': {
                'fixbox': {
                    label: 'Fixbox',
                    type: 'button',
                    icon: '//images.pcgamingwiki.com/d/d8/Editor_Icon_-_Fixbox.svg',
                    action: {
                        type: 'encapsulate',
                        options: {
                            pre: "{{Fixbox|description=",
                            peri: "Name",
                            post: "|ref=<ref>Reference</ref>|fix=\n}}",
                            ownline: true
                        }
                    }
                }
            }
        });
    });
}