MediaWiki: Common.js: Unterschied zwischen den Versionen

Aus lernlog Hilfesystem
Wechseln zu: Navigation, Suche
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
Zeile 3: Zeile 3:
   const localPath = '/corp/';  
   const localPath = '/corp/';  
   require(localPath + 'toolbox.js');
   require(localPath + 'toolbox.js');
  require(localPath + 'kids_button.js');
   //require(localPath + 'sidebar.js');
   //require(localPath + 'sidebar.js');
  require(localPath + 'kids_button.js');
   require(localPath + 'catparser.js');
   require(localPath + 'catparser.js');
   require(localPath + 'hide_categories_on_cat_search.js');
   require(localPath + 'hide_categories_on_cat_search.js');

Aktuelle Version vom 26. Februar 2026, 16:01 Uhr

$(document).ready(function() {
  console.log("Custom loaded");
  const localPath = '/corp/'; 
  require(localPath + 'toolbox.js');
  require(localPath + 'kids_button.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);
      }
  });
}