[wp-hackers] Prompt to add title to link when using quicktags
Carthik Sharma
carthik at gmail.com
Sat Jun 19 17:09:59 UTC 2004
I wanted to have wordpress prompt me for the title of the links that I
post, and so I hacked quicktags.js to do the same:
Here is what I have in my wp-admin/quicktags.js file, closer to the bottom:
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
+ '" title="' + prompt('Enter a title for the link', '')
+ '">';
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}
This function replaces the existent edInsertLink(); function in the
quicktags.js file
--
Carthik Sharma
Ph.D. Fellow
University of Central Florida
Homepage: http://carthik.net
More information about the hackers
mailing list