*django-wysiwyg-redactor is a reusable application for Django, using WYSIWYG editor * * now the redactor toolbar is more responsive * with the *extra_script* option/setting you can load some script to do something more after load the redactor * removing some ajax calls, (modal windows), to avoid the crossdomain issue on production env * new API method `$('#redactor').getSettings()` you can get and set settings anytime you want * new API method `$('#redactor').getSelection()` get the selected content in editor The correct javascript language files will be loaded automatically: class MyForm(forms.Form):Ībout_me = forms.* version of plugin redactorjs 7.6.3 (changes the (#license) too) If you wish to use Redactor in other languages, you only need to specify the lang setting. Redactor widgets need to include some CSS and JavaScript to work properly: If you are using a redactor widget outside the admin, you'll need to be sure that you render the form's media. It is possible to exclude jQuery from the media of the redactor field and wdiget if you wish to handle JavaScript dependency management yourself: class MyForm(forms.Form):Ībout_me = RedactorField(include_jquery=False) However, this can cause issues where other widgets or forms on a page are using a different version of jQuery. By default, jQuery is included as part of the field and widget media. The redactor javascript library requires jQuery 1.9 or better to function. This field can be used anywhere forms.CharField can and accepts the same arguments, but always renders a Redactor widget: from redactor.fields import RedactorField All other paths will be prepended with the value of the STATIC_URL setting (or MEDIA_URL if static is not defined).įor the sake of convenience, there is also a form field that can be used that accepts the same inputs. If a path starts with '/', ' or ' it will be interpreted as an absolute path, and left as-is. Paths used to specify CSS can be either relative or absolute. You can also customize any of the Redactor editor's settings when instantiating the widget: class MyForm(forms.Form):Ībout_me = forms.CharField(widget=RedactorEditor(redactor_settings=,įinally, you can connect a custom CSS file to the editable area of the editor: class MyForm(forms.Form):Ībout_me = forms.CharField(widget=RedactorEditor( Example usage: from django import formsįrom redactor.widgets import RedactorEditorĪbout_me = forms.CharField(widget=RedactorEditor()) It is a drop-in replacement for any TextArea widget. The redactor app provides a Django widget called RedactorEditor. Add the redactor application to your INSTALLED_APPS setting.Add the redactor directory to your Python path. This package helps integrate the Redactor Javascript WYSIWYG-editor in Django. This means users cannot simply pip/easy_install the package by name alone. Although this is-admittedly-a big change, it's the only way I can see to deal with an issue that has plagued this project from the start: it isn't listed on PyPI because the name "django-redactor" is already taken. All future development will continue there and users should switch to the renamed project when they have the opportunity. As of Apthis project has been forked and renamed django-redactoreditor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |