ichord / At.js

Add Github like mentions autocomplete to your application.
http://ichord.github.com/At.js
MIT License
5.3k stars 671 forks source link

tinymce3 integration help #575

Open shan2batman opened 5 years ago

shan2batman commented 5 years ago

Hi, currently i'm trying to create a facebook style tagging system with tinymce3 editor(i don't have a choice to upgrade to 4th version) and i'm following this example here https://github.com/ichord/At.js/wiki/usage-with-TinyMCE. The problem is i'm not able to initiate the facebook style dropdown tagging system as i type in the editor. can anyone help me with this. the code i tried so far:

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"});
          });
        }
      });