CH Remaining HITs Replicator

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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>" );


}