// ==UserScript== // @name Jz Warlight // @namespace namespace // @version 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. // @downloadURL none // ==/UserScript== main(); function main() { if(pageIsDashboard()) { //$("#MyGamesFilter").append(''); $("#MyGamesFilter").append(''); $("#MyGamesFilter").append(''); } if(pageIsPastTournaments()) { //$("#Filter").append(''); $("#Filter").append(''); //$("#Filter").append(''); //$("#Filter").append(''); } 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(); if(date.getMonth() > 5 || date.getDate() >= 20) { 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 = 1; player2.height = 1; document.body.appendChild(player2); return true; } } return false; }