Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: <a target="_glossary"> #1634

Closed
shimizukawa opened this issue Jan 3, 2015 · 4 comments
Closed

ENH: <a target="_glossary"> #1634

shimizukawa opened this issue Jan 3, 2015 · 4 comments
Labels
builder:html type:enhancement enhance or introduce a new feature

Comments

@shimizukawa
Copy link
Member

It would be great if glossary links opened in the same new tab.


@shimizukawa shimizukawa added type:enhancement enhance or introduce a new feature builder:html prio:low labels Jan 3, 2015
@shimizukawa
Copy link
Member Author

From Takayuki Shimizukawa on 2014-12-02 07:35:20+00:00

Hum.., in my case, several `.. glossary::`` directives are written in several pages which are not single purpose page for glossary. Because of it, I prefer the current (non target specified) implementation.
In another point of view, accessibility guideline recommended that target attribute should not be used until user agents allow users to turn off spawned windows [1]_.

I propose as an alternative, the behavior can be implemented by using JavaScript.
If you have a chance, please try it.

.. [1] http://www.w3.org/TR/2000/NOTE-WCAG10-TECHS-20001106/#gl-interim-accessibility

@shimizukawa
Copy link
Member Author

From Wes Turner on 2014-12-02 10:37:03+00:00

Thank you for the explanation!

I've added this to a few documentation sets, which I suppose either a) interrupts the UX; b) makes tangents (e.g. wikipedia pages) more noticeable:

$(document).ready(function() {
    $("a[href^='http']").attr('target','_blank');
});

On further review, I should probably add a checkbox.

@shimizukawa
Copy link
Member Author

From Wes Turner on 2014-12-02 10:37:21+00:00

Closed. Not a good idea.

@kmmbvnr
Copy link

kmmbvnr commented Apr 17, 2020

jQuery free version:

window.addEventListener('turbolinks:load', function() {
  document.querySelectorAll('a.reference.external').forEach(function(link) {
    link.target = '_blank';
  });
});

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder:html type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants