Created
March 19, 2012 19:04
-
-
Save ready4god2513/2124182 to your computer and use it in GitHub Desktop.
Turn the page on youversion via keyboard shortcuts. This is a Chrome Userscript that can be installed by saving as youversion.user.js and dragging in to Chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Simple YouVersion Keyboard Pagination | |
// @author Brandon Hansen (https://github.com/ready4god2513) | |
// @description Turn the page on youversion via keyboard shortcuts. This is a Chrome Userscript that can be installed by saving as youversion.user.js and dragging in to Chrome. | |
// @match http://*.youversion.com/bible/* | |
// ==/UserScript== | |
document.onkeydown = function(e) | |
{ | |
if(e.keyCode == 37) | |
{ | |
document.location.href = document.getElementsByClassName("nav_prev")[0].getAttribute("href"); | |
return false; | |
} | |
else if(e.keyCode == 39) | |
{ | |
document.location.href = document.getElementsByClassName("nav_next")[0].getAttribute("href"); | |
return false; | |
} | |
} | |
// Now, if we could just do this in jQuery | |
// $(document).keydown(function(e)) | |
// { | |
// if(e.keyCode == 37) | |
// { | |
// document.location.href = $(".nav_prev").first().attr("href"); | |
// return false; | |
// } | |
// else if(e.keyCode == 39) | |
// { | |
// document.location.href = $("nav_next").first().attr("href"); | |
// return false; | |
// } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment