Permalink
Browse files

Fixed the various leftover references to requesterReviewsTurkerview /…

… old option settings
  • Loading branch information...
Chris Turk
Chris Turk committed Feb 4, 2019
1 parent 370323b commit a8282a02a5d7525cea7f353e4646b73e269e0d1b
@@ -202,7 +202,7 @@ function plainTemplateReviews(hit) {
]);

if (options.requesterReviews) {
const turkerview = options.requesterReviewsTurkerview
const turkerview = options.turkerview
? plainTemplateTurkerView(hit, reviews)
: ``;
const turkopticon = options.requesterReviewsTurkopticon
@@ -280,8 +280,8 @@ function bbCodeTemplateReviews(hit) {
StorageGetKey(`options`)
]);

if (options.requesterReviews) {
const turkerview = options.requesterReviewsTurkerview
if (options.turkerview) {
const turkerview = options.turkerview
? bbCodeTemplateTurkerView(hit, reviews)
: ``;
const turkopticon = options.requesterReviewsTurkopticon
@@ -231,7 +231,8 @@ <h6>TurkerView's API Is Upgrading</h6>
<p>Sorry for the intrusion, but we're expanding our services & infrastructure and making huge improvements to the way we deliver information & data to Turkers in 2019 - including improvements to approval (AA) time tracking!</p>
<p>Part of those changes mean that without an API Key MTS wont be able to retrieve information from our servers soon. You can find more information about the full API changes <a href="https://forum.turkerview.com/threads/view-api-details.2012/" target="_blank" style="text-decoration: underline;">on our announcement here</a>.</p>
<p>For now, though, we've upgraded our API & left access open so we don't disrupt your day to day workflow. We've also <a href="https://forum.turkerview.com/threads/mturk-suite-turkerview-additions.2039/" target="_blank">written about the changes/additions to MTS</a> - please consider giving it a look to get the most out of MTS' new features!</p>
<p>Make sure to register & get your new access keys to our upgraded API by <a href="https://turkerview.com/account/api/" target="_blank" style="text-decoration: underline;">visiting your account dashboard</a>. We'll stop displaying this as soon as you do, but the script wont function after <strong><u>February 7th</u></strong> without an API Key.</p>
<p>Make sure to register & get your new access keys to our upgraded API by <a href="https://turkerview.com/account/api/" target="_blank" style="text-decoration: underline;">visiting your account dashboard</a>. We'll stop displaying this as soon as you do, but the script wont be able to retrieve all data from TurkerView after <strong><u>February 7th</u></strong> without an API Key.</p>
<p>MTS will still function without TurkerView!</p>
<p>You can save your TurkerView API Key in <a href="/options/options.html" target="_blank">MTurk Suite's Options</a> panel or below:</p>
<input id="view-api-key" type="text" class="form-control" style="max-width: 50%; margin-top: 5px; margin-bottom: 5px;">
<button id="view-api-save" type="submit" class="btn btn-primary">Save API Key</button>
@@ -637,8 +637,7 @@ chrome.storage.local.get(`options`, (keys) => {
if (
options.turkerviewApiKey.length == 40 ||
options[`disable-tv-announcement`] ||
!options.requesterReviews ||
!options.requesterReviewsTurkerview
!options.turkerview
)
document.getElementById(`tv-finder-announce`).style.display = `none`;

@@ -656,12 +655,6 @@ chrome.storage.local.get(`options`, (keys) => {
});

document.getElementById(`disable-finder-tv-announcement`).addEventListener(`click`, function() {
if (
!confirm(
`Are you sure you want to hide this reminder? HIT Finder will be unable to retrieve TV data without an API Key after February 7th`,
)
)
return;
options[`disable-tv-announcement`] = true;
chrome.storage.local.set({ options });
$(`#turkerview-finder-announcement-modal`).modal(`toggle`);
@@ -810,11 +803,11 @@ async function handleTurkopticon(rids) {
function reviewsForFinder(rids) {
chrome.storage.local.get([`options`], ({ options }) => {
if (options.turkopticon) {
handleTurkerview(rids);
handleTurkopticon(rids);
}

if (options.turkerview) {
handleTurkopticon(rids);
handleTurkerview(rids);
}
});
}
@@ -22,7 +22,7 @@ const turkopticonClass = ({ average }) => {

const turkerviewHTML = (hit, review) => {
const { requester_id } = hit;
const userApiKey = false;
//const userApiKey = false;

if (!review.ratings)
return HTML`<div class="col-xs-12" style="font-size: 1rem;">
@@ -140,13 +140,14 @@ function buildReturnWarnings(json){
if (json['broken_total'] + json['underpaid_total'] + json['unpaid_screener_total'] + json['tos_total'] + json['writing_total'] + json['inquisit_total'] == 0) return;

let highest_warning_class = 'text-danger';
let x = Number(json['broken_total']) + Number(json['underpaid_total']) + Number(json['unpaid_screener_total']) + Number(json['tos_total']) + Number(json['writing_total']) + Number(json['downloads_total']);

document.querySelectorAll(`.work-pipeline-action`).forEach(el => {
el.insertAdjacentHTML(`afterbegin`, `<a ${highest_warning_class == 'hidden' ? 'style="display: none;"' : ''} class="btn btn-danger mts-tv-return-warning-data-launcher" href="#" style="margin-right: 5px;"><i class="fa fa-fw fa-warning"></i></a>`);
el.insertAdjacentHTML(`afterbegin`, `<a ${highest_warning_class == 'hidden' ? 'style="display: none;"' : ''} class="btn btn-danger mts-tv-return-warning-data-launcher" href="#" style="margin-right: 5px;"><i class="fa fa-fw fa-warning"></i> ${x}</a>`);
})

document.querySelectorAll(`.task-project-title`).forEach(el => {
el.insertAdjacentHTML(`afterbegin`, `<div ${highest_warning_class == 'hidden' ? 'style="display: none;"' : 'style="display: inline-block;"'}><i class="fa fa-warning ${highest_warning_class} mts-tv-return-warning-data-launcher" style="cursor: pointer; padding-right: 3px;"></i></div>`);
el.insertAdjacentHTML(`afterbegin`, `<div ${highest_warning_class == 'hidden' ? 'style="display: none;"' : 'style="display: inline-block;"'}><i class="fa fa-warning ${highest_warning_class} mts-tv-return-warning-data-launcher" style="cursor: pointer; padding-right: 3px;"> (${x})</i></div>`);
})

let btnHtml = `<i class="fa fa-warning fa-fw ${highest_warning_class} mts-tv-return-warning-data-launcher" style="line-height: 1rem; cursor: pointer; ${highest_warning_class == 'hidden' ? 'display: none;' : ''}" data-toggle="tooltip" data-title="Oh shit!"></i>`;
@@ -355,7 +356,7 @@ function buildHeaders(userApiKey){
chrome.storage.local.get([`options`], keys => {
userApiKey = keys.options.turkerviewApiKey || ``;
buildHeaders(userApiKey);
if (!keys.options.requesterReviewsTurkerview || !keys.options.requesterReviews) return;
if (!keys.options.turkerview) return;
initReturnReviews();
})

@@ -402,7 +402,7 @@
>TurkerView API Key (<a href="https://turkerview.com/account/api/" target="_blank">Get API Key</a>)</label
>
<input name="turkerviewApiKey" type="text" spellcheck="false" class="form-control" />
<div id="turkerviewConnected" class="alert alert-success" style="margin: 5px; display: none;">
<div id="turkerviewConnected" class="alert alert-success" style="margin: 5px;">
<p style="margin-bottom: 0;">Connected!</p>
</div>
</div>

0 comments on commit a8282a0

Please sign in to comment.