Difference between revisions of "MediaWiki:Common.js"

From AGI Wiki
Jump to navigationJump to search
Line 1: Line 1:
  
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
 
// Wikipedia Link
 
mw.toolbar.addButton({
 
        imageId: 'mw-customeditbutton-myspecialbutton',
 
        imageFile: '/buttons/WP.png',
 
        speedTip: "Wikipedia Link",
 
        tagOpen: "[[w:|",
 
        tagClose: "]]",
 
        sampleText: "Text here"
 
});
 
  
 
// Underscore
 
// Underscore
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'mw-customeditbutton-myspecialbutton',
+
         imageId: 'mw-customeditbutton-Underscore',
 
         imageFile: '/buttons/FormatUnderscore.png',
 
         imageFile: '/buttons/FormatUnderscore.png',
 
         speedTip: "Underscore",
 
         speedTip: "Underscore",
Line 25: Line 14:
 
// Strikethrough
 
// Strikethrough
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'mw-customeditbutton-myspecialbutton',
+
         imageId: 'mw-customeditbutton-Strikethrough',
         imageFile: '/buttons/formatStrike.png',
+
         imageFile: '/buttons/FormatStrike.png',
 
         speedTip: "Strikethrough",
 
         speedTip: "Strikethrough",
 
         tagOpen: "<strike>",
 
         tagOpen: "<strike>",
 
         tagClose: "</strike>",
 
         tagClose: "</strike>",
 
         sampleText: "Text here"
 
         sampleText: "Text here"
 +
});
 +
 +
// Align Left
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-AlignLeft',
 +
        imageFile: '/buttons/AlignLeft.png',
 +
        speedTip: "Align Left",
 +
        tagOpen: "<div align=\"left\">",
 +
        tagClose: "</div>",
 +
        sampleText: "content here"
 +
});
 +
 +
// Align Center
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-AlignCenter',
 +
        imageFile: '/buttons/AlignCenter.png',
 +
        speedTip: "Align Center",
 +
        tagOpen: "<div align=\"center\">",
 +
        tagClose: "</div>",
 +
        sampleText: "content here"
 +
});
 +
 +
// Align Right
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-AlignRight',
 +
        imageFile: '/buttons/AlignRight.png',
 +
        speedTip: "Align Right",
 +
        tagOpen: "<div align=\"right\">",
 +
        tagClose: "</div>",
 +
        sampleText: "content here"
 +
});
 +
 +
// Justify
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Justify',
 +
        imageFile: '/buttons/AlignJustify.png',
 +
        speedTip: "Justify",
 +
        tagOpen: "<div align=\"justify\">",
 +
        tagClose: "</div>",
 +
        sampleText: ""
 +
});
 +
 +
// Indent
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Indent',
 +
        imageFile: '/buttons/Indent.png',
 +
        speedTip: "Indent",
 +
        tagOpen: "<blockquote>",
 +
        tagClose: "</blockquote>",
 +
        sampleText: "Insert comment here"
 +
});
 +
 +
// Quote
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Quote',
 +
        imageFile: 'http://wiki.sierrahelp.com/buttons/Quote.png',
 +
        speedTip: "Quote",
 +
        tagOpen: "<div class=\"Quote\">\n{{Quote|Attrib = \n}}\n",
 +
        tagClose: "\n</div>",
 +
        sampleText: "Quoted text here"
 
});
 
});
  
 
// Alert
 
// Alert
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'Alert',
+
         imageId: 'mw-customeditbutton-Alert',
         imageFile: '/buttons/red.png',
+
         imageFile: '/buttons/Red.png',
 
         speedTip: "Alert",
 
         speedTip: "Alert",
 
         tagOpen: "<span class=\"Alert\">",
 
         tagOpen: "<span class=\"Alert\">",
Line 45: Line 94:
 
// Inactive
 
// Inactive
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'Inactive',
+
         imageId: 'mw-customeditbutton-Inactive',
         imageFile: '/buttons/gray.png',
