MediaWiki:Gadget-ProveIt.js

Aus schwarzer2000.de
Version vom 20. März 2019, 19:59 Uhr von Apollon (Diskussion | Beiträge) (1 Version importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Hinweis: Leere nach dem Speichern den Browser-Cache, um die Änderungen sehen zu können.

  • Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
  • Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
  • Internet Explorer: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
  • Opera: Gehe zu Menü → Einstellungen (Opera → Einstellungen auf dem Mac) und dann auf Datenschutz & Sicherheit → Browserdaten löschen → Gespeicherte Bilder und Dateien.
/**
 * ProveIt is a powerful GUI tool to find, edit, add and cite references in any MediaWiki wiki
 * Full documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
 *
 * The gadget itself is loaded directly from Commons, but here are a few conditions to minimize requests
 * and a few configuration options specific to this wiki
 */

// Only load on appropriate namespaces
var namespace = mw.config.get( 'wgNamespaceNumber' );
if ( namespace === 0 || namespace === 2 ) {

	// Only load when editing 
	var action = mw.config.get( 'wgAction' );
	if ( action === 'edit' || action === 'submit' ) {

		// Only load when editing wikitext (and not in common.js or common.css, for example)
		var contentModel = mw.config.get( 'wgPageContentModel' );
		if ( contentModel === 'wikitext' ) {

			// Set the wiki-specific options (all options are optional and can be set to null)
			mw.config.set({
				'proveit-tag': null, // Revision tag created at Special:Tags
				'proveit-summary': null, // Edit summary automatically added by ProveIt
				'proveit-templates': [ // These templates should have their TemplateData defined
					'Vorlage:Literatur',
					'Vorlage:Cite web'
				]
			});
	
			// Load the dependencies
			mw.loader.using([
				'jquery.cookie',
				'jquery.textSelection',
				'jquery.ui.draggable'
			]).then( function () {
				// Load the latest code directly from Commons
				mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-ProveIt.js&action=raw&ctype=text/javascript' );
				mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-ProveIt.css&action=raw&ctype=text/css', 'text/css' );
			});
		}
	}
}