// ==UserScript== // @name mmmturkeybacon Preview Overlay // @version 1.02 // @description Covers a HIT's workspace with a gray overlay if the HIT has not been accepted. Clicking once on the overlay will remove the gray foreground and allow you to interact with the HIT's contents while still showing a message warning you the hit has not been accepted. // @author mmmturkeybacon // @namespace http://userscripts.org/users/523367 // @include http://*/* // @include https://*/* // @exclude https://www.mturk.com/mturk/takequalificationtest // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js // @grant GM_log // @downloadURL https://update.greasyfork.icu/scripts/9487/mmmturkeybacon%20Preview%20Overlay.user.js // @updateURL https://update.greasyfork.icu/scripts/9487/mmmturkeybacon%20Preview%20Overlay.meta.js // ==/UserScript== $(window).load(function() { var $hit_wrapper = $('div[id="hit-wrapper"]'); if(window.location.hostname == 'www.mturk.com' && $hit_wrapper.length > 0) {//internal HIT $hit_wrapper.css({"position": "relative"}); var offset = $hit_wrapper.offset(); $hit_wrapper.append('
\

Preview

'); $('div[id="mtb_preview_overlay"]').bind('click', function() { this.style.pointerEvents = "none"; this.style.backgroundColor = "rgba(0, 0, 0, 0.0)"; this.style.color = "#F00"; }); } else if(window.location != window.top.location === true && window.location.href.indexOf("ASSIGNMENT_ID_NOT_AVAILABLE") > -1) {//external HIT $('div[id="preview_overlay"]').remove(); $('body').append('
\

Preview

'); $('div[id="mtb_preview_overlay"]').bind('click', function() { this.style.pointerEvents = "none"; this.style.backgroundColor = "rgba(0, 0, 0, 0.0)"; this.style.color = "#F00"; }); } });