MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ // (space) Bold, italic, underline, strike, sub, super (space) bullet list, number list (space) left, center, right (space) H1-H5 (space) URL page (space) reference, redirect

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // bold, a repeat of the existing toolbar but accessible from common.js	"imageFile": "images/e/e2/Button_bold.png", // Bold, 23x22 pixels "speedTip": "Bold text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "'''", // the text to use to mark the beginning of the block "tagClose": "'''",     // the text to use to mark the end of the block (if any) "sampleText": "Bold text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // italic, a repeat of the existing toolbar but accessible from common.js	"imageFile": "images/1/1d/Button_italic.png", // Italic, 23x22 pixels "speedTip": "Italic text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "''", // the text to use to mark the beginning of the block "tagClose": "''",     // the text to use to mark the end of the block (if any) "sampleText": "Italic text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // underline "imageFile": "images/f/fd/Button_underline.png", // Underline, 23x22 pixels "speedTip": "Underline text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Underline text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // strike-out "imageFile": "images/9/92/Button_strike_text.png", // Strike-out, 23x22 pixels "speedTip": "Strike-out text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Strike-out text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // subscript "imageFile": "images/a/aa/Button_sub_letter.png", // Subscript, 23x22 pixels "speedTip": "Subscript text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Subscript text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // superscript "imageFile": "images/6/6a/Button_sup_letter.png", // Superscript, 23x22 pixels "speedTip": "Superscript text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Superscript text" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // align left "imageFile": "images/e/ea/Button_align_left.png", // align left, 23x22 pixels "speedTip": "Align paragraph left", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Align paragraph left" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // align center "imageFile": "images/f/f7/Button_align_center.png", // align center, 23x22 pixels "speedTip": "Align paragraph center", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Align paragraph center" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // align right "imageFile": "images/a/a5/Button_align_right.png", // align right, 23x22 pixels "speedTip": "Align paragraph right", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Align paragraph right" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { "imageFile": "images/f/fd/Button_blockquote.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Insert block of quoted text", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ", // the text to use to mark the beginning of the block "tagClose": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Block of text to quote" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // bulleted list "imageFile": "images/c/c4/Btn_toolbar_bulleted_list.png", // Bulleted list, 23x22 pixels "speedTip": "Bulleted list", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "*", // the text to use to mark the beginning of the block "tagClose": "",     // the text to use to mark the end of the block (if any) "sampleText": "Bulleted list" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // numbered list "imageFile": "images/b/b2/Btn_toolbar_Numbered_List.png", // Numbered list, 23x22 pixels "speedTip": "Numbered list", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "#", // the text to use to mark the beginning of the block "tagClose": "",     // the text to use to mark the end of the block (if any) "sampleText": "Numbered list" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // Header 1. *** As an author, Heading 1 is top level. Correctly uses wiki heading 2, leaves H1 alone for wiki page title. "imageFile": "images/2/2f/Button_head_A1.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Top level heading. Starts at Level 2. Level 1 is reserved for the page title.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "==", // the text to use to mark the beginning of the block "tagClose": "==",     // the text to use to mark the end of the block (if any) "sampleText": "Top-level heading" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // Header 2. *** Correctly uses wiki heading 3, see comments for Header 1. "imageFile": "images/c/c7/Atwo.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Second level heading. Starts at Level 3 to be consistent with internal wiki use of headings.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "===", // the text to use to mark the beginning of the block "tagClose": "===",     // the text to use to mark the end of the block (if any) "sampleText": "Second-level heading" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // Header 3. *** Correctly uses wiki heading 4, see comments for Header 1. "imageFile": "images/6/6b/A3.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Third level heading. Starts at Level 4 to be consistent with internal wiki use of headings.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "====", // the text to use to mark the beginning of the block "tagClose": "====",     // the text to use to mark the end of the block (if any) "sampleText": "Third-level headline" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // Header 4. *** Correctly uses wiki heading 5, see comments for Header 1. "imageFile": "images/7/7f/A4.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Fourth level heading. Starts at Level 5 to be consistent with internal wiki use of headings.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "=====", // the text to use to mark the beginning of the block "tagClose": "=====",     // the text to use to mark the end of the block (if any) "sampleText": "Fourth-level headline" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // Header 5. *** Correctly uses wiki heading 6, see comments for Header 1. "imageFile": "images/d/d5/A5.png", // image to be shown on the button (may be a full URL too), 23x22 pixels "speedTip": "Fifth level heading. Starts at Level 6 to be consistent with internal wiki use of headings.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "======", // the text to use to mark the beginning of the block "tagClose": "======",     // the text to use to mark the end of the block (if any) "sampleText": "Sixth-level headline" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // URL "imageFile": "images/f/ff/Button_URL.png", // URL, 23x22 pixels "speedTip": "External link. Provide link then text to display. Example: http://www.bogleheads.org The Bogleheads wiki", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "[", // the text to use to mark the beginning of the block "tagClose": "]",     // the text to use to mark the end of the block (if any) "sampleText": "http://www.bogleheads.org/wiki Bogleheads Wiki" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // internal wiki page link "imageFile": "images/2/27/Button_PageLink.png", // wiki page link, 23x22 pixels "speedTip": "Link to a wiki page. Example: Main Page. Or, add '|'+ text like: Main Page | Wiki to display Wiki.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "", // the text to use to mark the beginning of the block	"tagClose": "",     // the text to use to mark the end of the block (if any) "sampleText": "Main Page" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // table "imageFile": "images/6/60/Button_insert_table.png", "speedTip": "Insert a table", "tagOpen": '\n{| class="wikitable"\n|-\n', "tagClose": "\n|}", "sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"}; mwCustomEditButtons.push(button);

var button = { // spacer, provides separation between button groups (wiki uses full block anyway) "imageFile": "images/b/b1/Button_spacer.png", // button image, 6x22 pixels, supply image file since it's expected "speedTip": "", // no tooltip on mouse hover "tagOpen": "", // no text at beginning of the block "tagClose": "",     // no text at the end of the block (if any) "sampleText": "" // no sample text to place inside block }; mwCustomEditButtons.push(button);

var button = { // reference "imageFile": "images/7/79/Button_reflink.png", // Citation, 23x22 pixels "speedTip": "Add a reference (footnote). Add after References section.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": " ",     // the text to use to mark the end of the block (if any) "sampleText": "Add a reference (footnote)." // the sample text to place inside the block }; mwCustomEditButtons.push(button);

var button = { // redirect "imageFile": "images/c/c8/Button_redirect.png", // redirect, 23x22 pixels "speedTip": "Redirect to a different page.", // text shown in a tooltip when hovering the mouse over the button "tagOpen": "#REDIRECT ", // the text to use to mark the beginning of the block	"tagClose": "",     // the text to use to mark the end of the block (if any) "sampleText": "Different page" // the sample text to place inside the block }; mwCustomEditButtons.push(button);

// Code below is to remove default edit toolbar buttons. Currently commented out, but left here for possible future use. /* function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) { if ((imageId=="mw-editbutton-math") || (imageId=="mw-editbutton-media")) return; mwEditButtons[mwEditButtons.length] = {"imageId": imageId, "imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, "sampleText": sampleText}; }