By Micah Bucy
—
Last update
Mar 13, 2006
—
Installed
2,935 times.
// ==UserScript==
// @name deviantART Big Thumbnails Enhanced
// @namespace http://romanito.free.fr/userscripts/
// @description Enable big thumbnails in deviantART pages
// @include http://*deviantart.com/*
// @version 1.1
// ==/UserScript==
(function(){
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );
for (var i=0; i<result.length; i++)
result[i] = nodes.snapshotItem(i);
return result;
}
var doc = window.document;
var divs100 = selectNodes(doc, doc.body, "//span[@class='shadow']");
var imgs, i, j, width, height;
var test="false";
for (i=0; i<divs100.length; i++)
{
imgs = selectNodes(doc, divs100[i], "child::*/child::img");
for (j=0; j<imgs.length; j++)
{
if((imgs[j].getAttribute("width")==100||imgs[j].getAttribute("height")==100)&&(imgs[j].getAttribute("width")!=150&&imgs[j].getAttribute("height")!=150)&&imgs[j].src.match("100")=="100"&&imgs[j].src.match("100W")==null) {
width=imgs[j].getAttribute("width")*1.5;
height=imgs[j].getAttribute("height")*1.5;
imgs[j].setAttribute("width", width);
imgs[j].setAttribute("height", height);
}
imgs[j].src = imgs[j].src.replace(/\/100\//i, "/150/");
imgs[j].src = imgs[j].src.replace(/\/100W\//i, "/150/");
}
}
})();