MediaWiki

Group-Grouse.js: Difference between revisions

From Grouse House Wiki

No edit summary
No edit summary
Line 12: Line 12:
         $header.after('[Edit]');
         $header.after('[Edit]');


     });
     };
   
   
     /* Hide second headers from TOC */
     /* Hide second headers from TOC */
Line 19: Line 19:
       var $pagename = $(this).html();
       var $pagename = $(this).html();
       $pagename.after($pagename);
       $pagename.after($pagename);
 
    });


  });
  });

Revision as of 02:06, 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 $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);
  
    });

 });