MediaWiki: Common.js: Unterschied zwischen den Versionen

Aus Herrenhäuser
Wechseln zu: Navigation, Suche
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 15: Zeile 15:
$('a[data-toggle="tab"]').on("click", function() {
$('a[data-toggle="tab"]').on("click", function() {
//window.location.hash = currentTab;
//window.location.hash = currentTab;
var currentTab = $(location).attr('hash');
var newTab = $(location).attr('hash');
   history.replaceState(null, null, currentTab);
   history.replaceState(null, null, newTab);
   console.log('currentTab', currentTab);
   console.log('newTab', newTab);
});
});


});
});
});
});

Version vom 11. August 2025, 12:48 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() {
$( document ).ready(function() {
    console.log( "ready!" );
var currentTab = $(location).attr('hash');
$('.nav-item a[href="' +currentTab + '"]').tab('show');

$('a[data-toggle="tab"]').on("click", function() {
//window.location.hash = currentTab;
var newTab = $(location).attr('hash');
  history.replaceState(null, null, newTab);
  console.log('newTab', newTab);
});

});
});