GoldenAgeComics for Webcomic Reader

Alternative to the currently unusable online viewer to be used with Webcomic Reader (http://userscripts.org/scripts/show/59842). Must be executed before Webcomic Reader to work

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           GoldenAgeComics for Webcomic Reader
// @author         ameboide
// @version        2011.05.25
// @namespace      http://userscripts.org/scripts/show/103786
// @description    Alternative to the currently unusable online viewer to be used with Webcomic Reader (http://userscripts.org/scripts/show/59842). Must be executed before Webcomic Reader to work
// @include        http://www.goldenagecomics.co.uk/*?dlid=*
// @include        http://goldenagecomics.co.uk/*?dlid=*
// @include        http://goldenagecomics.co.uk/comicreader/getComic.php?did=*
// ==/UserScript==

if(document.location.href.indexOf("dlid=") > 0){
	var linkOrig = document.querySelector('a[href^="comicreader"]');

	linkOrig.parentNode.innerHTML =
		'<a href="http://goldenagecomics.co.uk/comicreader/getComic.php?did=' +
		linkOrig.href.match(/did=(\d+)/)[1] +
		'">View with Webcomic Reader</a> ' +
		linkOrig.parentNode.innerHTML;
}
else{
	var imgs = document.body.innerHTML.match(/http:.+\.jpg/g);

	if(!imgs) html = "There's nothing here :(";
	else{
		var html = '<div id="cont"></div><div style="display:none">';
		for(var i=0; i<imgs.length; i++)
			html += '<a id="img_'+i+'" href="'+imgs[i]+'" >'+i+'</a> ';
		html += '</div>';
	}
	document.body.innerHTML = html;
}