MediaWiki: Common.js: Unterschied zwischen den Versionen

Aus Herrenhäuser
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „→‎Das folgende JavaScript wird für alle Benutzer geladen.: // stelle sicher, das externe links in neuem Tab geöffnet werden (ohne dass dies per LocalSettings.php konfiguriert wurde) var links = document.querySelectorAll(".external"); Array.prototype.forEach.call(links, function(a) { a.setAttribute("target", "_blank"); });“)
 
Keine Bearbeitungszusammenfassung
Zeile 6: Zeile 6:
         a.setAttribute("target", "_blank");
         a.setAttribute("target", "_blank");
     });
     });
mw.loader.using(['mediawiki.util']).done(function() {
   
    var taburl = document.location.toString();
if( taburl.match('#') ) {
$('.nav-tabs a[href="#'+taburl.split('#')[1]+'"]').tab('show');
}
console.log('taburl', taburl);
// Allow internal links to activate a tab.
$('a[data-toggle="tab"]').click(function (e) {
e.preventDefault();
$('a[href="' + $(this).attr('href') + '"]').tab('show');
});
});

Version vom 8. August 2025, 12:11 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */

// stelle sicher, das externe links in neuem Tab geöffnet werden (ohne dass dies per LocalSettings.php konfiguriert wurde)
    var links = document.querySelectorAll(".external");
    Array.prototype.forEach.call(links, function(a) {
        a.setAttribute("target", "_blank");
    });

mw.loader.using(['mediawiki.util']).done(function() {
    
    var taburl = document.location.toString();
	if( taburl.match('#') ) {
		$('.nav-tabs a[href="#'+taburl.split('#')[1]+'"]').tab('show');
	}
console.log('taburl', taburl);
	// Allow internal links to activate a tab.
	$('a[data-toggle="tab"]').click(function (e) {
		e.preventDefault();
		$('a[href="' + $(this).attr('href') + '"]').tab('show');
	});
});