MediaWiki:Common.js

From SCI Wiki
Revision as of 01:27, 2 September 2013 by Andrew Branscom (talk | contribs)
Jump to navigationJump to search

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.
/* Any JavaScript here will be loaded for all users on every page load. */


// Comment
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-myspecialbutton',
        imageFile: '/buttons/comment.png',
        speedTip: "Comment",
        tagOpen: "<!-- ",
        tagClose: " -->",
        sampleText: "Insert comment here"
});

// Block Quote
mw.toolbar.addButton({
        imageId: 'blockquote',
        imageFile: '/buttons/blockquote.png',
        speedTip: "Blockquote",
        tagOpen: "<blockquote>",
        tagClose: "</blockquote>",
        sampleText: "Insert comment here"
});

// Non-breaking space
mw.toolbar.addButton({
        imageId: 'nobreak',
        imageFile: '/buttons/nobreak.png',
        speedTip: "Non-breaking Space",
        tagOpen: "&nbsp;",
        tagClose: "",
        sampleText: ""
});

// Line Break
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-myspecialbutton',
        imageFile: '/buttons/br.png',
        speedTip: "New Line",
        tagOpen: "",
        tagClose: "<br />",
        sampleText: ""
});


// Table
mw.toolbar.addButton({
        imageId: '',
        imageFile: '/buttons/table.png',
        speedTip: "",
        tagOpen: "{| cellpadding=\"10\" align=\"center\" width=\"85%\"\n|- \n|align=\"center\"| ",
        tagClose: "\n|}",
        sampleText: "Insert content here"
});