Aktionen

MediaWiki

Common.js

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.
/* Das folgende JavaScript wird für alle Benutzer geladen. */


$(function () {
/***********************************************************************************************************************/
	// var myElement = document.getElementById('mw-mywiki-example');
	// myElement.innerHTML = 'any HTML';
	
	// Lazy Load Acro Map
	$(document).ready(function() {
		var acromap = $( "#acromap" );
		if ( acromap.length ) {
			acromap.html(".........");
			
			function first() {
			   return $.getScript( "https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" );
			}

			function second(data, textStatus, jqXHR) {
			   return $.getScript( "https://wiki.acrotricks.com/w/resources/lib/acromap/script.js" );
			}
			
			loadCSS = function(href) {

				  var cssLink = $("<link>");
				  $("head").append(cssLink); //IE hack: append before setting href
				
				  cssLink.attr({
				    rel:  "stylesheet",
				    type: "text/css",
				    href: href
				  });
				
			};
			
			loadCSS( "https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" );
			loadCSS( "https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css" );
			loadCSS( "https://wiki.acrotricks.com/w/resources/lib/acromap/styles.css" );
			
			
			//first().then(second).done(function(){
			    //place your code here, the scripts are all loaded
			    //acromap.html("MAP");
			//});
			// 
			
			$.when(
			    $.getScript( "https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" ),
			    //$.getScript( "https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js" ),
			    $.Deferred(function( deferred ){
			        $( deferred.resolve );
			    })
			).done(function(){
				
				second();
				//$.getScript( "https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js" );
			});
			

		}
	}); 
	
	
	/***************************/
	var customizeToolbar = function () {
		/* Your code goes here */
		
		/***************************/
		/*
		$('#wpTextbox1').wikiEditor('addToToolbar', {
			section: 'advanced',
			group: 'format',
			tools: {
				"strikethrough": {
					label: 'Strike',
					type: 'button',
					icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<s>",
							post: "</s>"
						}
					}
				}
			}
		});
		*/
		
		/*
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'emoticons',
			'group': 'faces',
			'tools': {
				'smile': {
					label: 'Smile!', // or use labelMsg for a localized label, see above
					type: 'button',
					icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: ":)" // text to be inserted
						}
					}
				}
			}
		});
		*/
		/***************************/        
	};

	/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
	if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
		mw.loader.using( 'user.options' ).then( function () {
			// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
			if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
				$.when(
					mw.loader.using( 'ext.wikiEditor' ), $.ready
				).then( customizeToolbar );
			}
		} );
	}
/***********************************************************************************************************************/
}());