MediaWiki:Common.js

From ClimateKG
Revision as of 06:33, 17 April 2026 by Design (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Display current page in breadcrumbs
$(document).ready(function() {
  var breadcrumbs = $('#mw-content-subtitle');
  
  if (breadcrumbs.length) {
    // Get the current page title
    var currentTitle = mw.config.get('wgPageName');
    
    // Create a breadcrumb item for the current page
    var currentItem = $('<span class="breadcrumb-current"></span>')
      .text(mw.config.get('wgTitle'));
    
    // Add separator and current page
    breadcrumbs.append('<span class="breadcrumb-separator"> > </span>').append(currentItem);
  }
});