您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
With this script you can click to highlight your favorite games in the GDQ schedule list.
当前为
// ==UserScript== // @name Mark scheduled games as favorites in Games Done Quick // @description With this script you can click to highlight your favorite games in the GDQ schedule list. // @namespace http://gamesdonequick.com/ // @version 0.2 // @author ciscoheat // @match https://gamesdonequick.com/schedule // @grant none // ==/UserScript== (function($) { 'use strict'; var selected = localStorage.favorites ? JSON.parse(localStorage.favorites) : []; $("#runTable .start-time").closest('tr').each(function(_, tr) { var secondRow = $(tr).next(); var game = $(tr).find('.start-time + td').text(); var rows = $(tr).add(secondRow); var last = []; if(selected.indexOf(game) >= 0) rows.css('background-color', '#c0f9c2'); rows.on('mousedown', function(e) { if(e.button != 0) return; last = [e.pageX, e.pageY]; }); rows.on('mouseup', function(e) { if(e.button != 0) return; if(Math.abs(e.pageX - last[0]) > 2 || Math.abs(e.pageY - last[1]) > 2) return; var pos = selected.indexOf(game); if(pos < 0) { selected.push(game); rows.css('background-color', '#c0f9c2'); } else { selected.splice(pos, 1); rows.css('background-color', ''); } localStorage.favorites = JSON.stringify(selected); }); }); })(jQuery);