G
G
Genri_Rus2020-07-22 23:51:58
JavaScript
Genri_Rus, 2020-07-22 23:51:58

Is it possible to save the icon (picture) of the new button in another place?

There is an example:

(function() {
  tinymce.create('tinymce.plugins.new_button', {
    init: function(ed, url) {
      ed.addButton('button_span_normal', {
        title: 'Новая кнопка',
        image: url + '/new-button.png',
        onclick: function() {
          ed.selection.setContent('[yellow]' + ed.selection.getContent() + '[/yellow]');
        }
      });
    },
    createControl: function(n, cm) {
      return null;
    },
  });
  
  tinymce.PluginManager.add('tinymce_new_button', tinymce.plugins.new_button);
})();


There is a url variable, by default it has this path:
https://название сайта/assets/js/

Is it possible to save the icon of the new button to another location?
Let's assume this path: https://название сайта/assets/images/

Or is it still impossible to change the path of the url variable and move the icon of the new button to the images folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Dvoryanov, 2020-07-23
@Genri_Rus

If you are not too lazy to have one path for all button icons, but for new ones add a condition and set an alternative path and you can’t solve this issue in another way, then you can.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question