Handy Greasemonkey scripts for forum use

正在查看此主题的用户

Jace

Captain Codeine
Duke
What's Greasemonkey?
Greasemonkey: "Customize the way a web page displays or behaves, by using small bits of JavaScript."
It's an extension for Firefox, some other browsers also have (limited) support for the scripts.

Why this thread?
I thought it'd be good to have a place for the forumites to share GS scripts they've written or found elsewhere which'd improve a forum experience in a way or another. Also so I'd have a place to post the ones I've coded up. :razz:

If you know/have ones you think would be of use for others, please post them here! I'll try to keep up a list of 'em in OP here.
Note: This is not a general thread for all your favourite scripts for google/youtube/gmail etc. Only scripts which would benefit forum use.



NameDescriptionDownload/installSource/link
Image Width FixerA script which will shrink images too large to fit inside posts to match page width. Clicking on the image will restore it to its full size, clicking again will shrink it back to fit the page.v. 2015.10.24Post
Open All SpoilersAdds a button to the top right corner of any post which has one or more [spoiler] tags in it. Clicking this will open/close all of the spoilers in the post.v. 2015.10.24Post
Youtube Link Title FixerChanges youtube links to show the video titles in the posts.v. 2015.10.24Post
Hide/move Ducks and SpacklesHides the Duck and Spackle Tavern childboard from Anachronist's Guild. Alternatively moves it to the bottom of the child board list.v. 2015.10.24Post
Youtube Video EmbedderLooks through all youtube links in all posts and embeds them inside spoilers.v. 2015.10.24Post
TWim button when postingAdds a button to the reply page that will take you directly to TWim.v. 2015.10.24Post
Replied Topic HighlighterHighlights all the topics you've replied to on board pages. Configurable colour!v. 2015.10.24Post
Vocaroo EmbedderAdds an embed box after links to Vocaroo recordings.v. 2015.10.24Post
Confirm Mark ReadGets rid of the confirmation dialog for "Mark Read" button.v. 2016.02.16Post
 
Image Width Fixer v. 2015.10.24
A script which will shrink images too large to fit inside posts to match page width. Clicking on the image will restore it to its full size, clicking again will shrink it back to fit the page.
You'll also find an option for disabling the bbc-resize method ([img width=1024 height=768]) on the Look & Layout config page.

Download/install
Source



Open All Spoilers v. 2015.10.24
Adds a button to the top right corner of any post which has one or more [spoiler] tags in it. Clicking this will open/close all of the spoilers in the post. The button (
GTb-s.png
) will adapt its look to your currently selected theme.
  • Update 2015.07.20: Now works on print mode pages.
  • Update 2015.07.20.b: Added a button to open/close all spoilers on the page in either mode.

Download/install
Source



These two are still rather hastily made, probably could be improved by someone who actually knows what they're doing. Especially the image resizer has a fairly dirty hack in it, though I haven't noticed it causing any kind of problems so far. The image resizer also adds a bit of CSS to allow images show fully when inside quotes, unsure if this'll break anything. If you have any recommendations/requests for anything they lack, please drop a line!
 
I did have a looksee about that before creating the thread and found this page regarding the subject. Tried to do what it told in my PortableOpera, couldn't see any kind of hints that they were working. But please let everyone 'ere know if you find out a way to make 'em work!
 
Uhhhh. Image Width Fixer updated. Fixed a very embarrassing "tipo" which caused the script to only handle the first image in each post. I've no idea when and how it got there, I'm pretty sure it was working all good on my final tests before release. :???:

Edit: URL fixed, too bloody used to adding /misc/ to every link >_<
The one in OP/first reply still workt though. :razz:
 
This is pretty nice. I apologize ahead of time if this is not the proper place to post:  Requesting a script where you can 'Ignore' posts from a whole board.
 
TARDIS 说:
This is pretty nice. I apologize ahead of time if this is not the proper place to post:  Requesting a script where you can 'Ignore' posts from a whole board.
Am unsure of what you exactly want. To make the board not appear at all? Or if you enter the board you won't see any of the posts?
Where do you want them not to show?



Youtube Link Title Fixer v. 2015.10.24
Got tired of seeing random links to youtube and having to click and see that it's something I'm not even remotely interested in seeing. Looked around for already existing ones (there are tons), but they all seemed to come up with way too much clutter. So decided to make a custom one just for TWf use.

