finish set up editor

parent c907273c
/* TinyMCE offline editor styles */
.mce-tinymce {
}
......@@ -3,10 +3,14 @@
<head>
<meta charset="utf-8">
<title> Локальный редактор TinyMCE </title>
<link rel="stylesheet" href="/css/editor.css" media="screen" title="no title">
</head>
<body>
<textarea id="editor">
<h1> Новый документ TinyMCE </h1>
</textarea>
<script src="node_modules/tinymce/tinymce.min.js" rel="text/javascript"></script>
<script src="js/editor.js" rel="text/javascript"></script>
</body>
</html>
/* Scripts for tinymce setup */
document.addEventListener("DOMContentLoaded", function() {
// Textarea id for tinymce
const editorSelector = '#editor';
tinymce.init({
selector: editorSelector,
theme: 'modern',
height: "600px",
//plugins: 'image link preview print lists charmap fullscreen',
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'fullscreen | insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons',
//toolbar: [
//'undo redo | styleselect | bold italic | link image | alignleft aligncenter alignright'
//],
file_browser_callback: function(field_name, url, type, win) {
var cmsURL = window.location.toString(); // script URL - use an absolute path!
if (cmsURL.indexOf("?") < 0) {
//add the type as the only query parameter
cmsURL = cmsURL + "?type=" + type;
}
else {
//add the type as an additional query parameter
// (PHP session ID is now included if there is one at all)
cmsURL = cmsURL + "&type=" + type;
}
tinyMCE.activeEditor.windowManager.open({
},
setup: function(editor) {
editor.on('init', function(e) {
//editor.execCommand('mceFullScreen'); // Make fullscreen by default
});
}
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment