Superman Wiki
Advertisement

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.
/* SORT WHATLINKSHERE ALPHABETICALLY BEGIN */

(function($) {
    if (mw.config.get('wgCanonicalSpecialPageName') !== 'Whatlinkshere') return;
    var sorted_list,
        $list = $('#mw-whatlinkshere-list');
    sorted_list = $list.children('li').sort(function (a, b) {
        return ($(a).find('a:first').attr('title') > $(b).find('a:first').attr('title')) ? 1 : -1;
    });
    $list.children('li').remove();
    $list.append(sorted_list);
})(jQuery);

/* SORT WHATLINKSHERE ALPHABETICALLY END */



/* DEV INACTIVEUSERS BEGIN */

InactiveUsers = { 
    months: 6,
    gone: ['username1', 'username2'],
    text: 'inactive'
};

/* DEV INACTIVEUSERS END */


/* COMMA IN CONTRIBS USER HEADER BEGIN */

$(function() {
  var selector = '#userProfileApp .user-identity-stats strong';
  function prettify(strongs) {
    strongs.forEach(function(strong, i) {
      var text = strong.textContent;
      if (text.length > 3 && text.indexOf(',') === -1) {
        strong.textContent = parseInt(text).toLocaleString('en', {useGrouping:true});
      }
    })
  }
  mw.hook('wikipage.content').add(function($content) {
    var strongs = document.querySelectorAll(selector);
    if (strongs.length) {
      prettify(strongs);
    } else {
      // alternatively, run a setInterval or setTimeout.
      new MutationObserver(function(mutations, observer) {
        var strongs = document.querySelectorAll(selector);
        if (strongs.length) {
          observer.disconnect();
          prettify(strongs);
        }
      }).observe(document.querySelector('.page__main'), {
        childList: true, // observe direct children
        subtree: true, // and lower descendants too
      });
    }
  });
});

/* COMMA IN CONTRIBS USER HEADER END */


/* LINK ON RAIL ACTIVITY BOX BEGIN */

$('#WikiaRail').on('afterLoad.rail', function() {
  const recentChangesLink = $('<a/>').attr('href', '/wiki/Special:RecentChanges');
  const wikiActivityRailHeader = $('#wikia-recent-activity.rail-module.recent-wiki-activity .rail-module__header');
  recentChangesLink.append(wikiActivityRailHeader.html());
  wikiActivityRailHeader.empty().prepend(recentChangesLink);
});

/* LINK ON RAIL ACTIVITY BOX END */
Advertisement