Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Fix for Control.Tabs + Safari + uri encoded urls

#5

First of all, thanks for Tabs. It is a great little library, that

really makes working with tabs clean.

Having said that, we have got a slight issue with tabs, and complex

generated urls. In particular there were problems with uri encoded

urls containing %20, killing the autodetection of the links.

I was able to update the behavior, by changing the line:

return (/^#/).exec(link.href.replace(window.location.href.split('#')

[0],''));

to read:

return (/^#/).exec(link.href.replace(link.href.split('#')[0],''));

I believe that this keeps the intention the same, and might be worth

patching back into the main version.

Reported by Ryan Johnson · June 13th, 2008 @ 11:36 AM

State: hold
Milestone: 1.0
Assigned to: Ryan Johnson Ryan Johnson

Activity

  1. Suneth Mendis
    Suneth Mendis

    hey!

    I did think about what you said earlier on google discussion thread. Does link need to have the

    full url at all? In fact the line I changed ( return (/

    ^#/).exec(link.href.replace(window.location.href.split('#')

    [0],'')); ) is actually stripping the rest of the url before the #. So

    if the link does not have the full url, better still isn't it?

    Cheers,

    Suneth

    June 15th, 2008 @ 02:12 PM

  2. Ryan Johnson
    Ryan Johnson
    • State changed from unconfirmed to hold
    • Tag set to control.tabs

    Suneth, I've checked in another patch which dealt specifically with webkit, can you check out the latest version and see if it solves your problems?

    September 9th, 2008 @ 11:59 AM

  3. Trey Matteson
    Trey Matteson

    I hit this same problem, and the fix that is on the latest revision did not help at all. I am using this line successfully:

    return (/^#/).exec((Prototype.Browser.WebKit ? decodeURIComponent(link.href) : link.href).replace(/.*(#.*)/, "$1"));
    
    

    If the intent is to just cut the link's href down to the anchor piece, why mess with the page's url at all? Maybe there are useful cases where they would be different that I am not thinking of.

    October 15th, 2008 @ 01:04 PM

  4. Ryan Johnson
    Ryan Johnson

    Think I found the problem. When the URL contains "%23" window.location is undefined in safari. Trey, your fix solves the problem, thanks.

    October 22nd, 2008 @ 03:22 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.