Warning: fopen(/www/sites/update.greasyfork.icu/index/store/temp/7b501c5e4c9a16393e3f63d3d02f9ed8.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name MTurk Requester Bookmarks
// @namespace localhost
// @author ThirdClassInternationalMasterTurker
// @description Add quick links for your favourite requesters to MTurk dashboard
// @include https://www.mturk.com/mturk/dashboard
// @include https://www.mturk.com/mturk/searchbar*
// @include https://www.mturk.com/mturk/findhits*
// @include https://www.mturk.com/mturk/viewhits*
// @include https://www.mturk.com/mturk/viewsearchbar*
// @include https://www.mturk.com/mturk/sortsearchbar*
// @include https://www.mturk.com/mturk/sorthits*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @version 0.2
// @downloadURL https://update.greasyfork.icu/scripts/6140/MTurk%20Requester%20Bookmarks.user.js
// @updateURL https://update.greasyfork.icu/scripts/6140/MTurk%20Requester%20Bookmarks.meta.js
// ==/UserScript==
//
// 2012-12-03 0.1: First public version
//
// 2012-12-05 0.2: You can now add any links as bookmark (Copy paste some
// custom search from browsers address bar for example)
//
(function ()
{
//GM_deleteValue('REQUESTER BOOKMARKS');
var add_div = null;
var input1;
var input2;
function remove_bookmark(requester, requesterId)
{
var t = GM_getValue('REQUESTER BOOKMARKS');
if (t == null || t == '')
return;
else
t = t.split(';');
var bookmarks = '';
for (var i=0; i 0 && input2.value.length > 0)
add_bookmark(input1.value, input2.value);
input1.value = '';
input2.value = '';
add_div.style.display = 'none';
};
}
function add_bookmark_func(requester, requesterId)
{
return function()
{
if (confirm('Add requester "' + requester + '" to your dashboard?') == true)
add_bookmark(requester, requesterId);
};
}
function remove_bookmark_func(requester, requesterId, bm_div)
{
return function()
{
if (confirm('Remove requester "' + requester + '" from your dashboard?') == true)
{
remove_bookmark(requester, requesterId);
bm_div.textContent = 'REMOVED';
}
};
}
if (window.location.href == 'https://www.mturk.com/mturk/dashboard')
{
var footer = document.getElementsByClassName('footer_separator')[0];
if (footer == null)
return;
var extra_table = document.createElement('table');
extra_table.width = '700';
extra_table.style.boder = '1px solid black';
extra_table.align = 'center';
extra_table.cellSpacing = '0px';
extra_table.cellPadding = '0px';
var row1 = document.createElement('tr');
var row2 = document.createElement('tr');
var td1 = document.createElement('td');
var td2 = document.createElement('td');
var whatsthis = document.createElement('a');
var add_button = document.createElement('button');
var content_td = [];
content_td[0] = document.createElement('td');
content_td[1] = document.createElement('td');
content_td[2] = document.createElement('td');
row1.style.height = '25px';
td1.setAttribute('class', 'white_text_14_bold');
td1.style.backgroundColor = '#7fb448';//'#7fb4cf';
td1.style.paddingLeft = '10px';
td1.colSpan = '2';
td1.innerHTML = 'Bookmarks ';
td2.setAttribute('class', 'white_text_14_bold');
td2.style.backgroundColor = '#7fb448';//'#7fb4cf';
td2.style.paddingRight = '10px';
td2.style.textAlign = 'right';
//td2.style.widht = '200px';
content_td[0].setAttribute('class', 'container-content');
content_td[1].setAttribute('class', 'container-content');
content_td[2].setAttribute('class', 'container-content');
content_td[0].style.width = '33%';
content_td[1].style.width = '34%';
content_td[2].style.width = '33%';
content_td[0].style.verticalAlign = 'top';
content_td[1].style.verticalAlign = 'top';
content_td[2].style.verticalAlign = 'top';
whatsthis.href = 'http://userscripts.org/scripts/show/153363';
whatsthis.setAttribute('class', 'whatis');
whatsthis.textContent = '(What\'s this?)';
add_button.textContent = 'add new bookmark';
add_button.title = 'Add new bookmark';
add_button.style.fontSize = '9px';
add_button.style.border = '1px solid';
add_button.style.padding = '0px';
add_button.style.color = 'white';
add_button.style.textAlign = 'right';
add_button.style.backgroundColor = 'transparent';
add_button.addEventListener("click", function() { add_bookmark_dialog(); }, false);
extra_table.appendChild(row1);
row1.appendChild(td1);
row1.appendChild(td2);
td1.appendChild(whatsthis);
td2.appendChild(add_button);
extra_table.appendChild(row2);
row2.appendChild(content_td[0]);
row2.appendChild(content_td[1]);
row2.appendChild(content_td[2]);
var l=0;
var bookmarks = get_bookmarks();
while (l