rhfb said:You could easily block all avatars that end with .gif, but the thing is I'm assuming you want to block all ANIMATED gifs and not all gifs. gifs can be static too, and I don't think there is an easy way to detect if a gif is static or animated.
salva said:I'd do this for every anime avatar.
Your wish is my command!tokkun said:Loss of static gifs would be acceptable collateral damage.
function execJQuery() {
$("img[src$='.gif']").css('display', 'none');
}
Nooooooooooooooooo! Never!Plywood said:It's so easy to skip someone's post when they don't have an avatar.
rhfb get an avatar!
function execJQuery() {
$(".smallfont").find("img[src$='.gif']").each(function (i) {
$("img[src='" + this.src + "']").css('display', 'none');
});
}
// ==UserScript==
// @name NeoGAF - Block Individual User Avatars
// @namespace http://hateradio.co.cc/
// @include http://www.neogaf.com/forum/showthread.php*
// @author hateradio
// @version 1.0
// ==/UserScript==
var im = document.getElementById('posts').getElementsByTagName('img');
// Add users to the following list. Separate names by the pipe "|" character.
// This is case sensitive for precision.
var users = /User1|User2|User3/;
for(i = 0; i < im.length; i++){
if(im[i].getAttribute('alt') && users.test(im[i].getAttribute('alt'))){
im[i].setAttribute('style','display:none');
}
}
Which browser do you use? If you user Firefox you'll need the Greasemonkey add-on. Once it's installed you can go to the userscripts.org links and install them. To edit the JS you'll need something like Notepad, and add the names you don't want.AlteredBeast said:where the hell do I put this script in? I am not a coding expert and have no clue how to do this. This will make browsing at work doable and at home less embarrassing. Some of the avatars on here are obscene and lewd.
The Lamonster said:I just block all images at this site in Google Chrome.
Diablos said:What is so terrible about avatars?
Stupid question - but how do you do this in Firefox? I'm always getting weird glances at avatars on my screen at work. If it was just type, I wouldn't be scared to have GAF on my screen so much._dementia said:Same but on Firefox. Great for work browsing.
Does Opera even allow the include of jQuery? That may be the problem. I'm sure it can be done w/o jQuery and straightforward JavaScript.Plywood said:Any of you amazing code people care to see if you can make the NeoGAF User Highlighter script Opera compatible?
http://userscripts.org/scripts/show/77218
I'd be forever grateful.
hateradio said:Does Opera even allow the include of jQuery? That may be the problem. I'm sure it can be done w/o jQuery and straightforward JavaScript.
No, I meant for UserScripts.Plywood said:Opera does have jQuery support afaik, they even had an article on it back in 07': http://dev.opera.com/articles/view/jquery-write-less-do-more/
and a more recent one:
http://dev.opera.com/articles/view/custom-html5-video-player-with-css3-and-jquery/
First of all, nice script.hateradio said:Why the hell are you kids using jQuery? Learn some damn (basic) JS.
xbhaskarx said:This is close to what I want, but not quite. I'm looking for a script to block the movie Avatar from existing...
Oh, then I don't know.hateradio said:No, I meant for UserScripts.
down vote
Just for completeness:
I use it regularly with my userJS. Just copy your jquery.js into your userJS folder.
OptION 1 to keep it from conflicting with available jquery, use the noConflict option within the jqueryfile and associate jQuery with with your own identifier (jQueryMyIdentifier = jQuery; jQuery = null . your JS code can be wrapped with
(function($) {
// normal jquery js based on, jQueryMyIdentifier $('#bla').x();
})(jQueryMyIdentifier);
OPTION 2 check out, how to include a remote js using javascript. implement that include line into your JS. include "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" or alike.
I know, but you're still using a framework to do something that can be done in a few lines of code; you don't need to call a 70KB script which will only be used to hide avatars. :lolwmat said:First of all, nice script.
I'm not a kid, and I know more than just basic JS. Fought with Ajax in numerous frameworks, for instance; cooked up asynchronous persistent dynamic forms and all that shit.
People tend to use jQuery when they really just invest like 2 minutes to sift through Firebug to get to some point, then traverse up the tree. It gets immediate results. Your solution is much cleaner though, so kudos.
Install GreasemonkeyPlywood said:Then again I don't even know where to put that code the person posted.
Well, as you know, the point where you have to start with these things is some unique property somewhere around the element to block so that you either identify said element or some element in its branch. I had trouble finding a unique property immediately that was guaranteed to be in the avatar branch, so I just went the dumbfuck route. You're still right, of course.hateradio said:I know, but you're still using a framework to do something that can be done in a few lines of code; you don't need to call a 70KB script which will only be used to hide avatars. :lol
wmat said:The thing is that Wraith RazieL has an avatar with bulging eyes, and I just can't stand that. I have a thing with eyes, I have to look away at "that" scene in Clockwork Orange, for instance. I have nothing against the dude though.
Even if it does not( as I've never written a single UserJS ) you could always write to document a script tag and include jquery that way.hateradio said:Does Opera even allow the include of jQuery? That may be the problem. I'm sure it can be done w/o jQuery and straightforward JavaScript.
Plywood said:Opera does have jQuery support afaik, they even had an article on it back in 07': http://dev.opera.com/articles/view/jquery-write-less-do-more/
and a more recent one:
http://dev.opera.com/articles/view/custom-html5-video-player-with-css3-and-jquery/
Well... I'm using Opera and I was inquiring about the User Highlighter, I feel bad now cause I jacked your thread with my issue.wmat said: Install Greasemonkey
Right-click the ape face that appears, choose "New Userscript "
Enter appropriate unique data for identifying the script; the sites to apply it to are http://www.neogaf.com/forum/*
http://neogaf.com/forum*
(with the linebreak)
A notepad window appears, paste code, modify to block specific avatars, save
Done; reload site for testing
How do I what now?malsumis said:Even if it does not( as I've never written a single UserJS ) you could always write to document a script tag and include jquery that way.
Plywood said:How do I what now?
I believe that's what the Highlighter script is actually doing.malsumis said:Even if it does not( as I've never written a single UserJS ) you could always write to document a script tag and include jquery that way.
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
// ==UserScript==
// @name NeoGAF Avatar Blocker
// @namespace wmat
// @description Block disgusting avatars on GAF
// @include http://www.neogaf.com/forum/*
// @include http://neogaf.com/forum*
// ==/UserScript==
if (window.opera) {
unsafeWindow=window;
}
var usernames = new Array("Wraith", "RazieL", "wmat"); // <-- The blocked guys' names
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
function GM_wait()
{
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; if(usernames.length > 0) execJQuery(); }
}
GM_wait();
function execJQuery()
{
for (var i=0; i < usernames.length; i++){
$("a[class='bigusername']:contains('" + usernames[i] + "')").css('color', 'black').parent().parent().children().children().children("img").css('display', 'none');
}
}
// ==UserScript==
// @name NeoGAF User Highlighter
// @namespace com.zombie.net
// @description Highlight user posts, quotes, and threads.
// @include http://www.neogaf.com/forum/*
// @include http://neogaf.com/forum*
//
// ==/UserScript==
// These two variables must be set!
//////////////////////////////////
var username = "malsumis"; // <-- Your GAF username goes between the quotes.
var color = '#d6e9cc'; // <-- This is the highlight color.
// Options
//////////////////////////////////
var highlight_avatar_area = true;
var highlight_post_area = true;
var highlight_threads = true;
var highlight_quotes = true;
//////////////////////////////////
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// Add jQuery
///////////////////////////////////////////////
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
if (window.opera) {
unsafeWindow = window;
}
// Check if jQuery's loaded
function GM_wait()
{
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; if(username.length > 0) execJQuery(); }
}
GM_wait();
// Execute
////////////////////////////////////////////////
function execJQuery()
{
// just because
$('.vbmenu_control').css('font-family', 'Arial');
if(highlight_avatar_area && highlight_post_area)
$("a[class='bigusername']:contains('" + username + "')").css('color', 'black').parent().parent().parent().children().css('background-color', '' + color + '');
else
{
if(highlight_avatar_area)
$("a[class='bigusername']:contains('" + username + "')").css('color', 'black').parent().parent().css('background-color', '' + color + '');
if(highlight_post_area)
$("a[class='bigusername']:contains('" + username + "')").css('color', 'black').parent().parent().siblings().css('background-color', '' + color + '');
}
if(highlight_quotes)
{
$('div[id^="post_message"] > div > div').find(":contains(" + username + ")").each(function(){
$(this).parent().parent().find('td.quotearea').css('background-color', '' + color + '');
});
}
if(highlight_threads)
{
$('table[id="threadslist"] > tbody > tr > td.alt2 a:contains("' + username + '")').each(function() {
$(this).parent().css('background-color', '' + color + '').siblings().css('background-color', '' + color + '');
});
// subscription list
$('form > table > tbody > tr > td.alt2 a:contains("' + username + '")').each(function() {
$(this).parent().css('background-color', '' + color + '').siblings().css('background-color', '' + color + '');
});
}
// $('tbody tr > td[id="td_title_3xxxxx"]').parent().hide();
}
hateradio said:Why the hell are you kids using jQuery? Learn some damn (basic) JS.
people just hate animethetrin said:I honestly don't get the hate for anime avatars.
rhfb said:That blocks just the .gif avatars. Check back in a few more mins for an update that would block quoted avatars (again, as long as the quoted user has posted on that page)
edit: Updated, tested and it works on this page. Don't blame me if it doesn't work for you or breaks something else Like I said earlier I'm still learning this stuff.
yencid said:Unless i know a user (Mostly from Creepy Gaf, HispaniGaf and a few other places) the way i recognize users is by their avatars a lot of times (and their tag) Why would i block them? >.<
I dont pay enough attention for them to bother me. I do enjoy seeing a good avatar though, always nice.The_Technomancer said:Do people honestly pay enough attention to avatars that it bothers them? I barely even see them, they're just useful for about thirty or so people on GAF whos posting trends I tend to overlap with; I see the avatar out of the corner of my eye and associate it with AceBandage or Drkirby, or whoever.
...malsumis said:*snip*
yencid said:Unless i know a user (Mostly from Creepy Gaf, HispaniGaf and a few other places) the way i recognize users is by their avatars a lot of times (and their tag) Why would i block them? >.<
Plywood said:...
I love you.
Seriously though, much appreciated.
edit: Is there a way to add multiple users?
var usernames = new Array("Wraith", "RazieL", "wmat"); // <-- The blocked guys' names