MediaWiki:Common.js

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

// Remove default edit toolbar buttons.Image button remains. function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) { if ((imageId=="mw-editbutton-math")    ||    (imageId=="mw-editbutton-media")    ||    (imageId=="mw-editbutton-bold")     ||    (imageId=="mw-editbutton-italic")   ||    (imageId=="mw-editbutton-link")     ||     // internal page link    (imageId=="mw-editbutton-extlink")  ||    // URL    (imageId=="mw-editbutton-headline") ||   // Heading 1    (imageId=="mw-editbutton-nowiki")   ||  // no wiki    (imageId=="mw-editbutton-signature")|| // signature    (imageId=="mw-editbutton-hr")         // Single line ) return; mwEditButtons[mwEditButtons.length] = {"imageId": imageId, "imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, "sampleText": sampleText}; }

///// Add custom edit buttons var button = {  /////////////////////////// spacer, to separate button groups "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at block beginning "tagClose": "",     // no text at block end "sampleText": "" // no sample text }; 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", // tooltip text "tagOpen": "[", // text at block beginning "tagClose": "]",     // text at block end (if any) "sampleText": "http://www.bogleheads.org/wiki Bogleheads Wiki" // sample text if nothing selected }; 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.", // tooltip text "tagOpen": "", // text at block beginning	"tagClose": "",     // text at block end (if any) "sampleText": "Main Page" // sample text if nothing selected }; 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 = { // block quote "imageFile": "images/f/fd/Button_blockquote.png", // block quote, 23x22 pixels "speedTip": "Create block of quoted text", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Block of text to quote" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // reference "imageFile": "images/d/d9/Button_Ref.png", // Reference, 23x22 pixels "speedTip": "Add a reference (footnote). Add after References section.", // tooltip text "tagOpen": " ",     // text at block end (if any) "sampleText": "Add a reference (footnote)" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // category "imageFile": "images/1/11/Button_category.png", // category, 23x22 pixels "speedTip": "Categorize the article. Place this at the bottom of the page. Use as many categories as needed.", // tooltip text "tagOpen": "[[Category:", // text at block beginning	"tagClose": "]]",     // text at block end (if any) "sampleText": "Development" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // Heading 1. As an author, Heading 1 is top level. Correctly uses wiki heading 2, leaves H1 alone for wiki page title. "imageFile": "images/f/f6/Button_head_H1.png", // Heading 1, 23x22 pixels "speedTip": "Top level heading. Starts at Level 2. Level 1 is reserved for the page title.", // tooltip text "tagOpen": "==", // text at block beginning "tagClose": "==",     // text at block end (if any) "sampleText": "Top-level heading" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // Header 2. See comments for Header 1. "imageFile": "images/0/04/Button_head_H2.png", // Heading 2, 23x22 pixels "speedTip": "Second level heading. Starts at Level 3 to be consistent with internal wiki use of headings.", // tooltip text "tagOpen": "===", // text at block beginning "tagClose": "===",     // text at block end (if any) "sampleText": "Second-level heading" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // Header 3. See comments for Header 1. "imageFile": "images/b/bb/Button_head_H3.png", // Heading 3, 23x22 pixels "speedTip": "Third level heading. Starts at Level 4 to be consistent with internal wiki use of headings.", // tooltip text "tagOpen": "====", // text at block beginning "tagClose": "====",     // text at block end (if any) "sampleText": "Third-level headline" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // Header 4. See comments for Header 1. "imageFile": "images/d/d9/Button_head_H4.png", // Heading 4, 23x22 pixels "speedTip": "Fourth level heading. Starts at Level 5 to be consistent with internal wiki use of headings.", // tooltip text "tagOpen": "=====", // text at block beginning "tagClose": "=====",     // text at block end (if any) "sampleText": "Fourth-level headline" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // Header 5. See comments for Header 1. "imageFile": "images/7/72/Button_head_H5.png", // Heading 5, 23x22 pixels "speedTip": "Fifth level heading. Starts at Level 6 to be consistent with internal wiki use of headings.", // tooltip text "tagOpen": "======", // text at block beginning "tagClose": "======",     // text at block end (if any) "sampleText": "Sixth-level headline" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; 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", // tooltip text "tagOpen": "'''", // text at block beginning "tagClose": "'''",     // text at block end (if any) "sampleText": "Bold text" // sample text if nothing selected }; 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", // tooltip text "tagOpen": "''", // text at block beginning "tagClose": "''",     // text at block end (if any) "sampleText": "Italic text" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // underline "imageFile": "images/f/fd/Button_underline.png", // Underline, 23x22 pixels "speedTip": "Underline text", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Underline text" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // strike-out "imageFile": "images/9/92/Button_strike_text.png", // Strike-out, 23x22 pixels "speedTip": "Strike-out text", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Strike-out text" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // subscript "imageFile": "images/a/aa/Button_sub_letter.png", // Subscript, 23x22 pixels "speedTip": "Subscript text", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Subscript text" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // superscript "imageFile": "images/6/6a/Button_sup_letter.png", // Superscript, 23x22 pixels "speedTip": "Superscript text", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Superscript text" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // align left "imageFile": "images/e/ea/Button_align_left.png", // align left, 23x22 pixels "speedTip": "Align text left", // tooltip text "tagOpen": ' ', // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Align text left" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // align center "imageFile": "images/f/f7/Button_align_center.png", // align center, 23x22 pixels "speedTip": "Align text center", // tooltip text "tagOpen": ' ', // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Align text center" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // align right "imageFile": "images/a/a5/Button_align_right.png", // align right, 23x22 pixels "speedTip": "Align paragraph right", // tooltip text "tagOpen": ' ', // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "Align text right" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // bulleted list "imageFile": "images/c/c4/Btn_toolbar_bulleted_list.png", // Bulleted list, 23x22 pixels "speedTip": "Bulleted list", // tooltip text "tagOpen": "*", // text at block beginning "tagClose": "",     // text at block end (if any) "sampleText": "Bulleted list" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // numbered list "imageFile": "images/b/b2/Btn_toolbar_Numbered_List.png", // Numbered list, 23x22 pixels "speedTip": "Numbered list", // tooltip text "tagOpen": "#", // text at block beginning "tagClose": "",     // text at block end (if any) "sampleText": "Numbered list" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // header, full line across page "imageFile": "images/0/0d/Button_hr.png", // header, 23x22 pixels "speedTip": "Draws full line across page, not to be confused with heading. Use sparingly.", // tooltip text "tagOpen": '\n\n', // text at block beginning "tagClose": "",     // text at block end (if any) "sampleText": "" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // signature "imageFile": "images/5/51/Button_signature.png", // signature, 23x22 pixels "speedTip": "Signature. Enters your username with time and date. Select Show Preview to see effect.", // tooltip text "tagOpen": "--\~\~\~\~", // text at block beginning "tagClose": "",     // text at block end (if any) "sampleText": "" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = {  /////////////////////////// spacer, separate button groups (wiki uses full block) "imageFile": "images/b/b1/Button_spacer.png", // white image, 12x22 pixels "speedTip": "", // no tooltip "tagOpen": "", // no text at beginning "tagClose": "",     // no text at the end "sampleText": "" // no sample text }; mwCustomEditButtons.push(button);

var button = { // No wiki "imageFile": "images/8/82/Nowiki_icon.png", // No wiki, 23x22 pixels "speedTip": "Forces text to be shown as-is. Prevents wiki from misinterpreting text as a formatting command.", // tooltip text "tagOpen": " ", // text at block beginning "tagClose": " ",     // text at block end (if any) "sampleText": "<!- display this text -->" // sample text if nothing selected }; mwCustomEditButtons.push(button);

var button = { // redirect "imageFile": "images/c/c8/Button_redirect.png", // redirect, 23x22 pixels "speedTip": "Redirect to a different page.", // tooltip text "tagOpen": "#REDIRECT ", // text at block beginning	"tagClose": "",     // text at block end (if any) "sampleText": "Different page" // sample text if nothing selected }; mwCustomEditButtons.push(button);