View Single Post
Old 2006-06-28, 08:30 AM   #8
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
Quote:
Originally Posted by Simon
Could someone hit me up later on icq about what needs to be changed in the quicktags.js to make the tagging work automatically? (Or maybe it's worth posting here for others too.)
For sure. I'll tell you, but don't tell the rest of these clowns. Okay? Quicktags.js is used for writing/editing posts when you are NOT using that crappy Visual Rich Editor, but I'm unsure if it's used if you are using the VRE.

Open -
wp-includes/js/quicktags.js

Look for (pretty much at the end of the file)-
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">';

Coincidentally, this is also where you could add a mouseover into your anchors, if you wished, because that is the code that inserts the linking structure when you hit the "link" button.
__________________
Click here to purchase a bridge I'm selling.
Useless is offline   Reply With Quote