Recent Topics

Enhancement to link button on post page

Started by on Nov 19, 2007 – Contents updated: Nov 19, 2007

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 ;)

Jan 19, 2008 07:54

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.


Form is loading...

b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.