Highlight Unhighlightable Text (CrowdSource)

Allows highlighting of unhighlightable text.

  1. // ==UserScript==
  2. // @name Highlight Unhighlightable Text (CrowdSource)
  3. // @namespace http://mturkwiki.net/forums
  4. // @version 1.0
  5. // @description Allows highlighting of unhighlightable text.
  6. // @match https://*.mturk.com/*
  7. // @match https://work.crowdsource.com/amt/view*
  8. // @grant GM_setClipboard
  9. // ==/UserScript==
  10. function withPages_jQuery(NAMED_FunctionToRun)
  11. {
  12. var funcText = NAMED_FunctionToRun.toString ();
  13. var funcName = funcText.replace (/^function\s+(\w+)\s*\((.|\n|\r)+$/, "$1");
  14. var script = document.createElement("script");
  15. script.textContent = funcText + "\n\n";
  16. script.textContent += 'jQuery(document).ready(function() {'+funcName+'(jQuery);});';
  17. document.body.appendChild(script);
  18. };
  19. function main0($)
  20. {
  21. function create_href(self)
  22. {
  23. /*div = document.createElement("div");
  24. div.innerHTML = "Copy"
  25. div.text0 = self.innerText.replace("Keyword: ", "");
  26. div.addEventListener("click", function()
  27. {
  28. GM_setClipboard(div.text0);
  29. });
  30. self.appendChild(div);*/
  31. }
  32. function gen_search_url(text)
  33. {
  34. text = text.replace(" ", "+")
  35. text = "https://www.google.com/search?channel=fs&q=" + text + "&ie=utf-8&oe=utf-8";
  36. return text;
  37. }
  38. $.extend($.fn.enableTextSelect = function()
  39. {
  40. return this.each(function()
  41. {
  42. $(this).unbind("mousedown");
  43. create_href(this);
  44. });
  45. });
  46. $(this).unbind("mousedown");
  47. $("h2.text-rep")
  48. .enableTextSelect()
  49. .attr("unselectable", "off")
  50. .css({"-moz-user-select":"auto","-webkit-user-select":"auto","user-select":"auto"});
  51. console.log("Selectoid finished");
  52. }
  53. if (window.top === window.self)
  54. {
  55. //withPages_jQuery(main0);
  56. }
  57. else
  58. {
  59. withPages_jQuery(main0);
  60. }