deviantart large gallery thumbnails

By Micah Bucy Last update Nov 15, 2006 — Installed 1,395 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// ==UserScript==
// @name	deviantart large gallery thumbnails
// @namespace	http://cs.wheaton.edu/~mbucy
// @description	"Fixes" gallery view by enlarging thumbnails
// @include	http://*.deviantart.com/gallery/*
// ==/UserScript==


/* original idea by doofsmack incorporated to deviantart v5 format by Micah Bucy aka eternalsword */
document.body.setAttribute('class','deviant hi-res ready ' + location.href.replace(/http:\/\//g,'').replace(/(\.|\/)/g,'-').toLowerCase());
var newWidth = 300;
for(i=1;i<=24;i++) {
	var maxheight = 0;
	var im = document.evaluate("//div[@class='stream']/div[" + String(i) + "]/span/span/a/img", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
        if(im.snapshotLength>=1) {
        	im = im.snapshotItem(0);
		im.height = (im.height/im.width) * newWidth;
		im.width = newWidth;
		im.src = String(im.src).replace(/150/, newWidth==300?"300W":String(newWidth));
		if(im.height > maxheight) maxheight = im.height;
	}
}