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

There were previous questions on this already, and according to those it’s also implemented by now. And when looking at the source, I can indeed see an ID being set for every comment on election pages.

However, unlike comments on questions, there is no actual link for the permalink for comments on election pages:

No link for the permalink

Could those be added please so we can actually link to comments easily?

share|improve this question
    
FWIW, I could do this earlier tonight... but not now. –  Lightness Races in Orbit Feb 11 at 0:03
    
@LightnessRacesinOrbit Interesting. I’m pretty sure I was unable to do so on the election page since it started tonight. Maybe you’re confusing it with a different place on the site? –  poke Feb 11 at 0:05
    
Nope, I am not. It definitely worked. My one-boxing sparked chatter in chat. But I did have an unfortunate incident with SO CSS (possibly) which may have contributed to my temporary powers. –  Lightness Races in Orbit Feb 11 at 0:11
    
Actually.. you know what? Looking back at the transcript, I may have been thinking of an answer on which comments ensued with one of this year's nominees. Either way, I support this proposal wholeheartedly. –  Lightness Races in Orbit Feb 11 at 0:13
    
Right, regardless of how it was before; it’s broken now ;) –  poke Feb 11 at 0:16

2 Answers 2

During the Arqade elections, I wrote a UserScript for this purpose.

It should match for Stack Overflow and Ask Ubuntu (the two current elections), so... should work. Install, go to page, link appears.

Image for demonstration:

These links do not onebox in chat, however, as they're not considered proper comment links like on other posts.

share|improve this answer
    
SE should give some love to them, tho –  Braiam Feb 11 at 0:54
    
Note that this won’t create actual permalinks, as they are relative to the current site (i.e. /elections, not elections/<id>). You could get the base URL for the current election from something like document.querySelector('.youarehere').href.split('?')[0] though. — That being said, I would prefer having this implemented properly of course, including integration into chat :) –  poke Feb 11 at 1:37
    
@Braiam SE doesn't want to give them love. This is a feature bug. –  ɥʇǝS Feb 11 at 1:37
    
@poke It should create the proper permalink if you're on the actual page by ID. I just cba to fetch the ID on the "front page" (if you will) as well. –  FEichinger Feb 11 at 1:38

I know it's a bit late for the current elections, but Stack Overflow Unofficial Patch 1.8 now includes a workaround for this bug, loosely based on FEichinger's script.

The core of the workaround is the following jQuery code:

var base = ( $('#tabs .youarehere').attr('href') || "" ).replace( /#.*/, "" );

$('.comment-date').not(':has(a)').wrapInner( function () {
    var id = $(this).closest('.comment').attr('id');
    return $('<a class="comment-link"></a>').attr('href', base + '#' + id);
} );

The base variable ensures that the links will lead to the correct tab (i.e. nominations), even if you haven't explicitly selected a tab. The full workaround included in SOUP also reapplies this fix whenever new comments are dynamically loaded, and also fixes the permalinks below each nomination post to always point at the correct tab.

Note that, due to missing JS support on the nomination pages, these permalinks look and behave somewhat differently than normal SE comment links. In particular, they don't have the same fancy highlight-and-fade behavior as normal comment links, they won't onebox in chat, and they may not work correctly if the comment being linked to is hidden by default.

Alas, these are not issues that can be easily fixed on the client side — even if I added the necessary code to SOUP, it wouldn't help anyone else who might follow the link while not using the same user script.

share|improve this answer
    
Eww, jQuery. :P –  FEichinger Mar 14 at 1:39

You must log in to answer this question.

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