#9134 closed enhancement (worksforme)
Allow links to open in a new tab or window frame
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | |
Component: | rendering | Version: | |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The current link system is well implemented, but I would like to be able to also define links in the wiki that would open in a new window. Currently this can only be achived by marking up the link using standard HTML, which of course is quite a bit of overhead.
I would propose the following to make this work:
When placing links where wiki syntax is being supported, one can prefix the realm by the keyword 'ext', e.g.
[ext:wiki:OpensInNewWindow] or ext:http://opens.in.new.window.org
which then would be rendered as
<a href="/wiki/OpensInNewWindow" target="_blank">OpensInNewWindow</a> or <a href="http://opens.in.new.window.org/" target="_blank">http://opens.in.new.window.org/</a>
The required changes to the current wiki parser should be minimal.
Attachments (0)
Change History (6)
comment:1 by , 15 years ago
Milestone: | → 1.0 |
---|
follow-up: 4 comment:3 by , 15 years ago
Using Javascript fails for certain links, I will lookup the required information and post it here, so that perhaps the CSS can be reworked on the behalf of these parts?
comment:4 by , 15 years ago
Replying to Carsten Klein <carsten.klein@…>:
Using Javascript fails for certain links, I will lookup the required information and post it here, so that perhaps the CSS can be reworked on the behalf of these parts?
Reconsidering this, it could be well made a plugin, so there is actually no need to integrate this into trac. Having said this, I will look into providing a jquery based routine which will update all ext links on document load, for a plugin that I am currently developing.
I think that we can close this.
comment:5 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I will close this since it can actually be accomplished by a IWikiSyntaxProvider.
comment:6 by , 15 years ago
Milestone: | triaging |
---|
The
target=
attribute is not defined in XHTML strict, which is what Trac generates. So the simple solution won't work.An alternative could be to add the attribute in the DOM after the page has loaded, using JavaScript.