User:Nw520/Gadgets
AutoReplace
editActivation
editThis gadget can be enabled by appending the following line to either your global.js or your common.js on any Wikimedia-wiki:
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Nw520/AutoReplace.js&action=raw&ctype=text/javascript' );
Configuration
editwindow.nw520_config = {
autoReplace_replacements: [
{
find: / Open Street Maps?([ .,])/g,
replace: ' OpenStreetMaps$1',
comment: 'fixed spelling of OSM',
trivial: false
}
]
};
Key | Type | Description |
---|---|---|
window.nw520_config.autoReplace_autoDiff |
boolean|String |
|
window.nw520_config.autoReplace_replacements |
List<⟨refer to description⟩> | List of replacements. Each replacement is defined by an object consisting of:
|
Query parameters
editParameter | Description |
---|---|
autoreplace |
If set to no , no automatic replacements are performed.
|
GadgetManager
editSource code // de,en
Activation
editThis gadget can be enabled by appending the following line to either your global.js or your common.js on any Wikimedia-wiki:
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Nw520/GadgetManager.js&action=raw&ctype=text/javascript' );
Methods
editMethod | Description |
---|---|
window.nw520.gadgetManager.addKeyboardListener() |
|
window.nw520.gadgetManager.addLazyPortlet() |
|
window.nw520.gadgetManager.loadLazyGadgets() |
|
window.nw520.gadgetManager.registerGadget( displayName: String, URL: String, [lazy=false]: boolean, [method='using']: String ) |
Query parameters
editParameter | Description |
---|---|
nogadget |
List of gadget slugs to not load separated by commas. If no value is defined, no gadgets will be loaded. |
HashCheck
editSource code // de,en
Activation
editThis gadget can be enabled by appending the following line to either your global.js or your common.js on any Wikimedia-wiki:
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Nw520/HashCheck.js&action=raw&ctype=text/javascript' );
Hooks
editHooks can be used to execute code once an event has occurred.
Hook | Parameter | Beschreibung |
---|---|---|
ext.hashCheck.loaded |
HashCheck-object | Triggered, once HashCheck has been loaded and initialised. |
Methods
editMethod | Description |
---|---|
window.nw520.hashCheck.scan() |
StraightToCommons
editReplaces links to files on any Wikimedia-wiki to directly link to Wikimedia Commons saving you from having to wait for the on-wiki file page to load. Images and files hosted on Wikimedia Commons are highlighted with a green border to help distinguish between on-wiki files. Clicking on an image while holding down Ctrl copies the Commons file name to your clipboard.
Activation
editThis gadget can be enabled by appending the following line to either your global.js or your common.js on any Wikimedia-wiki:
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Nw520/StraightToCommons.js&action=raw&ctype=text/javascript' );
SummaryFloskeln
editActivation
editThis gadget can be enabled by appending to following line to either your global.js or your common.js on any Wikimedia-wiki:
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Nw520/SummaryFloskeln.js&action=raw&ctype=text/javascript' );
Configuration
editwindow.nw520_config = {
summaryFloskeln_floskeln: [
'Maintenance',
[
'Typo',
[
'OSM',
'fixed spelling of OSM'
]
]
]
};
Key | Type | Description |
---|---|---|
window.nw520_config.summaryFloskeln_floskeln |
List<[String, String|[String, String]]> | List of summary strings to display. Summaries are grouped into groups which are modelled as tuples with the former component being a label to display in the interface and the latter being a list of summaries. Summaries can either be a string which is displayed and when chosen appended to the summary, or a tuple with the former component being the string that is displayed and the latter component being the string that is appended to the summary. |
VoyageData
editSource code // Only for German Wikivoyage (dewikivoyage)
Durchsucht den aktuellen Artikel nach Markern und vCards ohne Wikidata-ID und listet mögliche passende Wikidata-Datenobjekte auf.
Aktivierung
editVoyageData kannst Du als Helferlein in deinen Einstellungen im Abschnitt „Beta-Funktionen“ aktivieren.
Dieses Gadget kann aktiviert werden, indem Du folgende Zeile deiner common.js in der Wikivoyage hinzufügst:
mw.loader.load( '//de.wikivoyage.org/w/index.php?title=User:Nw520/VoyageData.js&action=raw&ctype=text/javascript' );
Konfiguration
editmw.hook( 'voy.voyagedata.loaded' ).add( function ( VoyageData ) {
VoyageData.COORDINATES_MAX_LENGTH = 8;
VoyageData.INITIAL_ZOOM = 12;
VoyageData.SEARCH_LIMIT = 15;
VoyageData.SPARQL_LIMIT = 1500;
VoyageData.WIKIDATA_CLASS_SUGGESTIONS = […];
} );
Key | Type | Description |
---|---|---|
window.VoyageData.COORDINATES_MAX_LENGTH |
number | Maximale Anzahl an Stellen von Koordinaten bei SPARQL-Anfragen. |
window.VoyageData.INITIAL_ZOOM |
number | Zoomstufe der Karte beim Öffnen von VoyageData. |
window.VoyageData.SEARCH_LIMIT |
number | Maximale Anzahl an Ergebnissen je Suchlauf bei der Namenssuche. |
window.VoyageData.SPARQL_LIMIT |
number | Maximale Anzahl an Ergebnissen für SPARQL-Anfragen. |
window.VoyageData.WIKIDATA_CLASS_SUGGESTIONS |
[String, String][] | In Autocomplete anzuzeigende Wikidata-Klassen (z. B. für Whitelist). |
CSS
editCSS-Klassen haben die Präfix voy-voyagedata-
.
Hooks
editHooks können genutzt werden, um Code auszuführen, sobald bestimmte Ereignisse eintreten.
Hook | Parameter | Beschreibung |
---|---|---|
voy.voyagedata.loaded |
Klasse von VoyageData | Ausgelöst, sobald VoyageData geladen und initialisiert wurde. |
Zeichenketten
editmw.messages
-Zeichenketten haben die Präfix voy-voyagedata-
.
globale Variablen
editVariable | Beschreibung |
---|---|
window.VoyageData |
Klasse von VoyageData |