Community Central
Community Central

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// Opens all folders on enhanced recent changes
var opensesame = function() {
    if (wgCanonicalSpecialPageName === "Recentchanges" ) {
        array1 = document.getElementsByClassName("mw-made-collapsible");
        for (i = 0; i < array1.length; i++) {
            tb = array1[i];
            array2 = tb.children[0].children;
            for (j = 1; j < array2.length; j++) {
                array2[j].style.display = "table-row";
            }
        }
    }
};

/* Based on https://cookieclicker.wikia.com/wiki/MediaWiki:Wikia.js */
if (wgCanonicalSpecialPageName === "Recentchanges" ) {
    $('ul.my-tools-menu li:first-child').after('<li class="overflow"><a href="javascript:opensesame()">Expand all</a></li>');
}

var commentMover = function(destination, reason) {
    if(wgCanonicalSpecialPageName === "Prefixindex") {
        if(!wgPageName.endsWith("/")) {
            console.log("Page URL should end with /");
            return;
        }
        if(reason === undefined) {
            reason = "Moving%20comments%20not%20moved%20by%20FANDOMbot";
        }
        originalBaseName = document.URL.replace(wgServer + "/wiki/Special:PrefixIndex/", "");
        tds = document.getElementById("mw-prefixindex-list-table").getElementsByTagName("td");
        prevUrl = null;
        for(i = 0; i < tds.length; i++) {
            url = tds[i].firstChild.href;
            if(prevUrl === null || !url.startsWith(prevUrl)) {
                prevUrl = url;
                commentPart = url.replace(wgServer + "/wiki/" + originalBaseName, "");
                newUrl = wgServer + "/wiki/Special:MovePage/" + originalBaseName + commentPart;
                newUrl += "?wpLeaveRedirect=0&wpMovesubpages=1";
                newUrl += "&wpReason=" + reason;
                newUrl += "&wpNewTitle=" + destination + "/" + commentPart;
                console.log(newUrl);
            }
        }
    }
};