CH Remaining HITs Replicator

Replicates the 'HITs Available' number underneath the HIT work area for ease of reference.

当前为 2014-09-03 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        CH Remaining HITs Replicator
// @author      clickhappier
// @namespace   clickhappier
// @description Replicates the 'HITs Available' number underneath the HIT work area for ease of reference.
// @include     https://www.mturk.com/mturk/*
// @require     http://code.jquery.com/jquery-latest.min.js
// @version     1.0c
// @grant       none
// ==/UserScript==


if ( $(document.body).find('td:contains("Finished with this HIT?")').text() !== "" )   // check for being on a HIT-in-progress page
{

// get the HITs Available number from HIT header info
var hitsRem = $(document.body).find('td[class="capsule_field_title"]:contains("HITs Available:")').next().text().trim();

// console.log( "hitsRem=" + hitsRem );

// get second (bottom) buttons area div on a HIT-in-progress page: parent0=tr, parent1=tbody, parent2=table, parent3=div
var bottomButtons = $(document.body).find('td:contains("Finished with this HIT?")').eq(2).parents().eq(3);

// console.log( "bottomButtons=" + $(bottomButtons)[0].outerHTML );

// insert the replicated HITs number html above the bottom buttons area (at the top of the div containing the table containing the buttons)
$(bottomButtons).prepend( "<span align=center>Remaining HITs Available: <b>" + hitsRem + "</b></span>" );


}