Я использую TinyMce4 у меня есть pluging что добавить DIV моему редакторуTinyMCE добавить мульти элементы activeEditor.dom
Мой код:
tinymce.create('tinymce.plugins.AddContent', {
init: function (ed, url) {
ed.addCommand('mceAddContent', function() {
var editor = tinymce.activeEditor;
var ed_body = $(editor.getBody());
tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'div', { 'class': 'draggableTemplate' }, 'Add you element here...');
}),
// Register example button
ed.addButton('addcontent', {
title: 'Add content at the end',
cmd: 'mceAddContent',
image: url + '/img/addcontent.png',
onclick: function() {
}
});
}
});
tinymce.PluginManager.add('addcontent', tinymce.plugins.AddContent);
Теперь то, что мне нужно, чтобы добавить не только Div
я нужен элемент Ссылка (а) внутри этого DIV с классом и HREF
Пример:
<div class='draggableTemplate'>
<a href="#scroll1" class="scrollto">Link to element</a>
</div>
Как я могу использовать tinyMCE.activeEditor.dom.add или некоторые думают, что еще добавить DIV со ссылкой (а), как вы его видите в примере