Skip to main content
#new anchor Started by Joshua Dickerson · · Read 9076 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

#new anchor

Why does it use "#new" as the anchor instead of the message id if the new link already has the msg id in it? Doesn't that seem weird? You could remove some extra markup and make the links work the same for everyone, instead of having #new go to a different message for everyone. You could use some JS to check if the anchor/id doesn't exist and then look for #new. What's with new topics having "?topic=$topic.msg0"?

Some pseudo  This might actually work:
Code: [Select]
function moveToNew()
{
    var hash = url.substring(url.indexOf('#')+1);
    if($('#' + hash).length == 0) {
        location.hash = '#new';
    }
}

Re: #new anchor

Reply #1

Food for thought: in Wedge, I changed the system to something simpler. If the current page has a message considered 'new', it shows the new anchor. BUT, if you access a page from a message ID (such as topic=35.msg123), the message #123 will always get a 'new' anchor, regardless of whether it's the first unread post. This way, you can always get to msg123 with a #new anchor, saving the need for a repetition in the URL. I fluctuated between #new and #msg (with no ID), but decided on #new to keep it consistent with existing conventions.
I have to change all ".msgXXXX" occurrences in the codebase, but all I can say is that it makes URLs cleaner.