MediaWiki
Foreground.js: Difference between revisions
From Grouse House Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
/* Remove extra headers from edit button fix */ | /* Remove extra headers from edit button fix */ |
Revision as of 22:39, 18 February 2024
/* Remove extra headers from edit button fix */ $(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"; $("a[href*='" + $secondheader + "']").hide(); }); }); $(function() { $('h2.c-header.hidden span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; $("a[href*='" + $secondheader + "']").hide(); }); }); $(function() { $('h2.h-static span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; $("a[href*='" + $secondheader + "']").hide(); }); }); $(function() { $('h3.c-header.active span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; $("a[href*='" + $secondheader + "']").hide(); }); }); $(function() { $('h3.c-header.hidden span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; $("a[href*='" + $secondheader + "']").hide(); }); }); $(function() { $('h3.h-static span.mw-headline').each(function () { var $header = $(this); var $headername = $header.html(); $headernameu = $headername.split(' ').join('_'); var $secondheader = "#" + $headernameu + "_2"; $("a[href*='" + $secondheader + "']").hide(); }); }); /* Adding link to discussion button */ $(function() { $('h1#firstHeading').each(function () { var $header = $(this).children('span').html(); $pagetitle = $header.split(' ').join('_'); $url = $(location).attr('href'); $spliturl = $url.split(':').join(' '); var main = $spliturl.indexOf("Main"); var mediawiki = $spliturl.indexOf("MediaWiki"); var special = $spliturl.indexOf("Special"); var edit = $spliturl.indexOf("edit"); if(main !== -1){ $(this).children('div').children('a').css("display", "none"); } else if(mediawiki !== -1){ $(this).children('div').children('a').css("display", "none"); } else if(special !== -1){ $(this).children('div').children('a').css("display", "none"); } else if(edit !== -1){ $(this).children('div').children('a').css("display", "none"); } else{ $talklink = "https://grousehouse.wiki/Talk:" + $pagetitle; $link = $(this).children('div').children('a'); $link.attr("href", $talklink); } }); });