+
         imageFile: '/buttons/Gray.png',
 
         speedTip: "Inactive",
 
         speedTip: "Inactive",
 
         tagOpen: "<span class=\"Inactive\">",
 
         tagOpen: "<span class=\"Inactive\">",
 
         tagClose: "</span>",
 
         tagClose: "</span>",
 
         sampleText: "Text here"
 
         sampleText: "Text here"
 +
});
 +
 +
// Add Reference
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Reference',
 +
        imageFile: '/buttons/Reference.png',
 +
        speedTip: "Add Reference",
 +
        tagOpen: "<ref>",
 +
        tagClose: "</ref>",
 +
        sampleText: "Text here"
 +
});
 +
 +
// Wikipedia Link
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Wikipedia',
 +
        imageFile: '/buttons/Wikipedia.png',
 +
        speedTip: "Wikipedia Link",
 +
        tagOpen: "[[w:|",
 +
        tagClose: "]]",
 +
        sampleText: "Text here"
 +
});
 +
 +
// Redirect
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Redirect',
 +
        imageFile: '/buttons/Redirect.png',
 +
        speedTip: "Redirect",
 +
        tagOpen: "#REDIRECT [[",
 +
        tagClose: "]]",
 +
        sampleText: "code here"
 +
});
 +
 +
// Superscript
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Superscript',
 +
        imageFile: '/buttons/Superscript.png',
 +
        speedTip: "Superscript",
 +
        tagOpen: "<sup>",
 +
        tagClose: "</sup>",
 +
        sampleText: "Text here"
 +
});
 +
 +
// Subscript
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Subscript',
 +
        imageFile: '/buttons/Subscript.png',
 +
        speedTip: "Subscript",
 +
        tagOpen: "<sub>",
 +
        tagClose: "</sub>",
 +
        sampleText: "Text here"
 +
});
 +
 +
// Half
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Half',
 +
        imageFile: '/buttons/Half.png',
 +
        speedTip: "Half",
 +
        tagOpen: "½",
 +
        tagClose: "",
 +
        sampleText: ""
 +
});
 +
 +
// Quarter
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Quarter',
 +
        imageFile: '/buttons/Quarter.png',
 +
        speedTip: "Quarter",
 +
        tagOpen: "¼",
 +
        tagClose: "",
 +
        sampleText: ""
 +
});
 +
 +
// Copyright
 +
mw.toolbar.addButton({
 +
        imageId: 'mw-customeditbutton-Copyright',
 +
        imageFile: '/buttons/Copyright.png',
 +
        speedTip: "Copyright",
 +
        tagOpen: "©",
 +
        tagClose: "",
 +
        sampleText: ""
 
});
 
});
  
 
// Comment
 
// Comment
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'mw-customeditbutton-myspecialbutton',
+
         imageId: 'mw-customeditbutton-Comment',
         imageFile: '/buttons/comment.png',
+
         imageFile: '/buttons/Comment.png',
 
         speedTip: "Comment",
 
         speedTip: "Comment",
 
         tagOpen: "<!-- ",
 
         tagOpen: "<!-- ",
 
         tagClose: " -->",
 
         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"
 
         sampleText: "Insert comment here"
 
});
 
});
Line 75: Line 194:
 
// Non-breaking space
 
// Non-breaking space
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'nobreak',
+
         imageId: 'mw-customeditbutton-NoBreak',
         imageFile: '/buttons/nobreak.png',
+
         imageFile: '/buttons/NoBreak.png',
 
         speedTip: "Non-breaking Space",
 
         speedTip: "Non-breaking Space",
 
         tagOpen: "&nbsp;",
 
         tagOpen: "&nbsp;",
Line 83: Line 202:
 
});
 
});
  
// Line Break
+
// New Line
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'mw-customeditbutton-myspecialbutton',
+
         imageId: 'mw-customeditbutton-NewLine',
         imageFile: '/buttons/br.png',
+
         imageFile: '/buttons/NewLine.png',
 
         speedTip: "New Line",
 
         speedTip: "New Line",
 
         tagOpen: "",
 
         tagOpen: "",
Line 92: Line 211:
 
         sampleText: ""
 
         sampleText: ""
 
});
 
});
 
  
 
// Table
 
