StevenDevooght / tinyMCE-mention

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

'extended' delimiters #35

Open chrishessler opened 8 years ago

chrishessler commented 8 years ago

Hi,

I was wondering if it is possible to use an 'extended' delimiter? Currently it is limited by a single character. I would like to use the delimiters as e.g.:

@account.(query) @contact.(query) etc.

StevenDevooght commented 8 years ago

This is currently not supported. I think it's quite complex to implement. Also using @ and @account on one tinymce instance would not work since there's no way to differentiate between the two.

chrishessler commented 8 years ago

I do not wish to use '@' itself as a delimiter. My delimiter array would look like: ['@account.', '@contact.'] So the text after '@' would be my differentiation like so:

`delimiter: ['@account.', '@contact.'],

source: function (query, process, delimiter) {

switch (delimiter) {

    case '@account.':

    case '@contact.':

        $.get('/admin/template/variables/' + delimiter, function (data) {

            process(JSON.parse(data));

        });

    break;

}`
StevenDevooght commented 8 years ago

It was not my intend to support these kind of delimiters as they are not very easy to use for end users.

But feel free to contribute:smile:

marmz commented 2 years ago

I do not wish to use '@' itself as a delimiter. My delimiter array would look like: ['@account.', '@contact.'] So the text after '@' would be my differentiation like so:

`delimiter: ['@account.', '@contact.'],

source: function (query, process, delimiter) {

switch (delimiter) {

    case '@account.':

    case '@contact.':

        $.get('/admin/template/variables/' + delimiter, function (data) {

            process(JSON.parse(data));

        });

    break;

}`

HI! Did you find a solution to this? I have the same problem and i did not try to modify the code .. by now ;)