= Add Dojo Editor =
Download [http://www.dojotoolkit.org Dojo] (kitchen sink) and install it on your webserver in /media/dojo/...
Save the following script as !AddRichTextEditing.js into /media/js/admin/
{{{
document.write('');
document.write('');
var AddEditor = {
init: function() {
var helptext = document.getElementsByTagName('p');
for (var i = 0, ht; ht = helptext[i]; i++) {
if (ht.firstChild.data == "Rich Text Editing.") {
ht.previousSibling.previousSibling.setAttribute("dojoType", "Editor2");
}
}
},
}
addEvent(window, 'load', AddEditor.init);
}}}
This script looks for the help text "Rich Text Editing." and replaces the associated textarea with the Dojo-Editor. I´m using Editor2, because it´s loading much faster than Editor.
Define your model like this:
{{{
body = models.TextField('Body', help_text='Rich Text Editing.', blank=True, null=True)
...
class Admin:
js = ['js/admin/AddRichTextEditing.js']
}}}
that´s it.
== Screenshot ==
[http://www.vonautomatisch.at/django/dojoeditor.jpg Screenshot (Preview)]