tdu_labo_grouping

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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        tdu_labo_grouping
// @namespace   tdu
// @include     /https?://www\.mlab\.im\.dendai\.ac\.jp/bthesis2015/StudentDeploy\.jsp/
// @include     /https?://www\.mlab\.im\.dendai\.ac\.jp/bthesis2015/StudentDeploy\.jsp\?displayOrder=0/
// @description 配置希望状況を見やすくします
// @version     1
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @grant       none
// ==/UserScript==

$(function() {
    var $info = null;
    var curren_group = "";
    var num = 0;

    $trs = $('.entry_table tr');
    $trs.splice(0, 1);
    $trs.each(function() {
        var name = $(this).children(':nth-child(3)').html();
        // 切れ目
        if (curren_group != name) {
            if ($info) {
                $info.html(to_info_text(curren_group, num));
                $(this).prev().children('td').css("border-bottom", "dotted 2px");
            }
            $(this).before('<tr class="labo-title"><td colspan="4"></td></tr>');
            $info = $(this).prev();
            num = 0;
            curren_group = name;
        }
        num++;
    });
    $info.html(to_info_text(curren_group, num));
    $(this).prev().children('td').css("border-bottom", "dotted 2px");
});

function to_info_text(name, num) {
    num_max = "山田 柿崎 森本 森谷".indexOf(name) == -1 ? 12 : 2;
    return name + "研: (" + num + "/" + num_max + ")";
}


/*
山田 柿崎 森本 森谷
*/