Categorization Map

enter something useful

اعتبارا من 18-08-2015. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name       Categorization Map
// @version    0.9
// @description  enter something useful
// @match      https://s3.amazonaws.com/mturk_bulk/hits*
// @require     http://code.jquery.com/jquery-latest.min.js
// @copyright  2014+, Tjololo
// @namespace https://greasyfork.org/users/710
// ==/UserScript==

var elem = $("p.ng-scope:last").text();
var addy = elem.split(':')[1];
console.log(addy);
var api = "";
var zoomlevel = 20;
var googlePrefix = "https://maps.googleapis.com/maps/api/staticmap?markers=size:mid%7Ccolor:red%7C";
var url = googlePrefix + encodeURIComponent(addy.replace(",","")) + "&size=512x512&zoom="+zoomlevel+"&maptype=hybrid&sensor=false";
if (api != "")
    url += "&key="+api;
console.log(url);
var ifrm = document.createElement("img");
ifrm.setAttribute("src", url);
ifrm.setAttribute("id", "map");
ifrm.style.width = 512+"px";
ifrm.style.height = 512+"px";

var zoomlvl = document.createElement("div");
zoomlvl.setAttribute("id","zoom_level");
zoomlvl.innerHTML="Zoom: "+zoomlevel;

$("div.span7.ng-scope").append(ifrm);
$("div.span7.ng-scope").append(zoomlvl);

$("[id='Completely Shaded']").text("A - Completely Shaded");
$("[id='Mostly Shaded']").text("B - Mostly Shaded");
$("[id='Mostly Not Shaded']").text("C - Mostly not Shaded");
$("[id='Completely NOT Shaded']").text("D - Completely NOT Shaded");
$("[id='House Not Visible']").text("E - House Not Visible");
$("#guidelines").hide();

var content = document.getElementById("wrapper");
content.tabIndex = "0";
content.focus();

var element = document.getElementById('preview_overlay');
if (element)
    element.parentNode.removeChild(element);

document.onkeydown = showkeycode;
function showkeycode(evt){
    var keycode = evt.keyCode;
    switch (keycode) {
        case 65: //a
            $("[id='Completely Shaded']").click();
            document.getElementById("mturk_form").submit();
            break;
        case 66: //b
            $("[id='Mostly Shaded']").click();
            document.getElementById("mturk_form").submit();
            break;
        case 67: //c
            $("[id='Mostly Not Shaded']").click();
            document.getElementById("mturk_form").submit();
            break;
        case 68: //d
            $("[id='Completely NOT Shaded']").click();
            document.getElementById("mturk_form").submit();
            break;
        case 69: //e
            $("[id='House Not Visible']").click();
            document.getElementById("mturk_form").submit();
            break;
        case 13: //enter
            document.getElementById("mturk_form").submit();
            break;
        case 107: //+
            zoomlevel += 1;
            url = googlePrefix + encodeURIComponent(addy.replace(",","")) + "&size=512x512&zoom="+zoomlevel+"&maptype=hybrid&sensor=false";
            console.log(url);
            document.getElementById("map").setAttribute("src", url);
            document.getElementById("zoom_level").innerHTML="Zoom: "+zoomlevel;
            break;
        case 187: //+
            zoomlevel += 1;
            url = googlePrefix + encodeURIComponent(addy.replace(",","")) + "&size=512x512&zoom="+zoomlevel+"&maptype=hybrid&sensor=false";
            console.log(url);
            document.getElementById("map").setAttribute("src", url);
            document.getElementById("zoom_level").innerHTML="Zoom: "+zoomlevel;
            break;
        case 109: //+
            zoomlevel -= 1;
            url = googlePrefix + encodeURIComponent(addy.replace(",","")) + "&size=512x512&zoom="+zoomlevel+"&maptype=hybrid&sensor=false";
            console.log(url);
            document.getElementById("map").setAttribute("src", url);
            document.getElementById("zoom_level").innerHTML="Zoom: "+zoomlevel;
            break;
        case 189: //+
            zoomlevel -= 1;
            url = googlePrefix + encodeURIComponent(addy.replace(",","")) + "&size=512x512&zoom="+zoomlevel+"&maptype=hybrid&sensor=false";
            console.log(url);
            document.getElementById("map").setAttribute("src", url);
            document.getElementById("zoom_level").innerHTML="Zoom: "+zoomlevel;
            break;
    }
}