- b2evolution CMS Support Forums
- b2evolution Development
- A look into the future
- Feature requests and Feedback
- Enhancement to link button on post page
1 davidnewcomb Nov 19, 2007 01:20
Version: 2.1.0-beta
File: plugins/_quicktags.plugin.php
It would be really handy to make the Url button ask for the name of the web link as well as the url. For example (around line 373):
function b2evoInsertLink(myField, i, defaultValue)
{
if (!defaultValue)
{
defaultValue = 'http://';
}
if (!b2evoCheckOpenTags(i)) {
var URL = prompt( '<?php echo T_('URL') ?>:', defaultValue);
var NAME = prompt( '<?php echo T_('Link name') ?>:', '');
if (URL)
{
b2evoButtons[i].tagStart = '<a href="' + URL + '">';
if (NAME)
{
b2evoButtons[i].tagStart += NAME + '</a>';
}
b2evoInsertTag(myField, i);
}
}
else
The only problem with this is that the link is finished but the button label reads "/link", but I'm sure that someone of your talents can sort that out ;)
Wow what a great idea! I know this is kinda old, but kudos for a good suggestion and most of the implementation of it. Getting rid of the /link is easy believe it or not. Maybe as a new button like "!L" perhaps indicating it is one of those "self closing" buttons?
Anyway great suggestion and thanks for the head start on the code.