{% comment %}
    CKEditor requires you to have the resources referenced below installed
    under your MEDIA_URL. You can download them from ckeditor.com.
{% endcomment %}

<script type="text/javascript" src="{{ DJANGO_WYSIWYG_MEDIA_URL }}ckeditor.js"></script>
<script type="text/javascript" src="{{ DJANGO_WYSIWYG_MEDIA_URL }}sample.css"></script>
<script type="text/javascript">
    function django_wysiwyg_enable(editor_name, field_id, config)
    {
        window[editor_name] = CKEDITOR.replace(field_id, config);
    }

    function django_wysiwyg_disable(editor_name)
    {
        var editor = window[editor_name];
        if(editor)
        {
            editor.destroy(/*noUpdate=*/false);
            window[editor_name] = null;
        }
    }

    function django_wysiwyg_is_loaded()
    {
        return WINDOW.CKEDITOR != null;
    }
</script>
