User:DeirdreAnne/custombuttons.js

From Wikisource
Jump to navigation Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

//<nowiki>
// == CUSTOM EDIT BUTTONS ==

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "spm",
     "tagOpen": '{{block center|<poem style="font-size:smaller">',
     "tagClose": '</poem>}}',
     "sampleText": ""};
};
 
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/7/7f/Button_link_to_Wikipedia.png",
     "speedTip": "Wikipedia link",
     "tagOpen": '[[w:',
     "tagClose": '|]]',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/5/56/Button_big.png",
     "speedTip": "Larger",
     "tagOpen": '{{larger|',
     "tagClose": '}}',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "Sm ",
     "tagOpen": '{{smaller|',
     "tagClose": '}}',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "f/s ",
     "tagOpen": '{{'+'subst:ucfirst:{{'+'subst:lc:',
     "tagClose": '}}}}',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png",
     "speedTip": "Centre text",
     "tagOpen": '{{center|',
     "tagClose": '}}',
     "sampleText": ""};
};
 
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png",
     "speedTip": "Author link",
     "tagOpen": '[[Author:',
     "tagClose": '|]]',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png",
     "speedTip": "Reference",
     "tagOpen": '<ref>',
     "tagClose": '</ref>',
     "sampleText": ""};
};

// === SMALL CAPS BUTTON === /*duplicate, see below*/ 
/*if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "sc ",
     "tagOpen": '{{sc|',
     "tagClose": '}}',
     "sampleText": ""};
};*/
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "hws ",
     "tagOpen": '{{hyphenated word start|',
     "tagClose": '|}}',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "hwe ",
     "tagOpen": '{{hyphenated word end|',
     "tagClose": '|}}',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "br ",
     "tagOpen": '<br>',
     "tagClose": '',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/0/06/Tag_green.png",
     "speedTip": "section begin",
     "tagOpen": '<section begin="',
     "tagClose": '" />',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/d/dd/Tag_red.png",
     "speedTip": "section end",
     "tagOpen": '<section end="',
     "tagClose": '" />',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "pg ",
     "tagOpen": '<pages index=".djvu" from= to= fromsection="" tosection=""',
     "tagClose": '/>',
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "bk ",
     "tagOpen": "''[[",
     "tagClose": "]]''",
     "sampleText": ""};
};
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "A/L ",
     "tagOpen": '{{anchor link|anchor=',
     "tagClose": '|pageno=}}',
     "sampleText": ""};
};
 
 
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/c/cf/Left.png",
     "speedTip": "Force s/n",
     "tagOpen": '{{Force sidenote|left|',
     "tagClose": '}}',
     "sampleText": ""};
};

// === JUST AN EXAMPLE === /*copied from User:Billinghurst/monobook.js for an example*/ 
if (isIrishBio) {
  if (mwCustomEditButtons) {
    mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "",
     "speedTip": "IBr ",
     "tagOpen": '{{IrishBio ref|page=|ref=',
     "tagClose": '}}',
     "sampleText": ""};
  };
};
 
// === Small Caps button
if (mwCustomEditButtons) {
  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "//upload.wikimedia.org/wikipedia/commons/4/4e/Button_romain.png",
     "speedTip": "Small caps",
     "tagOpen": '{{small caps|',
     "tagClose": '}}',
     "sampleText": ""};
};
//</nowiki>