Examples of what it makes happen:

- If there's a plain link to youtube with no link text at all, it replaces the text completely:
http://www.youtube.com/watch?v=d5BdyIGtYcg  ==> Orphic Oxtra - Skeletons Having Sex on a Tin Roof[x]
(Added the [x] there to show that it's been fixed. Not really necessary but put it in to see who can't figure out how to add link text to their youtube links :razz:) <-- Optional!

- If there IS a link text but it doesn't match the video title, it shows the actual title in a popup when you hover the link:
Lol video ==> [abbr=Orphic Oxtra - Skeletons Having Sex on a Tin Roof]Lol video[/abbr]

- If the link text matches the video title, no changes are made!

- If the video has been deleted or is unavailable (copyright issues etc), it'll add a little [x] with a hover-message indicating that you can't watch the video. <-- Optional!

It should match all possible ways to link to videos, but let me know if it doesn't and I'll look into it.

Download/install
Source
 
Updated the Image Width Fixer script. Now if the resized image is a link (clicking it would open the link instead of just sizing it to its original size) it removes the link and puts it in a text link above/next to the image, letting you use click to zoom in and out on the image.

J 说:
Image Width Fixer v. 2012.10.13
Download/install
Source

I did add thingies which should make it auto-update in the last release, but unsure if it'll work 'cause it's not on https (which would cost too much to include on my server). But at least you can grab it manually 'ere.
 
Would it be possible for you to disable resizing on images where the size has been defined? Generally this is for a good reason and it ends up playing havoc with threads like this: http://forums.taleworlds.com/index.php/topic,229980.0.html
 
Nice one.

EDIT: Actually hang on... don't know if it's working at all now. Could my multimonitor setup be messing with it?

EDIT2: OK it's working sometimes but it's somewhat sporadic. Haven't worked out what's making it work/fail yet but will post back if/when I do.
 
Hide Duck and Spackle Tavern v. 2015.10.24
Hides the Duck and Spackle Tavern from the child boards list on Anachronist's Guild. Also offers an option to move it to the bottom of the list instead of removing it. Works with all current themes.

Download/install
Source



Also, fixed the image resizer!
J 说:
Image Width Fixer v. 2015.10.24
Download/install
Source
Updates:
* It actually works now on all page loads (...right? It has failed to fire once or twice for me. But much less regularly.)
* This time it actually IS working!
* Added an option to disable bbcode-resize completely (can break stuff on tables which use resized images for decoration etc. Example.)

Update: The problem with the width script was that it failed to trigger on images which had finished loading once the resize checking on it would never happened. Added a check for it now. (No idea why I hadn't thought of it earlier.)



New script!

TW Youtube Video Embedder v. 2015.10.24
Looks through all youtube links in all posts and embeds them inside spoilers.

Download/install
Source

Do let me know if it fails to work somewhere!
 
gosh, that new one sounds terribly handy! might just have to cave in and install that greasy monkey after all. usually I just ignore any and all random youtube links....
 
Updates already!

J 说:
TW Youtube Video Embedder v. 2012.12.20.2
Download/install
Source
* Added the original link inside the spoiler, just in case it has some extra messages, includes playlist etc etc.

Also forgot to mention: It doesn't even load flash until you open the spoiler! So shouldn't slow page loading time/resource usage unless you decide to watch it.



J 说:
Youtube Link Title Fixer v. 2012.12.20
Download/install
Source
* Added an option to enable/disable the [x] markings (which show if a video is deleted or if the title has been updated on the post) 'cause they'll be completely unnecessary if you also use the embedding script. See Look & Layout options for the option. Also some people might just not care for 'em. :razz:
 
Occasionally it stops working, but I think its more due to lag than anything wrong with the script.
 
Do you have a page where it stops working (almost) every time? How does it exactly stop working? The links aren't converted to spoilers at all? They are but the spoilerbuttons don't work? The spoilerbuttons work but there's no video inside the spoiler? The video is there but is unable to play?
Also, what browser (version) do you use? Greasemonkey version? Other relevant information?

AWdeV: Would you go as far as to say... radical? :razz:
 
后退
顶部 底部