mmmturkeybacon Survey Row Highlighter

Highlights rows in surveys to make it easier to see

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        mmmturkeybacon Survey Row Highlighter
// @author      mmmturkeybacon
// @description Highlights rows in surveys to make it easier to see
//              which question you are answering.
// @namespace   http://userscripts.org/users/523367
// @match       http://*.qualtrics.com/*
// @match       https://*.qualtrics.com/*
// @match       http://*.surveymonkey.com/*
// @match       https://*.surveymonkey.com/*
// @match       https://docs.google.com/forms*
// @version     0.9
// @grant       none
// ==/UserScript==

/* based on the following stackoverflow snippets:
 *http://stackoverflow.com/questions/4007353/how-to-highlight-table-row-on-hover-using-css-only
 *http://stackoverflow.com/questions/4847313/dynamically-add-css-to-page-via-javascript
 */
var style = document.createElement('style')
style.type = 'text/css'
style.innerHTML = 'tr.ChoiceRow:hover {background-color: lightyellow;}'; // qualtrics
style.innerHTML += ' tr.matrixRow:hover {background-color: lightyellow;}'; // surveymonkey
style.innerHTML += ' tr.matrixAltRow:hover {background-color: lightyellow;}'; // survey monkey
style.innerHTML += ' tr.ss-gridrow:hover {background-color: lightyellow;}'; // google
document.getElementsByTagName('head')[0].appendChild(style)