MediaWiki: Common.js: Unterschied zwischen den Versionen

Aus lernlog Hilfesystem
Wechseln zu: Navigation, Suche
(Die Seite wurde geleert.)
Markierung: Geleert
 
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
$(document).ready(function() {
  console.log("Custom loaded");
  const localPath = '/corp/';
  require(localPath + 'toolbox.js');
  //require(localPath + 'sidebar.js');
  require(localPath + 'catparser.js');
  require(localPath + 'hide_categories_on_cat_search.js');
  require(localPath + 'hide_namespaces_on_search.js');
  require(localPath + 'delete_orphaned_files.js');
  require(localPath + 'related_pages.js');
  require(localPath + 'highlighter.js');
  require(localPath + 'totop.js');
  console.log("Custom done");
});


// load a js file on-the-fly
function require(script) {
  $.ajax({
      url: script,
      dataType: "script",
      async: false,          // <-- This is the key
      success: function () {
          // all good...
      },
      error: function () {
          throw new Error("Could not load script " + script);
      }
  });
}

Aktuelle Version vom 11. November 2025, 17:49 Uhr

$(document).ready(function() {
  console.log("Custom loaded");
  const localPath = '/corp/'; 
  require(localPath + 'toolbox.js');
  //require(localPath + 'sidebar.js');
  require(localPath + 'catparser.js');
  require(localPath + 'hide_categories_on_cat_search.js');
  require(localPath + 'hide_namespaces_on_search.js');
  require(localPath + 'delete_orphaned_files.js');
  require(localPath + 'related_pages.js');
  require(localPath + 'highlighter.js');
  require(localPath + 'totop.js');
  console.log("Custom done");
});

// load a js file on-the-fly
function require(script) {
  $.ajax({
      url: script,
      dataType: "script",
      async: false,           // <-- This is the key
      success: function () {
          // all good...
      },
      error: function () {
          throw new Error("Could not load script " + script);
      }
  });
}