Skip to content

Commit

Permalink
Fixed the various leftover references to requesterReviewsTurkerview /…
Browse files Browse the repository at this point in the history
… old option settings
  • Loading branch information
Chris Turk committed Feb 4, 2019
1 parent 370323b commit a8282a0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
6 changes: 3 additions & 3 deletions background/hit-exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion hit-finder/hit-finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
13 changes: 3 additions & 10 deletions hit-finder/hit-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;

Expand All @@ -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`);
Expand Down Expand Up @@ -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);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion mturk/reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;">
Expand Down
7 changes: 4 additions & 3 deletions mturk/turkerview/return-reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>`;
Expand Down Expand Up @@ -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();
})

Expand Down
2 changes: 1 addition & 1 deletion options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit a8282a0

Please sign in to comment.