Changes

Jump to: navigation, search

MediaWiki:Common.js

23 bytes added, 6 years ago
Fix card gallery ToC for when the user has "Auto-number headings" enabled.
* this simplifies checking if new code has cleared server caches
*/
var LAST_LOG = '0110:2255, 15 16 June 2018 (UTC)';
console.log('MediaWiki:Common.js last updated:', LAST_LOG);
*/
$( function _addTocToCardGalleries() {
const $toc = $( '.card-gallery-toc' ).find( 'ul' ); $( '.mw-headline' ).each( function(index, element ) { const sectionName $section = $( this ).text(element ); $( '.card-gallery-toc' ).find( 'ul' ).append(
$( '<li>', {
class: 'toc-entry',
html: $( '<a>', {
href: '#' + sectionName$section.replaceattr( / /g, '_id' ), text: sectionName$section.text()
} )
} )
Bureaucrats, System administrator, Administrators
57,479
edits

Navigation menu