StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
220 stars 95 forks source link

Support of global function names in source and insert options #11

Closed charlie-wasp closed 9 years ago

charlie-wasp commented 9 years ago

I run into problem using this great plugin, because I couldn't configure it using anonymous callbacks in source and insert options, because I use tinyMCE via Symfony bundle, and there is configuration in yaml.

StevenDevooght commented 9 years ago

I'am not a fan of global functions, but isn't it possible to call the global functions like this?

mentions: {
    source: function(query, process, delimiter) {
        window.source(query, process, delimiter);
    },
    insert: function(item) {
        return window.insert(item);
    }
}
charlie-wasp commented 9 years ago

I think, you understood me wrong. I initialize tinyMCE via YAML config file, so all I can use is a plain string. And I offer this option for plugin - use string, that will be interpreted as a global function name

StevenDevooght commented 9 years ago

I suppose you're using https://github.com/stfalcon/TinymceBundle to configure your tinyMCE installation. I would check if it is possible to configure the plugin callback urls in some way. If it's not possible (which I highly doubt) the problem should be addressed in the Symfony bundle itself.