当前位置: 首页 > 文档资料 > At.js 开发文档 >

usage with TinyMCE

优质
小牛编辑
133浏览
2023-12-01

for TinyMCE 3

tinyMCE.onAddEditor.add(function(mgr, ed) {
  var editor = $('#' + ed.editorId + '.atjs');
  if (editor.length == 1) {
    ed.onInit.add(function(ed, l) {
      $(ed.contentDocument.activeElement).atwho({settings go here});
    });
  }
});

for TinyMCE 4

Live Demo: https://github.com/ichord/At.js/blob/master/examples/tinyMCE.html

tinymce.init({
  selector: "#mce",
  init_instance_callback: function(editor) {
    $(editor.contentDocument.activeElement).atwho(at_config);
  }
});