Difference between revisions of "MediaWiki:Editbar.js"

m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
/**
 
* Remove buttons from default edit menu.
 
*/
 
function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {
 
    if (imageId == 'mw-editbutton-media' || imageId == 'mw-editbutton-hr')
 
        return;
 
 
    mwEditButtons.push({
 
        'imageId' : imageId,
 
        'imageFile' : imageFile,
 
        'speedTip' : speedTip,
 
        'tagOpen' : tagOpen,
 
        'tagClose' : tagClose,
 
        'sampleText' : sampleText
 
    });
 
}
 
 
 
/**
 
/**
 
  * Adds a custom button.
 
  * Adds a custom button.
Line 34: Line 17:
 
if (mwCustomEditButtons) {
 
if (mwCustomEditButtons) {
 
     addCustomButton('images/0/07/Editbar_Underline.png', 'Underlined text', '{{Underline|', '}}', 'Underlined text');
 
     addCustomButton('images/0/07/Editbar_Underline.png', 'Underlined text', '{{Underline|', '}}', 'Underlined text');
 +
    addCustomButton('images/c/c4/Editbar_Line-Through.png', 'Line-Through text', '{{Line-Through|', '}}', 'Line-Through text');
 
     addCustomButton('images/9/9f/Editbar_Line_Break.png', 'Line Break', '{{Line Break}}', '', '');
 
     addCustomButton('images/9/9f/Editbar_Line_Break.png', 'Line Break', '{{Line Break}}', '', '');
     addCustomButton('images/f/fe/Editbar_Category.png', 'Category', '{{Category|', '}}' , 'Category Name');
+
     addCustomButton('images/f/fe/Editbar_Category.png', 'Categorize', '{{Categorize|', '}}' , 'Category Name');
 
     addCustomButton('images/a/a0/Editbar_Redirect.png', 'Redirect', '#REDIRECT [[', ']]', 'Target page name');
 
     addCustomButton('images/a/a0/Editbar_Redirect.png', 'Redirect', '#REDIRECT [[', ']]', 'Target page name');
 
}
 
}

Latest revision as of 12:22, 29 April 2010

/**
 * Adds a custom button.
 */
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {
    mwCustomEditButtons.push({
        'imageFile' : imageFile,
        'speedTip' : speedTip,
        'tagOpen' : tagOpen,
        'tagClose' : tagClose,
        'sampleText' : sampleText
    });
}

/**
 * Add extra buttons to the edit menu.
 */
if (mwCustomEditButtons) {
    addCustomButton('images/0/07/Editbar_Underline.png', 'Underlined text', '{{Underline|', '}}', 'Underlined text');
    addCustomButton('images/c/c4/Editbar_Line-Through.png', 'Line-Through text', '{{Line-Through|', '}}', 'Line-Through text');
    addCustomButton('images/9/9f/Editbar_Line_Break.png', 'Line Break', '{{Line Break}}', '', '');
    addCustomButton('images/f/fe/Editbar_Category.png', 'Categorize', '{{Categorize|', '}}' , 'Category Name');
    addCustomButton('images/a/a0/Editbar_Redirect.png', 'Redirect', '#REDIRECT [[', ']]', 'Target page name');
}