On Wednesday, April 22, 2015 at 3:01:22 AM UTC-7, Mo wrote:
>
> Hi,
>
> some users complained about a behaviour that could be optimized on Trac:
>
> Opening new Links while being on an unsaved Wiki or Ticket should always 
> confirm about leaving as many websites do or at least open some important 
> links like WikiFormatting which I also have most times opened side-by-side 
> when editing.
>
> I myself open most of these links as tabs explicitly because I don't rely 
> on some default behaviour of pages. As Trac does never create any new tab 
> (by convention? I actually don't like opening new windows or tabs imlicitly 
> by page), at least a confirmation about leaving an unsaved page and thus 
> loosing data would be helpful. Any plugin for that or is this worth a 
> feature request?
>

In #11127 (1) for Trac 1.0.2 we added the trac-target-new class. The 
preferences link on ticket and wiki pages open in a new window in Trac 
1.0.2 and later. When a link has the trac-target-new class it will open a 
in a new window. You could write a plugin to utilize the class.

Try this in the browser console:
jQuery('a').addClass('trac-target-new');
jQuery(".trac-target-new").attr("target", "_blank");

The later statement is only needed if the class is added after the page 
finishes loading. You probably want to be more selective in the links that 
are opened on the new page.

(1) http://trac.edgewall.org/ticket/11127

 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to