Machine Flower Next Link in Image

Makes the image a link to the next comic, and arrow keys control movement.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Machine Flower Next Link in Image
// @namespace   http://userscripts.org/users/Scuzzball
// @include     http://www.machineflower.com/*
// @version     2.0
// @description Makes the image a link to the next comic, and arrow keys control movement.
// @grant       none
// ==/UserScript==


var nextPatt = /next/
if(nextPatt.test(document.getElementById('menunav').childNodes[2].innerHTML))
{
	var navNext = document.getElementById('menunav').childNodes[2];
}
else
{
	var navNext = ""
}


document.getElementById('comic').innerHTML = '<a href="' + navNext + '">' + document.getElementById('comic').innerHTML + '</a>';

function leftArrowPressed() {
	window.location = document.getElementById('menunav').childNodes[1];
}

function rightArrowPressed() {
	window.location = navNext;
}

document.onkeydown = function(evt) {
    evt = evt || window.event;
    switch (evt.keyCode) {
        case 37:
            leftArrowPressed();
            break;
        case 39:
            rightArrowPressed();
            break;
    }
};