TW Greasemonkey Scripts

Pages : [1] 2 3 4 5

-Bane
02-17-2008, 03:29 AM
Tribalwar Image Embedder v1.1c (http://webspace.utexas.edu/jag2682/misc/Tribalwar_image_embedder. user.js) - click on an image link and have it display in TW instead of in a new tab / window (for the truly adventurous / lazy, turn on auto-viewing). Resizes to fit in post tables (optional, on by default).

Example: Once installed, click me (http://we6jbo.googlepages.com/Captive-Male-Lion-Laaaarge.jpg)

Testing on website which prevents hotlinking: A picture (http://underscorebleach.net/images/amazon/apache.jpg)

Testing on an image generated by a server side script:
PHP image (http://www.marvingohan.com/-/quote.php)

Testing on an image which returns a bad image to prevent hotlinking: Tripod image (http://chsict.tripod.com/images/logo.jpg)

To configure: Tools -> Greasemonkey -> User Script Commands

UPDATE: v1.1c
- If an image fails to load, the link still remains and an error message is indicated (if, for instance, the host website forbids hotlinking).
Example (http://nowhere.com/LOL.gif)

UPDATE: v1.1b
- Added feature: Option to turn off smart resizing of images.
- Changed config options to be preceded by "TW Embedder:"

UPDATE: v1.1a
- Bug fix: Images with links attached were getting "clicked" -- most prominent if you went to reply to a thread (the 5 smilies on the right were automatically "clicked" and added to the post). For a kick, click "more smilies" with an older version installed to get all smilies in your post.

UPDATE: v1.1
- Images now scale dynamically as you resize the window.
- cneal's massive images on page 3 are now resized once they are properly loaded.

========================
FAQ:
does this work for links when you have show images turned off?

Yes. In fact, if you turn on the "embed images automatically" (instead of "embed images on click") it's as if you never had "show images" turned off.

How do we know what version we're running?

Tools -> Greasemonkey -> Manage User Scripts...

Click on "Tribalwar Image Embedder" -- in the description at the top right it should have the version (ex: "v1.1a")

So I was being nosey and I checked out your project you have on your website, pretty cool stuff you are doing. You doing CS or CEN?

I'm a 3rd year computer science & math major at UT.


========================
Original post:


ok, so my previous attempt (http://www.tribalwar.com/forums/showthread.php?t=528356) didn't take off since no one uses NWS tags. So I came up with this script which I now can't live without:

- Click on linked image embeds the image instead of linking to a new page (or use prefs to do it automatically).
- If an image breaks the post table, it's resized to fit inside it*. (This goes for ALL images, including non-linked ones. Never again will an image break the post table).
- Clicking on image zooms in / out if it was resized.

Here's the script (http://webspace.utexas.edu/jag2682/misc/Tribalwar_image_embedder. user.js). Again, requires greasemonkey (https://addons.mozilla.org/en-US/firefox/addon/748) and firefox.

Demonstration: That ass (page 185) (http://www.tribalwar.com/forums/showthread.php?t=518521&page=185) - for an even better experience, Tools -> Greasemonkey -> User script commands... -> Embed images automatically.
Resizing example: [Game] Guess this picture! (http://www.tribalwar.com/forums/showthread.php?t=528561)

* Resizing works as long as there's at least one post in the thread that DOESN'T break the post tables.

frozen-rain
02-17-2008, 03:30 AM
anyone call you a nerd yet LOL sorry bro, its true

Azn_Essence
02-17-2008, 03:30 AM
bump for tommorow, when its not 430 am

-Bane
02-17-2008, 03:33 AM
anyone call you a nerd yet LOL sorry bro, its true

Nope you're the first.

frozen-rain
02-17-2008, 03:34 AM
aww mang :cheers:

WarBuddha
02-17-2008, 04:50 AM
say wha

GiftOfTheGame
02-17-2008, 05:01 AM
works well so far, danke

scandal
02-17-2008, 05:03 AM
that's a neat script. Will it work with website that do not generally allow hotlinking?

HariKari
02-17-2008, 05:40 AM
I've been using greased lightbox for linked pics
Greased Lightbox, enhance browsing on websites that link to images - Shifting Pixel, Pictures, Photos, and Photography (http://shiftingpixel.com/lightbox/)

resizing sounds nice though

-Bane
02-17-2008, 06:04 AM
that's a neat script. Will it work with website that do not generally allow hotlinking?

It should. The only "TW-specific" code is one which optimizes resizing against the post tables -- if it can't find the TW post tables, it falls back to the size of the window as the max image width.

works well so far, danke

Bitte schön

TseTse
02-17-2008, 06:28 AM
cliffs

Sircle
02-17-2008, 09:35 AM
cliffs

VGX
02-17-2008, 10:12 AM
http://i169.photobucket.com/albums/u231/cheezeguy/n725075089_288918_2774.jp g

Catti-brie
02-17-2008, 10:47 AM
Nice.

GreyGhost
02-17-2008, 11:00 AM
thanks, GM says :fu: to table breaking dicks now :bigthumb:

kloa
02-17-2008, 11:05 AM
hawt, thanks :boogie:

Tribalbob
02-17-2008, 11:05 AM
<3 i'm too lazy to install it, but I like what you've described and thank you for the work and effort you've put into something i'd use if i weren't so lazy.

Scurvy With Fries
02-17-2008, 11:07 AM
thats cool

GreyGhost
02-17-2008, 11:07 AM
the minute and a half it took was tiring, but I had an energy bar and forced myself to do it

Dark_Moon
02-17-2008, 11:07 AM
beautiful

thank you