jQuery-textcomplete Integration with CKEditor / TinyMCE



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

I got this error.

TypeError: CKEDITOR.instances.issue_notes is undefined

你能给我一点帮助集成jQuery-textcomplete与CKEditor/TinyMCE。您可以在这里查看代码示例,https://jsfiddle.net/btjapqkp/

<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中的一个bug。看看下面的URL来解决这个问题。该解决方案将在不久的将来合并到jquery-texcomplete中。那么你就不需要遵循下面的解决方案了。

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

最新更新