mmmturkeybacon Survey Row Highlighter

Highlights rows in surveys to make it easier to see

  1. // ==UserScript==
  2. // @name mmmturkeybacon Survey Row Highlighter
  3. // @author mmmturkeybacon
  4. // @description Highlights rows in surveys to make it easier to see
  5. // which question you are answering.
  6. // @namespace http://userscripts.org/users/523367
  7. // @match http://*.qualtrics.com/*
  8. // @match https://*.qualtrics.com/*
  9. // @match http://*.surveymonkey.com/*
  10. // @match https://*.surveymonkey.com/*
  11. // @match https://docs.google.com/forms*
  12. // @version 0.9
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. /* based on the following stackoverflow snippets:
  17. *http://stackoverflow.com/questions/4007353/how-to-highlight-table-row-on-hover-using-css-only
  18. *http://stackoverflow.com/questions/4847313/dynamically-add-css-to-page-via-javascript
  19. */
  20. var style = document.createElement('style')
  21. style.type = 'text/css'
  22. style.innerHTML = 'tr.ChoiceRow:hover {background-color: lightyellow;}'; // qualtrics
  23. style.innerHTML += ' tr.matrixRow:hover {background-color: lightyellow;}'; // surveymonkey
  24. style.innerHTML += ' tr.matrixAltRow:hover {background-color: lightyellow;}'; // survey monkey
  25. style.innerHTML += ' tr.ss-gridrow:hover {background-color: lightyellow;}'; // google
  26. document.getElementsByTagName('head')[0].appendChild(style)