// ==UserScript== // @name KAT - Sort Translators // @namespace SortTranslators // @version 1.02 // @description Automatically sorts translators alphabetically (by language) // @match http://kickass.so/people/translators/ // @match https://kickass.so/people/translators/ // @downloadURL none // ==/UserScript== var info = []; $('.firstColl:first > ul > li').each(function() { var all = $(this).html(); var span = $(this).children("span"); $(span).remove(); var language = $(this).html(); info.push({"html":all, "lang":language}); $(this).remove(); }); var columnLimit = info.length; var current = 0; $('.secondColl:first > ul > li').each(function() { var all = $(this).html(); var span = $(this).children("span"); $(span).remove(); var language = $(this).html(); info.push({"html":all, "lang":language}); $(this).remove(); }); info.sort(function(a, b) { return a.lang.localeCompare(b.lang);; }); for (i = 0; i < info.length; i++) { if (current < columnLimit) { $('.firstColl:first > ul').append('
  • ' + info[i].html + '
  • '); } else { $('.secondColl:first > ul').append('
  • ' + info[i].html + '
  • '); } current++; } info = []; $('.thirdColl:first > ul > li').each(function() { var all = $(this).html(); var span = $(this).children("span"); $(span).remove(); var language = $(this).html(); info.push({"html":all, "lang":language}); $(this).remove(); }); info.sort(function(a, b) { return a.lang.localeCompare(b.lang);; }); for (i = 0; i < info.length; i++) { $('.thirdColl:first > ul').append('
  • ' + info[i].html + '
  • '); }