{% load argonauts %}

{{ textarea }}

<script>
  {# this tells CKEditor where to find its static assets #}
  CKEDITOR_BASEPATH = {{ ckeditor_path|json }};
  {# we need to ensure that the ckeditor library is loaded before we try to use it #}
  require(['lib/ckeditor/ckeditor'], function() {
    CKEDITOR.replace({{ html_id|json }}, {{ config|json }});
  });
</script>

{% load argonauts %}

{{ textarea }}

<script>
  {# this tells CKEditor where to find its static assets #}
  CKEDITOR_BASEPATH = {{ ckeditor_path|json }};
  (function (load) {
    {# only require CKEDITOR if it hasn't already be loaded. This allows loading your own ckeditor. #}
    if ( typeof CKEDITOR === 'object' )
      load();
    else
      require(['lib/ckeditor/ckeditor'], load);
  })(function() {
    CKEDITOR.replace({{ html_id|json }}, {{ config|json }});
  });
</script>

Make CKEditorWidget work without require.js
Make CKEditorWidget work without require.js

If we just use an already-loaded CKEDITOR, you can use this field
outside of Widgy without require.js.
