What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 150 Stack Exchange communities.

Install it on userscripts here


The posts of the person who asked the question are highlighted in blue, so why can't our own posts be highlighted? It makes finding my stuff much easier. Highlights anything that links to your user-profile (comments, answers, etc.)

any and all feedback or suggestions welcome!

source:

// ==UserScript==
// @name           Highlight your username on SOFU
// @namespace      CrazyJugglerDrummer
// @description    highlights wherever your username appears on the page
// @include        http://stackoverflow.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// ==/UserScript==

var userLink = document.getElementById("hlinks-user").getElementsByTagName("a")[1].href;

var links = document.getElementsByTagName("a");

for (var x=0; x<links.length; x++) {
    if ( links[x].href == userLink ) {
        links[x].style.color = "#f00"; 
        links[x].style.backgroundColor="#fcc";
    }
}
share|improve this question

closed as off-topic by ᔕᖺᘎᕊ, Braiam, Shokhet, Fish Below the Ice, Gordon Gustafson Aug 5 at 20:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about the software that powers the Stack Exchange network, within the scope defined in the help center." – ᔕᖺᘎᕊ, Braiam, Shokhet, Fish Below the Ice
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Nice. My Question Dashboard meta.stackexchange.com/questions/31486/… script may be a nice compliment to yours - one feature, among others, is the indicator "Me" which appears if an Answer, Question or Comment of yours exists on the current page. –  micahwittman Jan 8 '10 at 7:15
6  
can this please be moved to stackapps.com/?tab=scripts as necessary? Or flag for deletion. –  Jeff Atwood Jul 31 '11 at 22:53
    
Just one change; var userLink = document.getElementById("hlinks-user").getElementsByTagName("a")[1].href; highlights reputation. Changing the 1 to a 0, though, highlights the username. Cheers! –  ChrisForrence Oct 4 '13 at 20:15
    
This is now implemented by default but +1 for the actual idea! Unfortunately though this is now off-topic; it would belong on StackApps, but it being natively supported means it wouldn't be too useful anymore! :) I've voted to close as off-topic. –  ᔕᖺᘎᕊ Aug 5 at 17:51

2 Answers 2

up vote 2 down vote accepted

I love this idea.

I submitted it as a feature-request a few months ago: Highlight our own comments, too.

Vote it up. I would love to see it implemented natively.

share|improve this answer

+1 for the script and for the request to implement this natively :)

It apparently doesn't work anymore (hlinks-user doesn't exist anymore).

I have modified the script as follows (it highlights the whole post/comment, only tested in Chrome)

// ==UserScript==
// @name           Highlight your username on SOFU
// @namespace      CrazyJugglerDrummer
// @description    highlights wherever your username appears on the page
// @include        http://stackoverflow.com/*
// @include        http://superuser.com/*
// @include        http://serverfault.com/*
// @include        http://meta.stackoverflow.com/*
// @require        https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==

// The main content of this userscript
function main() {
    var HighlightUserPosts = function(){
        jQ("a[href='"+userLink+"']").each(function(){
          jQ(jQ(this).parents('tr.comment, div.question > table > tbody > tr, div.answer > table > tbody > tr')[0]).css('background-color','#efe');
        });
    }

    var userLink = jQ('a.profile-me').attr('href');
    HighlightUserPosts();
    setTimeout(HighlightUserPosts, 2500); // Fire again after SOFU's highlight fades away
}

// Load jQuery and execute the main function
window.jQ = jQuery.noConflict(true);
main();
share|improve this answer

Not the answer you're looking for? Browse other questions tagged .