Extension:Gadgets/de

Die Gadgets-Erweiterung stellt einen Weg für Benutzer zur Verfügung, um JavaScript oder CSS-basierte "Gadgets" auszuwählen, die andere Wiki-Benutzer zur Verfügung stellen. Gadgets werden aus JavaScript und/oder CSS Stückchen zusammengesetzt, die auf Seiten im MediaWiki Namensraum vorhanden sind. Jedes Gadget wird durch eine Linie in der MediaWiki:Gadgets-Definition definiert, einen Namen und Beschreibung für das Gadget, und eine Liste des JS und der CSS Schnipsel zur Verfügung stellend, die es verwendet (siehe Abschnitt Verwendung unten).

Da sich Gadgets im MediaWiki-Namensraum (die Liste der Definition des Gadgets als auch die tatsächlichen Code-Schnipsel) befinden, können nur Sysops (aka Wiki-Admins) den Code bearbeiten. Dies ist, wie es sein soll: Nur von der Wiki-Gemeinschaft besonders vertraute Benutzer sollten im Stande sein, JavaScript-Code zu editieren, der von anderen Benutzern verwendet wird, da JavaScript leicht verwendet werden kann, um Rechnungen zu entführen oder Leuten zu spionieren.

Installieren
Entweder laden oder navigieren Sie zu dem Gadgets Ordner im SVN Lager. Kopieren Sie das Gadgets-Verzeichnis in den Ordner Ihrer MediaWiki-Installation. Dann fügen Sie die folgende Zeile in Ihrer LocalSettings.php Datei (am Ende) ein:

Verwendung
The list of available gadgets is defined on MediaWiki:Gadgets-definition. Gadgets defined there show up in the "Gadgets" section of Special:Preferences, so users can pick the gadgets they would like to use. An overview of the gadgets defined by MediaWiki:Gadgets-definition is also shown on Special:Gadgets, along with links to the respective system messages, for easy editing.

Format
Each line in MediaWiki:Gadgets-definition that starts with one or more "*" (asterisks) characters defines a gadget; it must have the following form: * gadget_name [options (can be omitted)] | page names

The first field (" gadget_name " in the example) is the gadget's internal name, and references a system message (MediaWiki:Gadget- gadget_name  in the example) that contains a short description of the gadget, using wiki syntax.

The internal name is used as part of the name of a form field and must follow the rules defined for NAME attribute values. This means it must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Options-Format: [option1 | option2 | ... optionN] whitespace can be omitted. Single option can either consist of single option name (in this case it is a flag option), or contain a comma-separated list of values: option = value1, value2, value3

Beispiele: * mygadget|mygadget.js|mygadget.css or * mygadget[ResourceLoader]|mygadget.js|mygadget.css or * mygadget[rights=foo,bar]|mygadget.js|mygadget.css or * mygadget[ ResourceLoader | rights=foo, bar ] | mygadget.js | mygadget.css

Optionen
You can specify extra dependencies for your gadgets, for example: * mygadget[ResourceLoader|dependencies=jquery.ui, jquery.effects.clip]|mygadget.js|mygadget.css

Here, we ask ResourceLoader to load modules jquery.ui and jquery.effects.clip with mygadget. Note that gadgets can't depend on scripts from pages, static files or external URLs, only on modules already registered in ResourceLoader.

To make the gadget available only to users with appropriate permissions, set the rights option. For example, * ImprovedDeletion [rights=delete] | ImprovedDeletion.js makes the gadget available only to users who can actually delete pages. Note that restrictions are based on permissions, not user groups like administrators or bureaucrats. Here are some real examples: * modrollback[ResourceLoader|rights=rollback]|modrollback.js * UTCLiveClock[ResourceLoader|rights=purge]|UTCLiveClock.js * Ajax_sysop[ResourceLoader|rights=patrol,rollback,markbotedits,delete]|Ajax_sysop.js

ResourceLoader Unterstützung
All gadget's CSS is always loaded via the ResourceLoader. However, older JavaScript is often incompatible with RL, so every gadget must be explicitly marked as compatible in order to have its scripts loaded by RL. Otherwise, plain old &lt;script src="/w/index.php?title=MediaWiki:Gadget- gadget_name.js &action=raw"&gt; will be used.

Every gadget that at least partially uses ResourceLoader (that is, that has styles or comatible scripts) has its own RL module. The modules are named ext.gadget.&lt;gadget name&gt;.

Seiten
The remaining fields on the line refer to the JavaScript or CSS code that makes up the gadget, contained in system messages (MediaWiki:Gadget-mygadget.js and MediaWiki:Gadget-mygadget.css in the example); the names of those messages must end with ".js" or ".css", respectively. A gadget can use any number of code messages, specifically, common code can be put into a code message used by several gadgets, in addition to their own specific code, e.g:

* frobinator|commonStuff.js|frob.js|frob.css|pretty.css * l33t|commonStuff.js|tools.js|l33t.js

Sektionen
The list of gadgets in MediaWiki:Gadgets-definition can be broken into sections using lines that start and end with two or more "=" (equals) characters, enclosing the name of a system message that defines the section's name - for example:

== interface-gadgets ==

This would define a new section, with the title defined on the page MediaWiki:Gadget-section-interface-gadgets.

ToDo

 * Fulfill Basic gadgets

Siehe auch

 * known bugs at Bugzilla
 * /Rewrite
 * Gadget Studio
 * Extension:SecureWidgets
 * Extension:SimpleScript
 * Extension:Widgets