User:Dizzysaurus

From Voice of the Proletariat

Jump to: navigation, search

email dizzysaurus at gmail

Greasemonkey script to resize huge images:

// ==UserScript==
// @name           image-resize
// @namespace      http://userscripts.org/scripts/show/7780
// @include        http://*bannination.com/*
// ==/UserScript==
var z = document.getElementsByTagName('img');
for (i = 0; i < z.length; i++) {
    if (z[i].width >= screen.width * 0.75) {
        var original_width = z[i].width;
        z[i].width = screen.width * 0.75;
        var ratio = original_width / z[i].width;
        z[i].height = z[i].height / ratio;
    }
}

Greasemonkey script to ignore a specific user:

// ==UserScript==
// @name           screwEm
// @namespace      banninations
// @description    get rid of annoying user comments
// @include        *www.bannination.com/comments*
// ==/UserScript==
hatedUser = "USERNAMEHERE";
var allDivs, thisDiv;
allDivs = document.evaluate(
    "//div[span/a='" + hatedUser + "']/following-sibling::div[position()=1] | //div[span/a='" + hatedUser + "']",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < allDivs.snapshotLength; i++) {
    thisDiv = allDivs.snapshotItem(i);
	thisDiv.parentNode.removeChild(thisDiv);
}
Personal tools