jQuery-textcomplete 与 CKEditor / TinyMCE 集成

jQuery-textcomplete Integration with CKEditor / TinyMCE

我尝试将 jquery-textcomplete 与 ckeditor 和 tinyMCE 集成。

我遇到了这个错误。

TypeError: CKEDITOR.instances.issue_notes is undefined

你能帮我把 jQuery-textcomplete 与 CKEditor / TinyMCE 集成吗?你可以在这里查看代码示例,https://jsfiddle.net/btjapqkp/

HTML

<script src="https://code.jquery.com/jquery-3.1.0.js" type="text/javascript"> 
</script>
<script src="https://cdn.ckeditor.com/4.5.10/standard/ckeditor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.10/adapters/jquery.js">
</script>

JavaScript

$(document).ready(function(){
  tinymce.init({ selector:'#three' });
  $('#two').ckeditor();
  $('.editable').textcomplete([{
    match: /(^|\b)(\w{2,})$/,
    search: function (term, callback) {
      var words = ['google', 'facebook', 'github', 'microsoft', 'yahoo'];
      callback($.map(words, function (word) {
        return word.indexOf(term) === 0 ? word : null;
      }));
    },
    replace: function (word) {
      return word + ' ';
    }
  }]);
});

这是因为 jquery-textcomplete 中的错误。请查看下面的 URL 以解决该问题。此解决方案将在不久的将来合并到 jquery-texcomplete。那么你不需要遵循下面的解决方案。

https://github.com/yuku-t/jquery-textcomplete/issues/285