Greasemonkey Scripts For vB: Now With A "I Can't Believe It's Not Fusetalk" Script

Page 5 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
You wanted to get rid of flicker, and I finally found a way to get rid of most of it. It turns out that while Greasemonkey scripts are loaded late, user styles are loaded much earlier. So I made a user style:

http://userstyles.org/styles/22529

to go with my Greasemonkey script:

http://userscripts.org/scripts/show/61852 (and still on my site too.)

I had to change the Greasemonkey script just slightly, but now they work together to provide the best, most flicker-free experience, while each still works very well on its own.
 

Shawn

Lifer
Apr 20, 2003
32,236
53
91
just found a bug. When I quick replied my author icon went under my name instead of above it. weird.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
Not exactly a bug. More of an "unimplemented feature". :D <-- car salesman smile. ;)

The quick reply system uses AJAX to load the new post. But Greasemonkey scripts don't fire unless the entire page is loaded. Also note that the blue outline doesn't extend around the new post (or posts - any posts done while you were typing get included when you do a quick reply), and the post(s) are spaced with the darker gray.

Some might consider this a feature, as it shows you which posts are new.

Edit: I did find a genuine bug - the repositioned authors icons were shifted slightly to the right. It's fixed now.
 
Last edited:

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
I notice people have been complaining about image sizes. Here's a user style that fixes it for me:
Code:
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix("http://forums.anandtech.com/showthread.php") {
/* Resize normal images. */
#posts td.alt1 div img { max-width:800px; }
/* Resize quoted images. */
#posts td.alt1 div div td.alt2 div img { max-width:80px; max-height:80px; }
}
This makes normal images no more than 800px wide, and images inside [ quote ]s the size of user icons. It only works on normal thread listings; e.g. if you click on a post number you'll see the full image.

If you take just the two lines beginning with "#posts" and put them in a file, I think it will work in Internet Explorer, as far back as IE6!

Edit: Except it looks like IE6 doesn't support max-width. :( This will make quoted images small, I think:
Code:
#posts td.alt1 div div td.alt2 div img { max-width:80px; width: expression(this.width > 80 ? 80: true); max-height:80px; height: expression(this.height > 80 ? 80: true); }
But I don't want to fiddle with regular images as I'm pretty sure this approach would resize them asymmetrically.
 
Last edited:

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
I've come up with another big user script: The Reiconizer.

By default it just gives everyone who doesn't have an avatar (user icon) one from Wikipedia. But it can do much, much more if you go into the source code. You can:

