Hi all,

I'm trying to enhance the jWYSIWYG editor to allow me to automatically
link thumbnails to the parent image.

I can create the logic to strip out the the image basename (image.jpg)
and add the rest of the url just fine but, as of right now, I cant
seem to get the editor to recognize and then pull the img src when
it's selected.

Here's what I have, thanks in advance for the help.

controls: {
                                                                    lightBox : {
                                                                        visible 
: true,
                                                                        exec    
: function()
                                                                        {
                                                                            var 
selection = $
(this.editor).documentSelection();

                                                                           // 
if ( selection.length > 0 )
                                                                           // {
                                                                                
if ( $.browser.msie )
                                                                                
    this.editorDoc.execCommand
('createLink', true, null);
                                                                                
else
                                                                                
{
                                                                                
   // var szURL = prompt('URL',
'http://');
                                                                                
                                var szURL = 'confused';
                                                                                
    if ( szURL && szURL.length > 0 )
                                                                                
    {
                                                                                
        this.editorDoc.execCommand
('unlink', false, []);
                                                                                
        this.editorDoc.execCommand
('createLink', false, szURL);
                                                                                
    }
                                                                                
}
                                                                            //}
                                                                           // 
else if
( this.options.messages.nonSelection )
                                                                                
//alert
(this.options.messages.nonSelection);
                                                                        },

                                                                        tags : 
['a']
                                                                    },

Reply via email to