Fontz Quiz Timer & Keyboard Shortcuts

%description%

当前为 2015-09-12 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Fontz Quiz Timer & Keyboard Shortcuts
// @namespace   http://idlewords.net
// @description %description%
// @include     http://50.116.7.11:9998/learningQuizController_turk/quiz
// @include     http://50.116.7.11:9998/learningQuizController_turk/quiz_answer
// @version     0.1
// @require     https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @require     https://greasyfork.org/scripts/12377-timecircles/code/TimeCircles.js?version=73868
// @grant       GM_log
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
	if (document.location.href.search('answer') < 0) {
		$("head").append(
			$("<link></link>")
				.attr('rel', 'stylesheet')
				.attr('href', 'http://git.wimbarelds.nl/TimeCircles/inc/TimeCircles.css')
				.attr('type', 'text/css')
		);
		$("div[align='right']").after(
			$("<div></div>")
				.css({'height': '200px', 'width': '500'})
				.addClass('timer')
		);
		$(".timer").TimeCircles({
			time: {
			    Days: { show: false },
			    Hours: { show: false },
			    Minutes: { color: "#BBFFBB" },
			    Seconds: { color: "#FF9999" }
			}
		});
		$(document).keydown(function(event) {
			if (event.which == 83 && event.ctrlKey) {
				event.preventDefault();
				$("#submitButton").click();
			} else if (event.which == 89) {
				event.preventDefault();
				$("#deformfield1-0").prop('checked', true);
			} else if (event.which == 78) {
				event.preventDefault();
				$("#deformfield1-1").prop('checked', true);
			}
		});
	} else {
		$(document).keydown(function(event) {
			if (event.which == 83 && event.ctrlKey) {
				event.preventDefault();
				$("input[name='Continue']").click();
			}
		});
	}
});