Skip to content

usage with CKEditor

steven-mercatante edited this page May 14, 2014 · 9 revisions

download your ckeditor package

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>

configure

    var at_config = {
      at: "@",
      data: names,
      tpl: "<li data-value='@${name}'>${name} <small>${email}</small></li>"
    }

    CKEDITOR.replace('ck').on('instanceReady', function(event) {
      // Make sure the textarea's `contentEditable` property is set to `true`
      this.document.getBody().$.contentEditable = true;
      $(this.document.getBody().$).atwho(at_config)
    });