Opened 14 years ago
Closed 14 years ago
#16155 closed defect (bug) (fixed)
"Shortlink" button in admin bar relies on shortlink meta tag to work
Reported by: | solarissmoke | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
If you remove the remove the action that adds <link rel="shortlink" ...
into the head of a post, the shortlink button in the admin bar says "No shortlink available for this page" when you click it, even though the href for the link is a valid shortlink.
IMO the absence of the <link>
does not mean that one doesn't exist (it could be announced in other ways, e.g., a HTTP header), and so the admin bar button needs to take this into account.
Maybe the clickShortlink
Javascript function should check the href of the shortlink button in cases where there is no <link>
tag?
Attachments (6)
Change History (23)
#3
follow-up:
↓ 5
@
14 years ago
Look at all that red :-)
At that point, we don't even need var shortlink, right? Can just do t.href?
#4
follow-up:
↓ 7
@
14 years ago
Looks like we can also remove the noShortlink bit from script-loader, as the Shortlink menu item will only exist when there's a shortlink.
#5
in reply to:
↑ 3
@
14 years ago
Replying to nacin:
At that point, we don't even need var shortlink, right? Can just do t.href?
I guess not, since after t = t.parentNode
it's not a link anymore.
#7
in reply to:
↑ 4
@
14 years ago
Replying to nacin:
Looks like we can also remove the noShortlink bit from script-loader, as the Shortlink menu item will only exist when there's a shortlink.
Done.
#8
@
14 years ago
Just wondering, is there a reason why we don't give the Admin Bar li's an id (instead of class), and use that instead of class sniffing? I'm guessing there is, because otherwise it would be a lot simpler.
Also, the script currently adds an event handler to monitor ALL clicks in the admin bar area, even though the only one we do anything with is the shortlink button - wouldn't it be better to add the handler directly to the link? Again, there may be a reason it is done this way, just that I don't know it.
#9
@
14 years ago
Not putting id attributes on the admin menu elements avoids potential conflicts.
Also, note that the class attribute is on the li
element, not the a
element. The current admin bar view provides a way to put classes (and not ids) on the li
elements but not the a
elements.
#11
@
14 years ago
This patch makes the shortlink menu item expand when clicked (like a sub-menu when a menu item is hovered over), and automatically highlights the shortlink.
#13
@
14 years ago
Patch reselects shortlink when a user clicks on it, increases the shortlink container's width, and fixes a bug where hovering
can be undefined.
Since it actually links to the shortlink, we should simply have it echo its own link.