'New Entry' ... URL button .... change/add default 'target'

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
plainsman
Regular
Posts: 6
Joined: Wed Jul 28, 2004 5:36 am

'New Entry' ... URL button .... change/add default 'target'

Post by plainsman »

Currently, when I am writing a 'New Entry' and use the 'URL' button to place a link in the copy ... it puts a regular old link ... which is great.

However, I'd like that link to 'always' be created with the

target="_blank"

action already there. It is just a personal choice thing.

Where, in what file, would I have to edit the ".php" to make this happen?

Is it 'serendipity_entries.php' ... can't figure it out.

Is there a forum post or s9y link with a description which I can't seem to find?

Any help, much appreciated! Thank you! Serendipity is terrific. :)
"You're only given a little spark of madness. You mustn't lose it."

Robin Williams, comedian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 'New Entry' ... URL button .... change/add default 'targ

Post by garvinhicking »

I guess you are using the URL button in non-WYSIWYG mode?

If so, edit your serendipity_editor.js and search for the function 'wrapSelectionWithLink' - there you will find the '<a href' code, where you can just insert your 'target=...' portion.

However, remember that 'target' is an invalid attribute for XHTML1.0 - you may want to use javascript for that:

Code: Select all

<a href="http://www.google.de/" onclick="window.open('newwin', this.href); return false">google</a>
or something like that...

Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
plainsman
Regular
Posts: 6
Joined: Wed Jul 28, 2004 5:36 am

Post by plainsman »

Thanks Garvin. I had not thought of that... good point. I'll just set a keystroke paste-it-in thingie and use the javascript. I realize it is important to be xhtml compliant ... i just don't think of it. I appreciate the tip. Thanks, again, for your help! :)
"You're only given a little spark of madness. You mustn't lose it."

Robin Williams, comedian
Post Reply