tinyMCE-mention icon indicating copy to clipboard operation
tinyMCE-mention copied to clipboard

'extended' delimiters

Open chrishessler opened this issue 8 years ago • 4 comments

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.

chrishessler avatar Feb 29 '16 20:02 chrishessler

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.

StevenDevooght avatar Mar 01 '16 07:03 StevenDevooght

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;

}`

chrishessler avatar Mar 01 '16 08:03 chrishessler

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:

StevenDevooght avatar Mar 02 '16 08:03 StevenDevooght

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

marmz avatar Apr 05 '22 04:04 marmz