-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtinymce.js
More file actions
33 lines (30 loc) · 1.02 KB
/
Copy pathtinymce.js
File metadata and controls
33 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// TinyMCE integration for review editor
// This file initializes TinyMCE on the #review-html-editor div and provides methods to get/set content.
window.initTinyMCE = function(initialHtml = '') {
if (window.tinymce) {
window.tinymce.remove('#review-html-editor');
}
window.tinymce.init({
selector: '#review-html-editor',
menubar: false,
plugins: 'link image lists code',
toolbar: 'undo redo | bold italic underline | alignleft aligncenter alignright | bullist numlist | link image | code',
height: 350,
setup: function(editor) {
editor.on('init', function() {
editor.setContent(initialHtml);
});
}
});
};
window.getTinyMCEContent = function() {
if (window.tinymce && window.tinymce.get('review-html-editor')) {
return window.tinymce.get('review-html-editor').getContent();
}
return '';
};
window.setTinyMCEContent = function(html) {
if (window.tinymce && window.tinymce.get('review-html-editor')) {
window.tinymce.get('review-html-editor').setContent(html);
}
};