MediaWiki:Other.js

/* Add powerusers checkbox to Special:Listuers */ if (wgCanonicalSpecialPageName == "Listusers") $("fieldset.lu_fieldset tr:last-child").prepend('  Power Users ');

/* Add Last Diff link to Edit Drop-down */ if ($(".WikiaPageHeaderDiffHistory").length && $(".wikia-button[data-id=edit]").length) { /* change the "edit" link of a diff page to edit the current version, as there is already an edit link for both diffs */ oldhref = $(".wikia-button[data-id=edit]").attr("href"); var newhref = oldhref.split("&oldid=")[0]; $(".wikia-button[data-id=edit]").attr("href", newhref); } if (!$("#ca-diff").length && $("a[data-id='history']").closest("ul").length) { //adapted from NullEditButton script $("a[data-id='history']").closest("ul").prepend($('').html( $('').attr({           href: $("li>a[data-id=history]").attr("href").replace("action=history", "diff=cur"),            accesskey: "0",            id: "ca-diff",            title: mw.config.get('wgPageName')        }).text("Last diff").click(function {            if (!$("#diffstyle").size) $('head').append('');            var request = {                format: 'json',                action: 'query',                rvdiffto: "prev",                prop: "revisions",                titles: mw.config.get('wgPageName'),                token: mw.user.tokens.get("editToken"),            };            new mw.Api.post(request).done(function(result) { diffhtml = result.query.pages[Object.keys(result.query.pages)].revisions[0].diff['*']; $(" ").css({                   'width': '100%'                }).html(diffhtml).makeModal({                    id: "ModalDiff",                    width: $(window).width - 100                }); $("#ModalDiff").css({                   top: 50,                    overflow: "auto",                    height: $(window).height - 100                }); });           return false;        }) )); }