SourceTextCats

/** * Textualizes categories in the source editor, * as opposed to displaying them in an #EditPageRail module (as is the default); * similar to what is done on Wookieepedia (and, thus, presumably in compliance with FANDOM's TOS) */ (function {    if ($('body.ns-0.ns-subject.editor')) {        var categories = Array.from($('#EditPageRail li.category'));        var textualizedCats = categories.map(function(cat) { var $cat = $(cat); if ($cat.attr('data-sortkey')) { return ''; } else { return ''; }       });        $('#EditPageRail .module_categories').remove;        $('#mw-content-text textarea')            .html            .replaceWith(/\[\[Category:([^|]+)(\|[^\]]+|)\]\]\n/g, '')            .append(textualizedCats);    } });

(function {   if (document.querySelector('body.ns-0.ns-subject.editor')) {        document.querySelector.onclick = function {            var categories = Array.from(document.querySelectorAll('#EditPageRail li.category'));            var textualizedCats = categories.map(function(cat) { if (cat.getAttribute('data-sortkey')) { return ''; } else { return ''; }           });            document.querySelector('#EditPageRail .module_categories').remove;            document.querySelector('#mw-content-text textarea').innerHTML.replace(/\[\[Category:([^|]+)(\|[^\]]+|)\]\]\n/gm, '');            document.querySelector('#mw-content-text textarea').innerHTML += textualizedCats.join;        }    } });