• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

NeoGAF User Highlighter - A Google Chrome extension

Status
Not open for further replies.
malsumis said:
could you please add
Code:
if (window.opera) unsafeWindow=window;

somewhere at the beginning of your script to make it Opera-compatible? Really, this is ALL it takes.

I don't use Opera so i'll have to take your word for it. Done.
 

Yeef

Member
Nice update, it runs a lot faster now. Probably not too noticeable for most people, but I'd edited it to highlight multiple users so the script takes a little longer to execute for me. There are a few things I needed to change though:

  • The old style would highlight both posts in threads and viewing single posts. It was an easy fix. I just changed
    Code:
    if(path.search("showthread") > 0)
    to
    Code:
    if( (path.search("showpost") > 0) || (path.search("showthread") > 0) )
  • I did this with the original script as well, but had to do it again. Since you're using "contains" it just checks for the string anywhere in the name. So, for example, if I have "Jam" set to highlight it'd highlight anything with "Jam" in it such as "Zombie James". Adding the custom econtains selector at the beginning of the ExecJQuery function then swapping all of the ":contains" selectors for ":econtains" fixes that.
    Code:
    $.expr[":"].econtains = function(obj, index, meta, stack){
    	return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase();
 
Yeef said:
Nice update, it runs a lot faster now. Probably not too noticeable for most people, but I'd edited it to highlight multiple users so the script takes a little longer to execute for me. There are a few things I needed to change though:

Done and done. Thanks for the suggestions!
 

Yeef

Member
Zombie James said:
Done and done. Thanks for the suggestions!
Oops. just ran into a small bug. Using econtains for quotes doesn't work since the div contains more than just the username. Just change that back to a plain contains and it's good to go.
 
Yeef said:
Oops. just ran into a small bug. Using econtains for quotes doesn't work since the div contains more than just the username. Just change that back to a plain contains and it's good to go.

Hm? I'm not seeing anything weird happen with quote highlights.
 

Yeef

Member
Zombie James said:
Hm? I'm not seeing anything weird happen with quote highlights.
Weird. Just to make sure it wasn't a conflict or an issue with my own edits I reinstalled the default script and disabled all other scripts, but it's still not highlighting quotes right. This is what I'm getting.

Default
YChUk.png



Reset to "contains" for quotes
YXj2R.png


Running Firefox 3 with Greasemonkey. If it's working for you there's a chance it could be a conflict with another extension, though that seems unlikely.
 
Yeah, i've been using your econtains and I haven't run into that problem. The only other script i'm running is Youtube Me Again. I'm on Firefox 4.
 

malsumis

Member
Zombie James said:
I don't use Opera so i'll have to take your word for it. Done.

thanks, although this needs to be set in this line to work:
Code:
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
[B]if (window.opera) unsafeWindow=window;[/B]

If you could please update it once again.
 
malsumis said:
thanks, although this needs to be set in this line to work:
Code:
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
[B]if (window.opera) unsafeWindow=window;[/B]

If you could please update it once again.

D'oh! Fixed.
 

Meier

Member
Dunno how I missed this before but I just installed Greasemonkey just to add it. This functionality is truly an amazing addition that makes ckohler's mobile app all the better than the basic GAF forum.

One thing I'm noting those is my browser seems a tad slower with it installed.. does anyone else notice that?
 

neclas

Member
CoffeeJanitor said:
Has this randomly stopped working for anyone? I've got it going for FF and it just stopped working for the last day or two
It's still working for me (and I just upgraded to FF 4 yesterday). Try reinstalling the script?
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Just published my first real extension and open source project: NeoGAF Smilies.

3001


Basically does what it says. I found it annoying that there would be times I would need it...

But as it says in the description:

Please be aware that the smilies were taken out for a reason, so please use discretion when using these smilies.

Can't be repeated enough. Like a well-timed fart, treat these with care.
 

Gaaraz

Member
Can't get it working in Firefox unfortunately, shame as it's a very good feature (love it on the mobile site)

var username = "blizeH"; // <-- Your GAF username goes between the quotes.
var color = "#d6e9cc"; // <-- This is the highlight color.
? :eek:
 

Gaaraz

Member
Lol, fail - the above post is green! Thank you :)

I just stupidly thought it'd maybe highlight actual topics from the topic listings page too, oops!
 

Dina

Member
Working smooth, thanks!

edit: that said, posts are working, but I can't get threads to work. Or is it only for topicstarters?
 

neclas

Member
Dina said:
can't get threads to work. Or is it only for topicstarters?
Yeah, it's only for threads you started or have the most recent post in. Basically, if your name is somewhere on the topics listing page, it will highlight that thread.
 

