Recent Topics

1 Jul 16, 2006 13:56    

Hello!! My english is not very well. I hope to be help.

I want insert in admin area th link in this mode:

<a href="http://www.mysite.com" title="mysite" > </a>.

I modify this script:



function b2evoInsertLink(myField, i, defaultValue) {
			if (!defaultValue) {
				defaultValue = 'http://';
			}
			if (!b2evoCheckOpenTags(i)) {
				var URL = prompt('<?php echo T_('URL') ?>:' ,defaultValue);
				if (URL) {
					b2evoButtons[i].tagStart = '<a href="' + URL + '">';
					b2evoInsertTag(myField, i);
				}
			}
			else {
				b2evoInsertTag(myField, i);
			}
		}

with:



function b2evoInsertLink(myField, i) {
		   if (!b2evoCheckOpenTags(i)) {
				var URL = prompt('<?php echo T_('URL') ?>:' , 'http://');
				if (URL) {
					URL = '<a href="'
						+ URL
						+ '" title="' + prompt('<?php echo T_('Title') ?>:', '')
						+ '" >';
				    b2evoInsertContent(myField, URL);
				   }
			    }
			  else {
				b2evoInsertTag(myField, i);
			}
		}

but no function.

What am i do?

Thanks !! :(

2 Jul 16, 2006 14:04

Try :-

function b2evoInsertLink(myField, i, defaultValue) {
         if (!defaultValue) {
            defaultValue = 'http://';
         }
         if (!b2evoCheckOpenTags(i)) {
            var URL = prompt('<?php echo T_('URL') ?>:' ,defaultValue);
            var the_title = prompt('<?php echo T_('title') ?>:' ,'');
            if (URL) {
               the_button = '<a href="' + URL +'"';
               if( the_title ) the_button += ' title="' + the_title + '"';
               b2evoButtons[i].tagStart = the_button + '>';
               b2evoInsertTag(myField, i);
            }
         }
         else {
            b2evoInsertTag(myField, i);
         }
      } 

¥

3 Jul 16, 2006 14:15

Thanks for help me! Your solution is well!!

:lol:


Form is loading...