Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Planet9
- // @namespace http://www.zooniverse.org
- // @description Keyboard control for Zooniverse Planet 9 project
- // @version 1
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
- // @include https://www.zooniverse.org/projects/marckuchner/backyard-worlds-planet-9/classify
- // @grant none
- // ==/UserScript==
- document.addEventListener('keydown',function(e) {
- if (e.which==37) pip(-1);
- else if (e.which==39) pip(1);
- else if (e.which==13) $('.continue').click();
- });
- function pip(x) {
- pips=$('.subject-frame-pips');
- n=pips.children('BUTTON').length;
- i=pips.children('BUTTON.active').index();
- i+=x;
- i=i%n;
- pips.children('BUTTON').eq(i).click();
- }
Add Comment
Please, Sign In to add comment