How can I enter text at the position of a cursor? the field is a contenteditable so it may contain in addition to normal html css texts and images.
I took the example in the plugin's documentation: Summernote - How to insert text to cursor position?
But even then the example does not work.
Example:
$('#summernote').summernote({
height: 300
});
$(".list-group li span").click(function() {
$('#summernote').summernote('editor.saveRange');
$('#summernote').summernote('editor.restoreRange');
$('#summernote').summernote('editor.focus');
$('#summernote').summernote('editor.insertText', $(this).text());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.0/summernote.min.js"></script><linkhref="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.0/summernote.css" rel="stylesheet">
<ul class="list-group">
<li class="list-group-item"><span class="label label-primary">[PHONE]</span> Telefone da Empresa.</li>
<li class="list-group-item"><span class="label label-primary">[FAX]</span> Telefax da Empresa.</li>
<li class="list-group-item"><span class="label label-primary">[EMAIL_1]</span> Primeiro Email da Empresa.</li>
<li class="list-group-item"><span class="label label-primary">[EMAIL_2] </span> Segundo Email da Empresa.</li>
</ul>
<div id="summernote"></div>