Fandom

Wikia Developers Wiki

OasisToolbarButtons

888pages on
this wiki
Add New Page
Talk20 Share
This script is for PERSONAL use only!

You are free to install this script for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:Common.js or MediaWiki:Wikia.js), as it would violate Fandom's Terms of Use. (See the customization policy)

Ambox octogon stopIt is possible to customise your Oasis Toolbar by clicking the customise button provided by Wikia. This script does work but it is not compatible with Wikia's customisation feature; customising your toolbar with Wikia's feature will cause all the buttons created by this script to disappear. This script also does not perform overflow handling, if there are too many buttons then things will simply fall off. There do not appear to be any buttons that this script provides that Wikia's built-in feature does not.

The OasisToolbarButtons script adds commonly used action buttons (like "edit", "move", "history" etc) to Oasis' bottom toolbar for easy access.

Features

Adds buttons to bottom toolbar
Depending on user choice, either only a "Purge" button is added to the left of "My Tools" or all of the following:
  • "Edit"/"View source"
  • "Edit with form" (if applicable)
  • "Add topic" (on talk pages)
  • "Rename"
  • "Protect"/"Unprotect" (if user has sysop privileges)
  • "Delete"/"Undelete" (if user has sysop privileges)
  • "Purge"
  • "History"
  • "What links here"
Multi-language support
Supports ISO 639-1 localization (see "Adding translations").

Usage

Installation

If you would like to use the script with the default options, simply add the following either to your global.js on Community Central (to make the script available on all wikis) or to Special:MyPage/wikia.js on specific wikis:

importScriptPage('OasisToolbarButtons/code.js', 'dev');

If you would like to change the options, insert the following instead:

var OasisToolbarButtonsConfig = { 
   purgeOnly: false,
   userLang: true
};
importScriptPage('OasisToolbarButtons/code.js', 'dev');

For an explanation of the available options, see "Options" below.

Options

purgeOnly
If set to true, only a "Purge" button is inserted rather than all available buttons.
userLang
By default, the script tries to display messages in the following languages:
  1. The user's language (specified in his/her preferences)
  2. The wiki's content language
  3. English if there are no messages in a desired language.
You can disable this by setting the userLang option to false.
Example:
var OasisToolbarButtonsConfig = { 
    userLang: false
};
langCode
Localized messages can be added using the language code as a key (e.g. OasisToolbarButtonsConfig.en) and then creating an object for the messages. See example below for how to override the default messages used for the English language.
Example:
var OasisToolbarButtonsConfig = { 
   'en': {
      addTopic: "Add topic",
      edit: "Edit",
      editwithform: "form",
      deleteThis: "Delete",
      history: "History",
      move: "Rename",
      protect: "Protect",
      purge: "Purge",
      undelete: "Undelete",
      unprotect: "Unprotect",
      viewsource: "View source",
      whatlinkshere: "What links here"
   }
}

Adding translations

The following messages are used by the script:

  • "Add topic"
  • "Delete" / "Undelete"
  • "Edit" / "(form)" / "View source"
  • "History"
  • "Rename"
  • "Protect" / "Unprotect"
  • "Purge"
  • "What links here"

If you would like to help out, please post translations for these on the script's talk page (or add them to MediaWiki:OasisToolbarButtons/code.js directly if you are comfortable with doing so). Please keep in mind that the text needs to be sufficiently short that there are no collision issues with the default toolbar buttons.

Updates

20 November 2011
Jrooksjr: Added Portugese and Brazilian Portugese translations.
19 November 2011
MarkosBoss: Added (without "EditWithForm") Polish translation.
22 May 2011
Porter21: Small change to address warnings which appeared in the error console of certain browsers.
15 March 2011
Porter21: Changed "protectPurgeOnly" option to "purgeOnly" as "protect" is now available via standard toolbar customization.
3 February 2011
Porter21: Made changes to avoid issues with Wikia's customizable toolbar.
Porter21: Added config option to only insert "protect" and "purge" buttons (which are as-of-yet unavailable for Wikia's customizable toolbar).
24 January 2011
Porter21: Reduce file size.
13 January 2011
Porter21: Made script work with Internet Explorer.
4 January 2011
Grunny: Fixed bug with URI encoding.
14 December 2010
Porter21: Tie execution to jQuery's "ready" event rather than MediaWiki's.
8 December 2010
Porter21: Added "add topic" button for talk pages.
Porter21: Optimization.
5 December 2010
Porter21: Added French and Spanish translations.
Porter21: Combined "Edit" and "Edit with form" buttons to conserve space.
27 November 2010
Porter21: Optimization.
25 November 2010
Porter21: Created.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.