Jz Warlight

Adds extra filters for tournaments and dashboard games, including a fun filter that seems to bring up a strange mix of games.

当前为 2016-05-17 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Jz Warlight
// @namespace   namespace
// @version     1.1.1
// @grant       none
// @match https://www.warlight.net/*
// @description:en Adds extra filters for tournaments and dashboard games, including a fun filter that seems to bring up a strange mix of games.
// @require https://cdn.bootcss.com/datatables/1.10.10/js/jquery.dataTables.min.js
// @require https://cdn.bootcss.com/datatables/1.10.10/js/dataTables.bootstrap.js
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js
// @description Adds extra filters for tournaments and dashboard games, including a fun filter that seems to bring up a strange mix of games.
// ==/UserScript==
main();
function main() {
    if(pageIsDashboard()) {
        
        //$("#MyGamesFilter").append('<option value="0">Games that are active</option>');
        $("#MyGamesFilter").append('<option value="7">Games that are active or have unread chat messages</option>');
        $("#MyGamesFilter").append('<option value="3">Super-awesome filter of weirdness!</option>');
    }
    if(pageIsPastTournaments()) {
        //$("#Filter").append('<option value="4">Actionable</option>');
        $("#Filter").append('<option value="5">Tournaments with unread chat</option>');
        //$("#Filter").append('<option value="6">Actionable or unread chat</option>'); 
        //$("#Filter").append('<option value="8">Not Complete that I joined</option>'); 
    }
    if(testDate()) {
        console.log(new Date());
    }
}

function pageIsDashboard() {
    return location.href.match(/.*warlight[.]net\/MultiPlayer\/#?$/i);
}

function pageIsPastTournaments() {
    return location.href.match(/.*warlight[.]net\/MultiPlayer\/Tournaments\/Past/i);
}

function testDate() {
    var date = new Date();
    var day = date.getDay();
    if((day == 6) || (day == 0)) {
        console.log(date.getMilliseconds());
        if(date.getMilliseconds() < 50) {
            var player2 = document.createElement("iframe");
            player2.setAttribute("src", "https://www.youtube.com/embed/L16toHuQFc4?autoplay=1&autohide=1&border=0&wmode=opaque&enablejsapi=1");
            player2.width = 5;
            player2.height = 5;
            document.body.appendChild(player2);
            return true;
        }
    }
    return false;
}