MediaWiki

Group-Grouse.js: Difference between revisions

From Grouse House Wiki

No edit summary
No edit summary
 
(82 intermediate revisions by the same user not shown)
Line 4: Line 4:
         var $headername = $header.html();
         var $headername = $header.html();
         $headernameu = $headername.split(' ').join('_');
         $headernameu = $headername.split(' ').join('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");
$headernameu = $headernameu.toString().replace("'", "\\'").replace("?", "\\?").replace("!", "\\!").replace(/,/g, "\\,").replace("/", "\\/");


         var $secondheader = "#" + $headernameu + "_2";
         var $secondheader = "#" + $headernameu + "_2";
Line 121: Line 121:
     });
     });
  });
  });
/* Testing */
var modal = document.getElementById('decorModal');
var modalclose = document.getElementsByClassName("modalclose")[0];
function decorModal(decorname, decordesc, descobt, adulturl, motherlyurl, relaxedurl, sentinelurl, adolurl, pupurl, pupbrachyurl, pupconjoinedurl, pupnewbornurl, puppolycurl, puppolymurl, popsirenurl, pupyoungurl) {
    modal.style.display = "block";
    modaldropdown = document.getElementById("previewoptions");
    modalpreview = document.getElementById("decorpreviewimg");
    if (modaldropdown.options[modaldropdown.selectedIndex].text === "Adult [Motherly]") {
      modalpreview.src = motheryurl;
    } else {
    return
    }
}
window.onclick = function(event) {
  if (event.target == modal) {
    modal.style.display = "none";
  } else if (event.target === modalclose) {
    modal.style.display = "none";
  }
}

Latest revision as of 19:24, 14 April 2024

$(function() {
    $('h2.c-header.active span.mw-headline').each(function () {
        var $header = $(this);
        var $headername = $header.html();
        $headernameu = $headername.split(' ').join('_');
$headernameu = $headernameu.toString().replace("'", "\\'").replace("?", "\\?").replace("!", "\\!").replace(/,/g, "\\,").replace("/", "\\/");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");

        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        $("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('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");
        
        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        $("a[href='" + $secondheader + "']").hide();
    });
 });

$(function() {
    $('h2.h-static span.mw-headline').each(function () {
        var $header = $(this);
        var $headername = $header.html();
        $headernameu = $headername.split(' ').join('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");

        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        var $pagename = $('h1#firstHeading').html();
        $pagenameu = $pagename.split(' ').join('_');
        
        $toclink = "https://grousehouse.wiki/" + $pagenameu + $secondheader;

        $("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('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");

        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        $("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('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");

        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        var $pagename = $('h1#firstHeading').html();
        $pagenameu = $pagename.split(' ').join('_');
        
        $toclink = "https://grousehouse.wiki/" + $pagenameu + $secondheader;

        $("a[href*='" + $secondheader + "']").hide();
    });
 });

$(function() {
    $('h3.h-static span.mw-headline').each(function () {
        var $header = $(this);
        var $headername = $header.html();
        $headernameu = $headername.split(' ').join('_');
$headernameu = $headernameu.replace("'", "\\'").replace("?", "\\?").replace("!", "\\!");

        var $secondheader = "#" + $headernameu + "_2";

        var $editsection = $( $secondheader ).next().children('a').attr("href");

        $header.after('[Edit]');
        $header.next().css( 'font-size', '0.6em').css( 'margin-left', '1em');

        var $pagename = $('h1#firstHeading').html();
        $pagenameu = $pagename.split(' ').join('_');
        
        $toclink = "https://grousehouse.wiki/" + $pagenameu + $secondheader;

        $("a[href*='" + $secondheader + "']").hide();
    });
 });