Greasy Fork is available in English.

Custom Play Sort V2

sdfsdf

  1. // ==UserScript==
  2. // @name Custom Play Sort V2
  3. // @namespace pbr
  4. // @include http://goallineblitz.com/game/team_create_defense.pl?team_id=*
  5. // @version 10.01.29
  6. // @copyright 2010, pabst
  7. // @license (CC) Attribution Share Alike; http://creativecommons.org/licenses/by-sa/3.0/
  8. // @description sdfsdf
  9. // ==/UserScript==
  10.  
  11. window.setTimeout(
  12. function() {
  13. main();
  14. }
  15. , 100);
  16.  
  17. function main() {
  18. var tbl = document.getElementsByTagName("table");
  19. for (var i=0; i<tbl.length; i++) {
  20. tbl[i].style.visibility = "hidden";
  21. // console.log(i+":::>>> "+tbl[i].innerHTML.slice(0,60));
  22. for (var r=1; r<tbl[i].rows.length-1; r++) {
  23. var lowest = r;
  24. for (var r2=r+1; r2<tbl[i].rows.length; r2++) {
  25. var p2 = tbl[i].rows[r2].textContent;
  26. if (p2 < tbl[i].rows[lowest].textContent) {
  27. lowest = r2;
  28. }
  29. }
  30. if (lowest != r) {
  31. var t1 = tbl[i].rows[r].innerHTML;
  32. var t2 = tbl[i].rows[lowest].innerHTML;
  33. tbl[i].rows[r].innerHTML = t2;
  34. tbl[i].rows[lowest].innerHTML = t1;
  35. }
  36. // console.log(p1+"--> "+p2);
  37. }
  38. tbl[i].style.visibility = "visible";
  39. }
  40. }
  41.