// Table
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: '',
+
         imageId: 'mw-customeditbutton-Table',
         imageFile: '/buttons/table.png',
+
         imageFile: '/buttons/Table.png',
 
         speedTip: "Table",
 
         speedTip: "Table",
 
         tagOpen: "{| cellpadding=\"10\" align=\"center\" width=\"85%\"\n|- \n|align=\"center\"| ",
 
         tagOpen: "{| cellpadding=\"10\" align=\"center\" width=\"85%\"\n|- \n|align=\"center\"| ",
Line 104: Line 222:
 
});
 
});
  
 
+
// Add template
// Align Left
 
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: '',
+
         imageId: 'mw-customeditbutton-NewTemplate',
         imageFile: '/buttons/alignLeft.png',
+
         imageFile: '/buttons/Template.png',
         speedTip: "Align Left",
+
         speedTip: "Add template",
         tagOpen: "<div align=\"left\">",
+
         tagOpen: "{{",
         tagClose: "</div>",
+
         tagClose: "}}",
         sampleText: "content here"
+
         sampleText: "Template Name"
 
});
 
});
 
+
// Align Center
+
// AGI Code
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: '',
+
         imageId: 'mw-customeditbutton-AGI',
         imageFile: '/buttons/alignCenter.png',
+
         imageFile: '/buttons/AGI.png',
         speedTip: "Align Center",
+
         speedTip: "AGI Code",
         tagOpen: "<div align=\"center\">",
+
         tagOpen: "<div class=\"CodeBlockHeader\">AGI Code:</div>\n<syntaxhighlight lang=\"agi\">\n",
        tagClose: "</div>",
+
         tagClose: "</syntaxhighlight>",
        sampleText: "content here"
+
         sampleText: "code 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: ""
 
 
});
 
});
  
// AGI Code
+
// SCI Code
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'AGI',
+
         imageId: 'mw-customeditbutton-SCI',
         imageFile: '/buttons/AGI.png',
+
         imageFile: '/buttons/SCI.png',
         speedTip: "AGI Code",
+
         speedTip: "SCI Code",
         tagOpen: "<div class=\"CodeBlockHeader\">Code:</div>\n<syntaxhighlight lang=\"agi\">\n",
+
         tagOpen: "<div class=\"CodeBlockHeader\">SCI Code:</div>\n<syntaxhighlight lang=\"sci\">\n",
 
         tagClose: "</syntaxhighlight>",
 
         tagClose: "</syntaxhighlight>",
 
         sampleText: "code here"
 
         sampleText: "code here"
Line 157: Line 254:
 
// Code
 
// Code
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'code',
+
         imageId: 'mw-customeditbutton-Code',
 
         imageFile: '/buttons/code.png',
 
         imageFile: '/buttons/code.png',
 
         speedTip: "Code",
 
         speedTip: "Code",
Line 167: Line 264:
 
// Preformatted
 
// Preformatted
 
mw.toolbar.addButton({
 
mw.toolbar.addButton({
         imageId: 'pre',
+
         imageId: 'mw-customeditbutton-Pre',
 
         imageFile: '/buttons/pre.png',
 
         imageFile: '/buttons/pre.png',
 
         speedTip: "Preformatted",
 
         speedTip: "Preformatted",
 
         tagOpen: "<pre>",
 
         tagOpen: "<pre>",
 
         tagClose: "</pre>",
 
         tagClose: "</pre>",
        sampleText: "code here"
 
});
 
 
// Redirect
 
mw.toolbar.addButton({
 
        imageId: 'Redirect',
 
        imageFile: '/buttons/redirect.png',
 
        speedTip: "Redirect",
 
        tagOpen: "#REDIRECT [[",
 
        tagClose: "]]",
 
 
         sampleText: "code here"
 
         sampleText: "code here"
 
});
 
});

Revision as of 21:33, 27 October 2016


/* Any JavaScript here will be loaded for all users on every page load. */

// Underscore
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Underscore',
        imageFile: '/buttons/FormatUnderscore.png',
        speedTip: "Underscore",
        tagOpen: "<u>",
        tagClose: "</u>",
        sampleText: "Text here"
});

