Greenguy's Board


Go Back   Greenguy's Board > Blogs and Blogging
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2006-06-28, 07:54 AM   #1
Simon
That which does not kill us, will try, try again.
 
Simon's Avatar
 
Join Date: Aug 2003
Location: Conch Republic
Posts: 5,150
Send a message via ICQ to Simon Send a message via AIM to Simon Send a message via Yahoo to 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.)

Working on new mantra:
"If it's not worth automating, it's not worth doing again."
__________________
"If you're happy and you know it, think again." -- Guru Pitka
Simon is offline   Reply With Quote
Old 2006-06-28, 08:30 AM   #2
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
Old 2006-06-28, 11:06 AM   #3
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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:45 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc