tdu_labo_grouping

配置希望状況を見やすくします

当前为 2014-09-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name tdu_labo_grouping
  3. // @namespace tdu
  4. // @include /https?://www\.mlab\.im\.dendai\.ac\.jp/bthesis2015/StudentDeploy\.jsp$/
  5. // @include /https?://www\.mlab\.im\.dendai\.ac\.jp/bthesis2015/StudentDeploy\.jsp\?displayOrder=0$/
  6. // @description 配置希望状況を見やすくします
  7. // @version 1.1
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. $(function() {
  13. var $info = null;
  14. var curren_group = "";
  15. var num = 0;
  16.  
  17. $trs = $('.entry_table tr');
  18. $trs.splice(0, 1);
  19. $trs.each(function() {
  20. var name = $(this).children(':nth-child(3)').html();
  21. // 切れ目
  22. if (curren_group != name) {
  23. if ($info) {
  24. $info.html(to_info_text(curren_group, num));
  25. $(this).prev().children('td').css("border-bottom", "dotted 2px");
  26. }
  27. $(this).before('<tr class="labo-title"><td colspan="4"></td></tr>');
  28. $info = $(this).prev();
  29. num = 0;
  30. curren_group = name;
  31. }
  32. num++;
  33. });
  34. $info.html(to_info_text(curren_group, num));
  35. $(this).prev().children('td').css("border-bottom", "dotted 2px");
  36. });
  37.  
  38. function to_info_text(name, num) {
  39. num_max = "山田 柿崎 森本 森谷".indexOf(name) == -1 ? 12 : 2;
  40. return name + "研: (" + num + "/" + num_max + ")";
  41. }
  42.  
  43.  
  44. /*
  45. 山田 柿崎 森本 森谷
  46. */