Warning: fopen(/www/sites/update.greasyfork.icu/index/store/temp/c0096e5c2b41f3646f017397cf582a63.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name Block Individual Requests
// @author Turksquatch
// @version 0.0.5
// @namespace http://www.turksquatch.com/
// @homepage http://mturkforum.com/showthread.php?4441-New-Script-to-Block-Individual-Hits&p=56939
// @description Hide individual HITs you're not interested in.
// @include https://www.mturk.com/mturk/findhits*
// @include https://www.mturk.com/mturk/searchbar*
// @include https://www.mturk.com/mturk/viewsearchbar*
// @include https://www.mturk.com/mturk/sortsearchbar*
// @include https://www.mturk.com/mturk/sorthits*
// @include https://www.mturk.com/mturk/viewhits*
// @downloadURL https://update.greasyfork.icu/scripts/6258/Block%20Individual%20Requests.user.js
// @updateURL https://update.greasyfork.icu/scripts/6258/Block%20Individual%20Requests.meta.js
// ==/UserScript==
requestIndex = GM_getValue("requestIndex");
if(!requestIndex) {
//alert(requestIndex);
requestIndex="";
GM_setValue("requestIndex","");
}
function showUpdates() {
updated = GM_getValue('requestUpdated');
if (updated) {
tables = document.evaluate("//table",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
table = tables.snapshotItem(6);
action = updated.split(',');
rId = action[1].split('::')[0];
rName = action[1].split('::')[1];
div = document.createElement('div');
div.id = 'updated';
status = "";
table.parentNode.insertBefore(div, table);
GM_deleteValue('requestUpdated');
}
}
function hideHIT(element) {
pa=element, step=0;
while (step++ < 11) {
ch = pa;
pa = pa.parentNode;
}
pa.className = "rblocked";
}
function unhideHIT(element) {
pa=element, step=0;
while (step++ < 11) {
ch = pa;
pa = pa.parentNode;
}
pa.className = "";
}
function hideMatchingHITs() {
var numBlocked=0;
theseRequests = document.evaluate("//a[starts-with(@href,'/mturk/preview?groupId=')]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (i=0; iunblock";
rLink.parentNode.insertBefore(newElement, rLink.nextSibling);
hideHIT(rLink);
numBlocked+=1;
} else {
newElement = document.createElement('a');
newElement.innerHTML = " x";
rLink.parentNode.insertBefore(newElement, rLink.nextSibling);
}
}
return numBlocked;
}
unsafeWindow.unhideAllHITs = function () {
theseRequests = document.evaluate("//a[starts-with(@href,'/mturk/preview?groupId=')]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (i=0; i';
collapseAll.parentNode.insertBefore(showAllBlocked, collapseAll.nextSibling);
}
unsafeWindow.blockRequest = function (rId,i) {
rName = "x";
rEntry = rId+"::"+rName;
requestIndex+= rEntry+"}{";
if (confirm("Hide this HIT?")) {
window.setTimeout(function() {
GM_setValue("requestIndex", requestIndex);
GM_setValue("requestUpdated", "Blocked,"+rEntry);
}, 0);
//window.setTimeout(GM_setValue, 0, "requestIndex", requestIndex);
//window.setTimeout(GM_setValue, 0, "requestUpdated", "Blocked,"+rEntry);
document.location.reload();
}
}
unsafeWindow.unblockRequest = function (rId,rName) {
theseRequests = document.evaluate("//a[starts-with(@href,'/mturk/preview?groupId=')]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
rEntry = rId+"::"+rName;
half = requestIndex.split(rId+"::");
left = half[0];
temp = half[1].split('}{');
right = temp[1]+"}{";
if (temp.length>1) {
for (i=2;i