Wikisource:Tools and scripts/More editing buttons

From Wikisource

Jump to: navigation, search

Contents

[edit] Instructions

  • How to install:
  1. Go to you Monobook.js page, located here
  2. Click the edit this page button, and copy the code highlighted below and paste it in your monobook page. The code starts with if and ends with };.
  3. Save the page.
  4. Bypass your browser's cache as instructed in your Monobook page.
  5. Go to a random page and click the edit this page button. You should see the new edit buttons added to your editing toolbar.
  • How to use: Simply highlight a text and click the button. Simple.

Feel free to use the code to design new edit buttons, just be sure to add them in this page for other editors to use. Thanks!

[edit] List of extra buttons

[edit] Strikethrough

Button link: Button strike.png
What it does: Crosses out highlighted text. Converts "apple" to "<s>apple</s>", which looks like "apple".

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png",
     "speedTip": "Strikethrough",
     "tagOpen": '<s>',
     "tagClose": '</s>',
     "sampleText": "Insert text here"};
};

[edit] Underline

Button link: Button underline.png
What it does: Underlines highlighted text. Converts "apple" to "<u>apple</u>", which looks like "apple".

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/fd/Button_underline.png",
     "speedTip": "Underline",
     "tagOpen": '<u>',
     "tagClose": '</u>',
     "sampleText": "Insert text here"};
};

[edit] Link to Wikipedia article

Button link: Button link to Wikipedia.png
What it does: Creates a link from the highlighted text to the respective Wikipedia article entry. Converts "apple" to "[[w:apple|]]", which looks like "apple". Allows the reader to research biographies, events, descriptions and other information when reading our Wikisource texts. This can also be substituted to link to any other Wikimedia sister project by simply changing the piped link structure in the code.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/7f/Button_link_to_Wikipedia.png",
     "speedTip": "Wikipedia link",
     "tagOpen": '[[w:',
     "tagClose": '|]]',
     "sampleText": "Insert link here"};
};

[edit] Link to Wiktionary entry

Button link: Button wikification.png
What it does: Creates a link from the highlighted text to the respective Wiktionary entry. Converts "apple" to "[[wikt:apple|]]", which looks like "apple". Allows the reader to research the meanings of terms on our Wikisource texts. Useful for unusual or ancient terms. This can also be substituted to link to any other Wikimedia sister project by simply changing the piped link structure in the code.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0d/Button_wikification.png",
     "speedTip": "Wiktionary link",
     "tagOpen": '[[wikt:',
     "tagClose": '|]]',
     "sampleText": "Insert link here"};
};

[edit] Link to Author page on Wikisource

Button link: Button biocitas.png
What it does: Creates a link from the highlighted text to the respective author page. Converts "William Shakespeare" to "[[Author:William Shakespeare|]]", which looks like "William Shakespeare". Notice that the Author: prefix is not visible. This can be changed by removing the " | " from the link.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png",
     "speedTip": "Author link",
     "tagOpen": '[[Author:',
     "tagClose": '|]]',
     "sampleText": "Insert link here"};
};

[edit] Link to a subpage

Button link: Button Link DifferentName.png
What it does: Creates a link from the highlighted text to a subpage from the current page. On the page The Double Dealer, converts the text "Act I" to "[[/Act I|]]", which looks like "/Act I". The actual Wikisource link would be The Double Dealer/Act I.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_Link_DifferentName.png",
     "speedTip": "Subpage",
     "tagOpen": '[[/',
     "tagClose": '|]]',
     "sampleText": "Insert link here"};
};

[edit] Poem

Button link: Button definition list.png
What it does: Converts highlighted text to poem format, allowing for better representation of the original work.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/d/d3/Button_definition_list.png",
     "speedTip": "Poem",
     "tagOpen": '<poem>',
     "tagClose": '</poem>',
     "sampleText": "Insert text here"};
};

[edit] Align text left

Button link: Button align left.png
What it does: Aligns highlighted text to the left-hand side of the screen.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/ea/Button_align_left.png",
     "speedTip": "Align Left",
     "tagOpen": '<div style="text-align:left">',
     "tagClose": '</div>',
     "sampleText": "Insert text here"};
};

[edit] Align text center

Button link: Button center.png
What it does: Centers text accross the screen.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png",
     "speedTip": "Centered text",
     "tagOpen": '<center>',
     "tagClose": '</center>',
     "sampleText": "Insert text here"};
};

[edit] Align text right

Button link: Button align right.png
What it does: Aligns highlighted text to the right-hand side of the screen.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a5/Button_align_right.png",
     "speedTip": "Align Right",
     "tagOpen": '<div style="text-align:right">',
     "tagClose": '</div>',
     "sampleText": "Insert text here"};
};

[edit] Big text

Button link: Button big.png
What it does: Converts highlighted text to a bigger font size. Converts "big" to "<big>big</big>", which looks like "big". Useful for headers and title pages of works.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/56/Button_big.png",
     "speedTip": "Big",
     "tagOpen": '<big>',
     "tagClose": '</big>',
     "sampleText": "Insert text here"};
};

Button_small.png

[edit] Small text

Button link: Button small.png
What it does: Converts highlighted text to a smaller font size.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/58/Button_small.png",
     "speedTip": "Small",
     "tagOpen": '<small>',
     "tagClose": '</small>',
     "sampleText": "Insert text here"};
};

[edit] Font size

Button link: Button paragraphe 5.png
What it does: This converts highlighted text to a specific font size which is customizable by changing the size number.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_paragraphe_5.png",
     "speedTip": "Font size",
     "tagOpen": '<font size="5">',
     "tagClose": '</font>',
     "sampleText": "Insert text here"};
};

[edit] Add notes and references

Button link: Button reflink.png
What it does: Converts highlighted text into a footnote. Converts "This is a footnote." to "<ref>This is a footnote.</ref>", which looks like "[1]". To show the footnote, place "<references/>" anywhere on the page (though usually at the end), which looks like this:

  1. This is a footnote.
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png",
     "speedTip": "Reference",
     "tagOpen": '<ref>',
     "tagClose": '</ref>',
     "sampleText": "Insert text here"};
};

[edit] Indentation

Button link: Button shifting.png
What it does: Adds an indentation to the first sentence of a paragraph. To use, simply put the cursor at the beginning of the paragraph and press the button link.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/8e/Button_shifting.png",
     "speedTip": "Insert indent",
     "tagOpen": '<div style="text-indent: 3em">',
     "tagClose": '',
     "sampleText": ""};
};

[edit] Noinclude

Button link: Button noinclude.png
What it does: Wraps the text in <noinclude> tags.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/d/d5/Button_noinclude.png",
     "speedTip": "Noinclude",
     "tagOpen": '<noinclude>',
     "tagClose": '</noinclude>',
     "sampleText": "Insert text here"};
};

[edit] Section begin & end

begin

Button link: Tag green.png
What it does: Creates a<section begin=LABEL /> tag for use in text transclusion.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/06/Tag_green.png",
     "speedTip": "section begin",
     "tagOpen": '<section begin=',
     "tagClose": ' />',
     "sampleText": ""};
};
end

Button link: Tag red.png
What it does: Creates a<section end=LABEL /> tag for use in text transclusion.

if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/d/dd/Tag_red.png",
     "speedTip": "section begin",
     "tagOpen": '<section end=',
     "tagClose": ' />',
     "sampleText": ""};
};