Skip to content

Instantly share code, notes, and snippets.

@xfenix
Created September 5, 2012 14:22
Show Gist options
  • Save xfenix/3637404 to your computer and use it in GitHub Desktop.
Save xfenix/3637404 to your computer and use it in GitHub Desktop.
Grappelli ckeditor simple integration with solved collapsable problem and django-filebrowser
{% extends "admin/base.html" %}
{% load i18n %}
{% block extrahead %}
<script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
grp.jQuery(function(){
config = {
'toolbar': [
[
'Undo', 'Redo',
'Styles',
'Bold', 'Italic', 'Underline',
'-', 'Link', 'Unlink', 'Anchor', 'Image',
'-', 'Maximize',
],
[ 'Table',
'-', 'BulletedList', 'NumberedList',
'-', 'Cut','Copy','Paste','PasteFromWord',
'-', 'SpecialChar',
'-', 'Source'
]
],
'forcePasteAsPlainText': true,
'filebrowserBrowseUrl': '/admin/filebrowser/browse/?pop=3',
};
grp.jQuery('textarea').click(function() {
CKEDITOR.replace(grp.jQuery(this)[0], config);
});
});
</script>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment