MediaWiki
Group-Grouse.js: Difference between revisions
From Grouse House Wiki
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
var $secondheader = "#" + $headernameu + "_2"; | var $secondheader = "#" + $headernameu + "_2"; | ||
var $secondheaderlink = " | |||
$( 'a[href*=$secondheader]' ).hide() | $( 'a[href*=$secondheader]' ).hide() | ||
Line 13: | Line 15: | ||
$header.after('[Edit]'); | $header.after('[Edit]'); | ||
}); | }); | ||
/* Hide second headers from TOC */ | |||
$('h1#firstHeading.each(function () { | |||
var $pagename = $(this).html(); | |||
$pagename.after($pagename); | |||
}); | }); |
Revision as of 02:05, 3 February 2024
$(function() { $('h2.c-header.active span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; var $secondheaderlink = " $( 'a[href*=$secondheader]' ).hide() var $editsection = $( $secondheader ).next().children('a').attr("href"); $header.after('[Edit]'); }); /* Hide second headers from TOC */ $('h1#firstHeading.each(function () { var $pagename = $(this).html(); $pagename.after($pagename); });