View Single Post
Old 2006-06-28, 11:06 AM   #40
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
Quote:
Originally Posted by Useless Warrior
Code:
function edInsertLink(myField, i, defaultValue) {
	if (!defaultValue) {
		defaultValue = 'http://';
	}
	if (!edCheckOpenTags(i)) {
		var URL = prompt('Enter the URL' ,defaultValue);
		if (URL) {
			edButtons[i].tagStart = '<a href="' + URL + '">';
			edInsertTag(myField, i);
		}
	}
	else {
		edInsertTag(myField, i);
	}
}
Change -
edButtons[i].tagStart = '<a href="' + URL + '">';
to-
edButtons[i].tagStart = '<a href="' + URL + '" rel="tag">';
If, like me, you use different 'rels' for different types of link, you could prompt for the rel to use:
Code:
function edInsertLink(myField, i, defaultValue) {
	if (!defaultValue) {
		defaultValue = 'http://';
	}
	if (!edCheckOpenTags(i)) {
		var URL = prompt('Enter the URL' ,defaultValue);
		var REL = prompt('Enter the rel' ,'external');
		if (URL) {
			edButtons[i].tagStart = '<a href="' + URL + '" rel="' + REL + '">';
			edInsertTag(myField, i);
		}
	}
	else {
		edInsertTag(myField, i);
	}
}
Substitute 'external' for the rel you use most often.
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.
oast is offline   Reply With Quote