- Replace any user's avatar with a different one (or none!)
...- Give your friends back their old avatars. Can't find it online? Use a data URL! For instance, in the case of Adul, I gave her - him, I mean him - back his pink-haired icon. ;)
...- Give people more appropriate avatars. For instance, I searched Google for a red squirrel, of icon size, and gave that to RedSquirrel.
...- Only you can see these avatars, so you can use NSFW ones. Or animated ones. Or larger ones. The default size limit is 130x100px, but you can change that.
...- Try out a new avatar on yourself before inflicting it on the rest of us! :p (But note that after a quick-reply it won't appear until you refresh the page.)
- Replace any board avatar with a different one (or none!)
- Replace whole sets of board avatars with different ones. For instance, if you uncomment one section, and replace the Wikipedia avatars with these:
Code:
// AnandTech Forums icons:
autoIcons.push('http://forums.anandtech.com/images/avatars/at/canoworms.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/wildcat.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/vulture.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/trout.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/tiger.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/snail.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/raven.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/penguin.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/parrot.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/lioness.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/lion.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/gorilla.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/eagle.GIF');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/dragon.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/cheetah.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/cat.gif');
autoIcons.push('http://forums.anandtech.com/images/avatars/at/wolf.gif');
Then all the avatars will be one of those. This way you can get rid of all the new icons entirely!

Re-thinking the identification of avatars also led to a bugfix in the FTLook script. Apparently some people have (or had at one point) no designation as even "Member".
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Something seems amiss. I activated the code to disable all the non-FT avatars, and in the place of custom avatars for people like yourself, I'm getting linked text that reads " Ken g6's Avatar", which in turn goes to your member page. I think that's supposed to be the alt text for the image, so it's not properly being scrubbed out or something.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
Yes, that sounds like a problem. Probably the problem is in my instructions, as it's sort of trying to explain programming to non-programmers.

Try this version, let me know if it works, then tell me what you did differently.
 

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Yes, that sounds like a problem. Probably the problem is in my instructions, as it's sort of trying to explain programming to non-programmers.

Try this version, let me know if it works, then tell me what you did differently.
I got rid of the Push statements so that only people who actually selected FT avatars have them show up. Everyone else shows up blank.

var defaultIcon = ''; fixed the issue.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
So that's why there are four types of tags listed there. I added the lists to what I'd done before, in both the user script and the user style, but not the other two tags. I'd like to minimize the changes I make, even if I have to do two more bugfixes, because I think the other two tags are more likely to break stuff than to fix it.

Thanks!
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
For user styles in Firefox, install the Stylish add-on, then copy/paste. Google for what to do in other browsers.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
I finally have a (partial) solution to a problem that's been posted in this forum for awhile. Some will love it, some will hate it; but I hope nobody hates it too much. :hmm:

vBulletin Nested Quote for Greasemonkey. :D

This script lets you nest quoted posts in your post. Technically it doesn't actually copy the entire post you're replying to; rather it adds a button to automate a nesting process that would otherwise be done manually. Click the "Nest Quote" button (next to the Title textbox) and the script:

  1. Finds the deepest nested quote inside the first quote in your post.
  2. Goes out and finds the first nested quote inside that.
  3. Quotes that post and adds it to your post.
Click it again and it will nest another quote, if it can. This also means that:
  • It only works with the first quote, in any post; it doesn't work well with multiquote.
  • It copies the original post, not whatever was in the quote. So any changes, such as removing part of the post or "fixing" the post, won't be present. (But you can modify the quote after it's nested.) It also doesn't copy quotes that don't reference another post.
  • It pastes the original post at the top of the quote it's nested inside of, regardless of where it was in the original post.
  • On the other hand, it copies the first quote from the deepest nested original post. This means you can nest more quotes than the person you're quoting did, if you need to.
I hope you like the Nest Quote button. Please use it responsibly! ^_^
 
Last edited:
Nov 5, 2001
18,366
3
0
I'm running the left side contact list and the Stylish FT Skin. The page loads very clunkily over about 1.5 seconds....very annoying. Is this just me or does everyone have this issue?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
Here's another quickie. I got tired of some people's really big sigs. So I made a user style to shrink them down to size:
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix("http://forums.anandtech.com/showthread.php") {
#posts table.tborder tr[valign] > td.alt1 > div + div { max-height: 93px; overflow: hidden; }
}
There is pretty much no chance this will work in IE. ;)

P.S. That reminds me, I tried installing the FTLook script in FF3 on my laptop last night, and it didn't work as well as it does on FF3.5. I should probably try to fix it, but is anyone else using FF3 or earlier?
 

coldmeat

Diamond Member
Jul 10, 2007
9,234
142
106
Userstyle works great, thanks. Had to change the font size from 11 to 12, but was real easy even for someone like me.
 

Razgriz

Golden Member
Jan 29, 2006
1,094
0
0
I like the scripts but I just can't get over the 'lag' in rendering the scripts after the page is loaded.

as do I, the most noticeable example of this is the dark theme, is there anyway to get rid of the lag between page load and script load?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,696
4,658
75
I like the scripts but I just can't get over the 'lag' in rendering the scripts after the page is loaded.
as do I, the most noticeable example of this is the dark theme, is there anyway to get rid of the lag between page load and script load?
I've never seen a lag in the user styles, with the Stylish add-on. Are you using Greasemonkey instead?
 

Kelemvor

Lifer
May 23, 2002
16,928
8
81
For anyone using the Image Resizer script forom userscripts.org, you may have noticed all the image labels got changed to "Click for original size". The fix is to change the line that says:
aImg[j].title = 'Click for the original size';

to

if(aImg[j].title == '') aImg[j].title = 'Click for the original size';

Got this from the comments here: http://userscripts.org/topics/40286