Mturk ID Copy/Paste

For Amazon Mechanical Turk (Mturk). Places an unobtrusive button on survey pages which provides quick access to copy your mTurk worker ID by copy and paste or drag and drop.

目前為 2015-06-03 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           Mturk ID Copy/Paste
// @author         Swole_hamster
// @license        Simplified BSD license
// @icon           http://icons.iconarchive.com/icons/flameia/rabbit-xp/32/documents-icon.png
// @version        2.42
// @namespace      http://www.mturkforum.com
// @description    For Amazon Mechanical Turk (Mturk). Places an unobtrusive button on survey pages which provides quick access to copy your mTurk worker ID by copy and paste or drag and drop.
// @include        https://www.mturk.com/mturk/dashboard
// @include	   http://*.qualtrics.com/*
// @include	   https://*.qualtrics.com/*
// @include        https://*.*.qualtrics.com/*
// @include        http://*.*.qualtrics.com/*
// @include        http://*.surveygizmo.com/*
// @include        https://*.surveygizmo.com/*
// @include        https://docs.google.com/forms/*
// @include        https://*.surveymonkey.com/*
// @include        https://*.soscisurvey.de/*
// @include        http://*.dartmouth.edu/*
// @include        https://*.dartmouth.edu/*
// @include        https://*.vennliapp.com/*
// @include        http://*.ualberta.ca/*
// @include        https://*.unipark.de/*
// @include        http://*.unipark.de/*
// @include        https://unipark.de/*
// @include        http://*.*.brown.edu/*
// @include        http://*.*.columbia.edu/*
// @include        https://*.*.columbia.edu/*
// @include        http://www.marshlabduke.com/*
// @include        https://*.typeform.com/*
// @include        http://surveys*.surveyanalytics.com/*
// @include        http://*.cspurdue.com/*
// @include        http://questionpro.com/*
// @include        https://*.kwiksurveys.com/*
// @include        https://*.wonderliconline.com/*
// @include        http://*.lab42.com/*
// @include        http://turkitron.com/*
// @include        https://umdsurvey.umd.edu/*
// @include        http://mprlab327.webfactional.com/*
// @include        http://www.psy.de/
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_registerMenuCommand
// ==/UserScript==

$ = unsafeWindow.$;


workerID = GM_getValue("workerID");
if(!workerID || workerID === "") {
	if (window.location.href == "https://www.mturk.com/mturk/dashboard") {
		workerIDNode = document.evaluate("//span[@class='orange_text_right']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
		for (i=0; i<workerIDNode.snapshotLength; i++) {
			nd = workerIDNode.snapshotItem(i);
			idstring = nd.innerHTML;
			workerID = idstring.split(': ')[1];
			GM_setValue("workerID",workerID);
		}
	} else {
		workerID="";
		GM_setValue("workerID","");
	}
} else {
    if (!/https?:\/\/www.mturk.com\/mturk\/*/.test(window.location.href)) {
		idDiv = document.createElement('div');
		idDiv.id = "workerIDDiv";
 		idInner = "<input type='text' onmouseover='javascript:this.focus();this.select() ;' onmouseout='javascript:this.blur();' value='" + workerID + "' style='position:fixed;border:thick solid #010101;top:20px;z-index:10000;right:1px;padding:5px 3px;background:#560E49;font-size:14px;color:white;' readonly/>";
		idDiv.innerHTML = idInner;
		document.body.insertBefore(idDiv,document.body.firstChild);
	}
}