Code:
// ==UserScript==
// @name Hotel Photos - Image Review - building exteriors - not the other image review hits
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author turker
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// @include *
// ==/UserScript==
document.getElementsByName("ID01_DoesImageContainExterior")[0].focus();
var counter = 0;
var counter2 = 0;
var question = [];
question[0] = "_DoesImageContainExterior";
question[1] = "_DoesContainMoreThanOneBuilding";
question[2] = "_DoesImageContainOver75";
question[3] = "_IsBuildingRestaurantOrStore";
question[4] = "_IsBuildingPrimarySubject";
document.getElementsByTagName("body")[0].onkeydown = function(event) {
for (i=0;i<=question.length;i++) {
if ((i === counter) || (i == counter)) {
rightQuestion1 = 0;
rightQuestion2 = 1;
if (event.keyCode == 49) {
document.getElementsByName("ID0" + (counter2+1) + question[counter])[0].click();
}
else if (event.keyCode == 50) {
document.getElementsByName("ID0" + (counter2+1) + question[counter])[1].click();
}
counter = counter + 1;
break;
}
}
if (event.keyCode == 51) {
counter2 = counter2 + 1;
document.getElementsByName("ID0" + (counter2 + 1) + "_DoesImageContainExterior")[0].focus();
}
};
can someone please help me with my script? it works great for the first pic. it doesn't work for the other 4 pics. it's supposed to be on keydown 1 is yes, 2 is no, 3 is move to the next pic.
@Kerek ?
@Kadauchi ? it does move the focus to the 2nd pic. it's broken after that.