Project:Whizzywig - A complete WYSIWYG Editor
Version:6.x-1.9
Component:Code
Category:feature request
Priority:normal
Assigned:As If
Status:needs review

Issue Summary

Here's an unauthorized hack for adding a checkbox to the Link widget, allowing you to specify "rel=nofollow" for your links.

Step 1: Open up library/whizzywig.js in your text editor. Find the following line:

w(t('Link address (URL)')+': <input type="text" id="lf_url'+idTa+'" size="60"><br><input type="button" value="http://" onclick="o(\'lf_url'+idTa+'\').value=\'http://\'+o(\'lf_url'+idTa+'\').value"> <input type="button" value="mailto:" onclick="o(\'lf_url'+idTa+'\').value=\'mailto:\'+o(\'lf_url'+idTa+'\').value"><input type="checkbox" id="lf_new'+idTa+'">'+t("Open link in new window")+fNo(t("OK"),"insertLink()"));//LINK_FORM end

Insert + '<input type="checkbox" id="lf_rel'+idTa+'">'+t("Rel=nofollow ") just before +fNo so now it looks like this:

w(t('Link address (URL)')+': <input type="text" id="lf_url'+idTa+'" size="60"><br><input type="button" value="http://" onclick="o(\'lf_url'+idTa+'\').value=\'http://\'+o(\'lf_url'+idTa+'\').value"> <input type="button" value="mailto:" onclick="o(\'lf_url'+idTa+'\').value=\'mailto:\'+o(\'lf_url'+idTa+'\').value"> <input type="checkbox" id="lf_new'+idTa+'">'+t("Open link in new window")+ '<input type="checkbox" id="lf_rel'+idTa+'">'+t("Rel=nofollow ")+fNo(t("OK"),"insertLink()"));//LINK_FORM end

Step 2: Now find the following line:

else if (o("lf_new"+idTa).checked) insHTML('<a href="'+URL+'" target="_blank">');

and paste these two lines in front of it:

else if (o("lf_new"+idTa).checked && o("lf_rel"+idTa).checked) insHTML('<a href="'+URL+'" target="_blank" rel="nofollow">');
else if (o("lf_rel"+idTa).checked) insHTML('<a href="'+URL+'" rel="nofollow">');

Step 3: Clear your browser cache and make sure you're not aggregating JS files.