iceatcs

Junior Member
lame bump

I'm just testing to see if the Firefox script highlighter is working or not.

[edit] Whooa! Working at first time, feel like break my virgin.
 
Alright guys, time and motivation have really been a problem for me when it comes to updating, and some of you have some really good ideas, so i've decided to give the Greasemonkey script a friendly open-source license so anyone who's interested can modify and redistribute it as they see fit. I've decided on the zlib license, so the restrictions aren't really restrictive at all. Enjoy!
 

Yeef

Member
Plywood said:
Not working, I'm using Opera if that makes any difference.
I'm using Firefox. Don't know if the implementation for Opera is different (chrome and Firefox do differ).
 

Plywood

NeoGAF's smiling token!
Yeef said:
I'm using Firefox. Don't know if the implementation for Opera is different (chrome and Firefox do differ).
I'm using the latest script.

And yours differs:

Zombie's:
Code:
var username   = ""; // <-- Your GAF username goes between the quotes.
var color      = "#d6e9cc"; // <-- This is the highlight color.

Yours:
Code:
username.push("Yeef"); // <-- Your GAF username goes between the quotes.
color.push('#88C4F7'); // <-- This is the highlight color.

Most Firefox scripts are compatible with Opera though.
 

Yeef

Member
Mine is a modified version of the latest script in this thread. All that does is change the username and color variables into arrays. Then it matches the pairs and colors them respectively.

8xXzd.png


[EDIT] Are you trying it with or without re:GAF enabled? I don't know whether or not it works with that skin (I stopped using it when GAF was redesigned).
 

Shadow780

Member
Anyway to make it highlights topics that you've posted (not created) in the thread listings so you know which topics you've participated?

I'm using chrome.
 
Shadow780 said:
Anyway to make it highlights topics that you've posted (not created) in the thread listings so you know which topics you've participated?

I'm using chrome.

In terms of using the data GAF exposes in it's HTML, no, there's no way to do it. I've thought about whipping up something using Local Storage but that has (or had, it's been a while) issues with Chrome, and it wouldn't be retroactive.

It's just easier to automatically subscribe to threads you post in (User CP -> Edit Options -> Default Thread Subscription Mode).
 

Shadow780

Member
Zombie James said:
In terms of using the data GAF exposes in it's HTML, no, there's no way to do it. I've thought about whipping up something using Local Storage but that has (or had, it's been a while) issues with Chrome, and it wouldn't be retroactive.

It's just easier to automatically subscribe to threads you post in (User CP -> Edit Options -> Default Thread Subscription Mode).

I see, thanks!
 
This is more general Greasemonkey troubleshooting that anything else but I just installed this script and I don't see where I can put in my username. I suspect it's under "Edit User Script" but I press that button and nothing happens. Any ideas?

Running Firefox 6.0.2 on a Mac.
 

AndyD

aka andydumi
Install NeoGAF User Highlighter - Version: 1.1 from userscripts. Dont know about Firefox, but in Chrome there is an option button with a nice menu to change color and name.

Nevermind, the one I mentioned is on the Chrome extension store.
 

Magnus

Member
Neuromancer said:
This is more general Greasemonkey troubleshooting that anything else but I just installed this script and I don't see where I can put in my username. I suspect it's under "Edit User Script" but I press that button and nothing happens. Any ideas?

Running Firefox 6.0.2 on a Mac.

Same exact problem, on FF7. :(
 

Fuzzy

I would bang a hot farmer!
What do I need to edit in the script for it to only highlight my posts and not include posts from other people with Fuzzy in their name? It's getting a bit annoying having other people's posts being highlighted also.
 

Yeef

Member
I was having a similar problem and getting really annoyed with it so I decided to look into it.

Assuming you're using the grease monkey script you can add in the bolded to the source code where shown. The just do a find and replace for all instances of ":contains" and replace it with ":econtains". Should fix everything.

// Execute
////////////////////////////////////////////////
function execJQuery()
{
$.expr[":"].econtains = function(obj, index, meta, stack){
return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase();​
}



// just because
$('.vbmenu_control').css('font-family', 'Arial');
This is for Firefox. I'm not certain that it'd work for the chrome version, but I can't think of any good reason that it wouldn't.
 

jax (old)

Banned
tying to implement this now. test

* doesn't work. :'(

firefox.

var username = "jax"; // <-- Your GAF username goes between the quotes.
var color = "#d6e9cc"; // <-- This is the highlight color.



is there more I should do?
 
Status
Not open for further replies.
Top Bottom