Mturk Submit Button

adds a submit button for broken hits

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Mturk Submit Button
// @namespace    https://greasyfork.org/en/scripts/458265-mturk-submit-button
// @version      0.1
// @description  adds a submit button for broken hits
// @author       Elias041
// @license      none
// @match        https://worker.mturk.com/projects/*/tasks/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mturk.com
// @require      http://code.jquery.com/jquery-1.9.1.js
// @require      https://code.jquery.com/ui/1.9.2/jquery-ui.js
// @resource     https://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css
// @grant        GM_addStyle
// ==/UserScript==

window.onload = function () {
    let t = document.getElementsByClassName("col-xs-5 col-md-3 text-xs-right p-l-0")[0],
        e = t.parentNode,
        o = document.createElement("button");
    (o.style.background = "#D0342C"),
        (o.style.border = "none"),
        (o.style.padding = "0px 14px"),
        (o.style.fontSize = "15px"),
        (o.style.color = "#fff"),
        (o.id = "button"),
        (o.innerHTML = "Force&nbspSubmit"),
        e.insertBefore(o, t),
        document.getElementById("button").addEventListener("click", function e() {
            if (t) {
                var o = document.getElementsByTagName("form")[0];
                $("<p>Attempt to submit a broken HIT?</p>").dialog({
                    position: { my: "left top", at: "left bottom", of: button },
                    width: "auto",
                    modal: !0,
                    buttons: {
                        Ok: function () {
                            console.log(o.id), document.getElementById(o.id).submit();
                        },
                        Cancel: function () {
                            console.log("Cancelled"), $(this).dialog("close");
                        },
                    },
                });
            }
        });
};