如何在atmmce编辑器中初始化at.js以读取为用户类型

时间:2018-11-15 07:41:20

标签: jquery tinymce

当前,我正在尝试使用tinymce3编辑器创建一个Facebook样式标记系统(我没有选择升级到第4版),并且我在这里https://github.com/ichord/At.js/wiki/usage-with-TinyMCE遵循此示例。问题是我在编辑器中键入时无法启动Facebook样式下拉标签系统。谁能帮我这个。 我到目前为止尝试过的代码:

tinyMCE.onAddEditor.add(function(mgr, ed) {
    var editor = $('#' + ed.editor + '.atjs');
    var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "jeremy"];
    if (editor.length == 1) {
        ed.onInit.add(function(ed, l) {
            $(ed.contentDocument.activeElement).atwho({at: "@",data: "names"});
        });
    }
}); 

0 个答案:

没有答案