Author Topic: [Greasemonkey] Auto-Shrink big images, and make transparent text visible!  (Read 896 times)

Code: [Select]
[code](I have no idea what the forget is going on up here)

So I took my old topic and am remaking it because I added the transparent text thing. (http://forum.blockland.us/index.php?topic=207737.0)
[trans]Here's a demo. Try installing the userscript and refreshing this page![/trans]

Code: [Select]
// ==UserScript==
// @name       Anti-Trans and auto-shrink
// @description  makes transparent stuff visible, and makes images not be bigger than your browser.
// @version      1.2
// @match      http://forum.blockland.us/index.php*
// ==/UserScript==
var spans = document.getElementsByTagName('span');
var sl = spans.length;

for(var i = 0; i < sl; i++) {
    if(spans[i].style.color == "transparent") {
        spans[i].style.color = "red";
        spans[i].innerHTML = "[transparent]" + spans[i].innerHTML + "[/transparent]";
    }
}
var imgs = document.getElementsByTagName('img');
var img;

for (var i = 0; i < imgs.length; i++) { imgs[i].style.maxWidth = '100%'; }

Quote from: kingdaro, who took it from mygamercard.net
Running Userscripts is easy, but you may require some setup to be able to install them:

Google Chrome allows native runtime of Userscripts; just click and go! You can remove Userscripts via the 'Extensions' tab. - chrome removed this super-easy-install for security reasons or something. click the link and a little bar will pop up with info on how to install them (straight from google) I recommend tampermonkey extension.

Mozilla Firefox requires the Greasemonkey plugin before using this script.

Apple Safari's version 5 allows the installation of the NinjaKit extension (Click 'NinjaKit for Safari').

Opera is also native, but requires some setup. See 'Adding User JavaScripts' for more details, then download the script to the directory you specify.

Microsoft Internet Explorer is unfortunately left out of the party. With no native support for userscripts, and no development on addons for years (and only for earlier versions) means no automatic Leaderboards for now. :([/code]
« Last Edit: December 21, 2012, 06:22:46 PM by Lugnut »

so like

nobodies using this?

This looks really useful. At least, the auto-shrinking part does. I dunno why I'd need the trans text one.

This looks really useful. At least, the auto-shrinking part does. I dunno why I'd need the trans text one.
so you don't miss it?

I don't like it when someone posts a disclaimer about a thread in invisible text and then I go and make a joke and then the disclaimer makes me look like an idiot/jerk.

oh, I'll use this. but is it possible to zoom in the images with a click?

Here's some other older useful scripts as well:
http://forum.blockland.us/index.php?topic=182859.0
http://forum.blockland.us/index.php?topic=182626.0 (moved to drama because ignore script automatically included Lord Tony and Stocking)
http://forum.blockland.us/index.php?topic=103197.0

i find transparent text to be rather useful
auto shrink? that's a yes if it actually works

Instead of manually adding the width to every single image on the page, you could just add a style for all img elements so they are 100% width. Also, wouldn't 100% force images to fill an area as well as shrink huge images?

Instead of manually adding the width to every single image on the page, you could just add a style for all img elements so they are 100% width. Also, wouldn't 100% force images to fill an area as well as shrink huge images?
you would think so but for some dumb reason it doesn't

This is why we love yeah, Lugnut. :D

you would think so but for some dumb reason it doesn't

I was so wrapped up in the whole looping through each image and adding the style to them individually, I missed "max-width."

I was so wrapped up in the whole looping through each image and adding the style to them individually, I missed "max-width."
lol, even I don't know my own code apparently lol

I don't like it when someone posts a disclaimer about a thread in invisible text and then I go and make a joke and then the disclaimer makes me look like an idiot/jerk.
c;

also this is actually quite useful, nice job