CH MTurk Page Titles

Change MTurk page titles to be more specific, instead of most just saying "Amazon Mechanical Turk".

目前為 2014-07-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        CH MTurk Page Titles
// @author      clickhappier
// @namespace   clickhappier
// @description Change MTurk page titles to be more specific, instead of most just saying "Amazon Mechanical Turk".
// @version     1.0c
// @require     http://code.jquery.com/jquery-latest.min.js
// @match       http://www.mturk.com/*
// @match       https://www.mturk.com/*
// @grant       none
// ==/UserScript==

var original_title = document.title;

// avoid redundancy from what will be appended
if (original_title == "Amazon Mechanical Turk - All HITs")
{
    original_title = "Amazon Mechanical Turk";
}
else if (original_title == "Amazon Mechanical Turk - HITs Available to You")
{
    original_title = "Amazon Mechanical Turk";
}
else if (original_title == "Amazon Mechanical Turk - All Qualifications")
{
    original_title = "Amazon Mechanical Turk";
}
else if (original_title == "Amazon Mechanical Turk-Your Pending Qualification Requests")
{
    original_title = "Amazon Mechanical Turk";
}
else if (original_title == "Amazon Mechanical Turk - Transfer Earnings")
{
    original_title = "Amazon Mechanical Turk";
}

// append heading-esque text from page content
if ( $('td.title_orange_text_bold').text().trim() != "" )
{
	document.title = original_title + " - " + $('td.title_orange_text_bold').text().trim() + " - " + $('td.title_orange_text').text().trim();
}
else if ( $('td.capsulelink_bold').text().trim() != "" )
{
	document.title = original_title + " - " + $('td.capsulelink_bold').text().trim();
}
else if ( $('div.contactus form p').first().text().trim() != "" )
{
	document.title = original_title + " - " + $('div.contactus form p').first().text().trim();
}
else if ( $('td.white_text_14_bold').text().trim() != "" )
{
	document.title = original_title + " - " + $('td.white_text_14_bold').contents().filter(function(){return this.nodeType == 3;})[0].nodeValue.trim();  // exclude text inside another layer of nested tags such as 'a' or 'span'
}
else if ( $('td.error_title').text().trim() != "" )
{
	document.title = original_title + " - " + $('td.error_title').text().trim() + " - " + document.getElementById('searchbox').value;
}