[MTURK] Queue Header Link

Adds a link to your HITs queue into the MTurk header on worker site [www deprecated].

目前為 2017-12-13 提交的版本,檢視 最新版本

// ==UserScript==
// @name         [MTURK] Queue Header Link
// @namespace    https://greasyfork.org/en/users/150063-trickydude24
// @description  Adds a link to your HITs queue into the MTurk header on worker site [www deprecated].
// @author       Trickydude24
// @version      2.0
// @match        https://worker.mturk.com/*
// @match        https://www.mturk.com/mturk/dashboard*
// @grant        none
// ==/UserScript==

// Worker Site - Dashboard & Earnings Page//
if ((/^https?:\/\/(www\.)?worker\.mturk\.com\/dashboard.*/.test(location.href))||(/^https?:\/\/(www\.)?worker\.mturk\.com\/earnings.*/.test(location.href))) {
           $(".nav.navbar-nav.hidden-xs-down").append('<li class="nav-item"><a class="nav-link" href="https://worker.mturk.com/tasks">HITs Queue</a></li>');
}

// Worker Site - HIT Pages (Accepted and Preview pages) //
else if (/^https?:\/\/(www\.)?worker\.mturk\.com\/projects\/.*/.test(location.href)) {
    if ($(".nav.navbar-nav.hidden-xs-down")[0]){
    // HIT is in PREVIEW mode
        $(".nav.navbar-nav.hidden-xs-down").append('<li class="nav-item"><a class="nav-link" href="https://worker.mturk.com/tasks">HITs Queue</a></li>');
    }
    else {
    // HIT is ACCEPTED
    $(".col-xs-12.navbar-content a:first-child:first").after('<span style="margin: 0 40px;"><a class="nav-link" href="https://worker.mturk.com/tasks">HITs Queue</a></span>');
           }
     }


// Old WWW Site //
else if (/^https?:\/\/(www\.)?mturk\.com\/mturk\/dashboard.*/.test(location.href)) {
var theDiv = document.getElementById('subtabs');
theDiv.innerHTML += '<span class="almostblack_text">&nbsp;|&nbsp;</span><a href="/mturk/myhits" class="subnavclass">HITs Queue</a>';
}