// Strikethrough
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Strikethrough',
        imageFile: '/buttons/FormatStrike.png',
        speedTip: "Strikethrough",
        tagOpen: "<strike>",
        tagClose: "</strike>",
        sampleText: "Text here"
});

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

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

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

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

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

// Quote
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Quote',
        imageFile: 'http://wiki.sierrahelp.com/buttons/Quote.png',
        speedTip: "Quote",
        tagOpen: "<div class=\"Quote\">\n{{Quote|Attrib = \n}}\n",
        tagClose: "\n</div>",
        sampleText: "Quoted text here"
});

// Alert
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Alert',
        imageFile: '/buttons/Red.png',
        speedTip: "Alert",
        tagOpen: "<span class=\"Alert\">",
        tagClose: "</span>",
        sampleText: "Text here"
});

// Inactive
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Inactive',
        imageFile: '/buttons/Gray.png',
        speedTip: "Inactive",
        tagOpen: "<span class=\"Inactive\">",
        tagClose: "</span>",
        sampleText: "Text here"
});

// Add Reference
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Reference',
        imageFile: '/buttons/Reference.png',
        speedTip: "Add Reference",
        tagOpen: "<ref>",
        tagClose: "</ref>",
        sampleText: "Text here"
});

// Wikipedia Link
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Wikipedia',
        imageFile: '/buttons/Wikipedia.png',
        speedTip: "Wikipedia Link",
        tagOpen: "[[w:|",
        tagClose: "]]",
        sampleText: "Text here"
});

// Redirect
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Redirect',
        imageFile: '/buttons/Redirect.png',
        speedTip: "Redirect",
        tagOpen: "#REDIRECT [[",
        tagClose: "]]",
        sampleText: "code here"
});

// Superscript
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Superscript',
        imageFile: '/buttons/Superscript.png',
        speedTip: "Superscript",
        tagOpen: "<sup>",
        tagClose: "</sup>",
        sampleText: "Text here"
});

// Subscript
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Subscript',
        imageFile: '/buttons/Subscript.png',
        speedTip: "Subscript",
        tagOpen: "<sub>",
        tagClose: "</sub>",
        sampleText: "Text here"
});

// Half
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Half',
        imageFile: '/buttons/Half.png',
        speedTip: "Half",
        tagOpen: "½",
        tagClose: "",
        sampleText: ""
});

// Quarter
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Quarter',
        imageFile: '/buttons/Quarter.png',
        speedTip: "Quarter",
        tagOpen: "¼",
        tagClose: "",
        sampleText: ""
});

// Copyright
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Copyright',
        imageFile: '/buttons/Copyright.png',
        speedTip: "Copyright",
        tagOpen: "©",
        tagClose: "",
        sampleText: ""
});

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

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

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

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

// Add template
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-NewTemplate',
        imageFile: '/buttons/Template.png',
        speedTip: "Add template",
        tagOpen: "{{",
        tagClose: "}}",
        sampleText: "Template Name"
});
 
// AGI Code
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-AGI',
        imageFile: '/buttons/AGI.png',
        speedTip: "AGI Code",
        tagOpen: "<div class=\"CodeBlockHeader\">AGI Code:</div>\n<syntaxhighlight lang=\"agi\">\n",
        tagClose: "</syntaxhighlight>",
        sampleText: "code here"
});

// SCI Code
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-SCI',
        imageFile: '/buttons/SCI.png',
        speedTip: "SCI Code",
        tagOpen: "<div class=\"CodeBlockHeader\">SCI Code:</div>\n<syntaxhighlight lang=\"sci\">\n",
        tagClose: "</syntaxhighlight>",
        sampleText: "code here"
});

// Code
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Code',
        imageFile: '/buttons/code.png',
        speedTip: "Code",
        tagOpen: "<code>",
        tagClose: "</code>",
        sampleText: "code here"
});

// Preformatted
mw.toolbar.addButton({
        imageId: 'mw-customeditbutton-Pre',
        imageFile: '/buttons/pre.png',
        speedTip: "Preformatted",
        tagOpen: "<pre>",
        tagClose: "</pre>",
        sampleText: "code here"
});