Difference between revisions of "MediaWiki:Common.js"

From SCI Wiki
Jump to navigationJump to search
Line 56: Line 56:
  
 
// Align Left
 
// Align Left
mw.toolbar.addButton({ // OLD WAY - "classic toolbar"
+
mw.toolbar.addButton({
 
         imageId: '',
 
         imageId: '',
 
         imageFile: '/buttons/alignLeft.png',
 
         imageFile: '/buttons/alignLeft.png',
Line 66: Line 66:
  
 
// Align Center
 
// Align Center
mw.toolbar.addButton({ // OLD WAY - "classic toolbar"
+
mw.toolbar.addButton({
 
         imageId: '',
 
         imageId: '',
 
         imageFile: '/buttons/alignCenter.png',
 
         imageFile: '/buttons/alignCenter.png',
Line 76: Line 76:
  
 
// Align Right
 
// Align Right
mw.toolbar.addButton({ // OLD WAY - "classic toolbar"
+
mw.toolbar.addButton({
 
         imageId: '',
 
         imageId: '',
 
         imageFile: '/buttons/alignRight.png',
 
         imageFile: '/buttons/alignRight.png',
Line 83: Line 83:
 
         tagClose: "</div>",
 
         tagClose: "</div>",
 
         sampleText: "content here"
 
         sampleText: "content here"
 +
});
 +
 +
// Justify
 +
mw.toolbar.addButton({
 +
        imageId: 'justify',
 +
        imageFile: '/buttons/alignJustify.png',
 +
        speedTip: "Justify",
 +
        tagOpen: "<div align=\"justify\">",
 +
        tagClose: "</div>",
 +
        sampleText: ""
 
});
 
});

Revision as of 01:45, 2 September 2013

/* 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: "Table",
        tagOpen: "{| cellpadding=\"10\" align=\"center\" width=\"85%\"\n|- \n|align=\"center\"| ",
        tagClose: "\n|}",
        sampleText: "Insert content here"
});


// Align Left
mw.toolbar.addButton({
        imageId: '',
        imageFile: '/buttons/alignLeft.png',
        speedTip: "Align Left",
        tagOpen: "<div align=\"left\">",
        tagClose: "</div>",
        sampleText: "content here"
});

// Align Center
mw.toolbar.addButton({
        imageId: '',
        imageFile: '/buttons/alignCenter.png',
        speedTip: "Align Center",
        tagOpen: "<div align=\"center\">",
        tagClose: "</div>",
        sampleText: "content here"
});

// Align Right
mw.toolbar.addButton({
        imageId: '',
        imageFile: '/buttons/alignRight.png',
        speedTip: "Align Right",
        tagOpen: "<div align=\"right\">",
        tagClose: "</div>",
        sampleText: "content here"
});

// Justify
mw.toolbar.addButton({
        imageId: 'justify',
        imageFile: '/buttons/alignJustify.png',
        speedTip: "Justify",
        tagOpen: "<div align=\"justify\">",
        tagClose: "</div>",
        sampleText: ""
});