TW Greasemonkey Scripts

-Bane

Veteran XV
Tribalwar Image Embedder v1.1c - 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).

Testing on website which prevents hotlinking: A picture

Testing on an image generated by a server side script: PHP image

Testing on an image which returns a bad image to prevent hotlinking: Tripod image

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

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")


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


ok, so my previous attempt 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. Again, requires greasemonkey and firefox.

Demonstration: That ass (page 185) - for an even better experience, Tools -> Greasemonkey -> User script commands... -> Embed images automatically.
Resizing example: [Game] Guess this picture!

* Resizing works as long as there's at least one post in the thread that DOESN'T break the post tables.
 
Last edited:
n725075089_288918_2774.jpg
 
<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.
 
Back
Top