Recent Topics

1 Apr 15, 2006 20:04    

The LINK button on the quicktags toolbar doesn't automagically include a title for the link. If you want one it's easy to do, and the way I did it will default to using the link as the title. Near as I can tell this will apply to any version you might be running. For all versions higher than 1 open plugins/_quicktags.plugin.php and find this:

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


Now replace it with this:

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

For those using .9.1b (and possibly older versions but you really should upgrade) you will find this file and function in your plugins/toolbars/ folder.

2 Sep 20, 2006 15:14

Good addition - had it on .9.1 and finally got around to adding it to 1.8.1

3 Sep 20, 2006 16:22

While your editing the _quicktags.plugin.php another handy addition is to add a "class" prompt and insert for the IMG button.

Simply find...(at page bottom)..

function b2evoInsertImage(myField) {
			var myValue = prompt('<?php echo T_('URL') ?>:', 'http://');
			if (myValue) {
				myValue = '<img src="'
						+ myValue
						+ '" alt="' + prompt('<?php echo T_('ALTernate text') ?>:', '')
						+ '" title="' + prompt('<?php echo T_('Title') ?>:', '')
						+ '" />';
				b2evoInsertContent(myField, myValue);
			}
		}


and replace with...'

function b2evoInsertImage(myField) {
			var myValue = prompt('<?php echo T_('URL') ?>:', 'http://');
			if (myValue) {
				myValue = '<img src="'
						+ myValue
						+ '" alt="' + prompt('<?php echo T_('ALTernate text') ?>:', '')
						+ '" title="' + prompt('<?php echo T_('Title') ?>:', '')
						+ '" class="' + prompt('<?php echo T_('Class') ?>:', '')
						+ '" />';
				b2evoInsertContent(myField, myValue);
			}
		}


Form is loading...