MediaWiki: Common.js: Unterschied zwischen den Versionen

Aus Herrenhäuser
Wechseln zu: Navigation, Suche
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 8: Zeile 8:


mw.loader.using(['mediawiki.util']).done(function() {
mw.loader.using(['mediawiki.util']).done(function() {
$( document ).ready(function() {
  $( document ).ready(function() {
     console.log( "ready!" );
     console.log( "ready!" );
    var currentTab = $(location).attr('hash');
    $('.nav-item a[href="' +currentTab + '"]').tab('show');
    history.replaceState(null, null, location + currentTab);


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

Version vom 11. August 2025, 12:56 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');
    history.replaceState(null, null, location + currentTab);

    $('a[data-toggle="tab"]').on("click", function() {
      var newTab = $(this).attr("href");
      history.replaceState(null, null, newTab);
   });
  });
});