Categorization Map

enter something useful

18.08.2015 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name       Categorization Map
// @version    0.8
// @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);

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;
    }
}