Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION Modify or Replace CKEditor
#21
Dear GS Users and Developers,
dear shawn_a and Felix:

This is an update to my last post. Now - with the kind help of its developer - SunEditor works with non-English button languages.

But I'm still stumped how to go about integrating SunEditor with GetSimple CMS.

Again, here is the local file and folder structure and how I integrated it into a html page:

________________________


Code:
SunEditor-master
|
|
|-- dist (folder)
|    |
|    |
|    |----------------------- css (folder)
|    |                         |
|    |-- fonts (folder)        |
|    |                         |-- suneditor.min.css
|    |-- suneditor.min.js
|
|
|-- src (folder)
|
|
|-- assets (folder)
|
|-------------------------------------------- lang (folder)
|                                              |
|-- lib (folder)                               |
|                                              |-- da.js
|-- plugins (folder)                           |
|                                              |-- de.js
|-- suneditor.js                               |
|                                              |-- da.js
|-- suneditor_build.js                         |
|                                              |-- es.js
|-- SunEditor - Page Source - 0023.html        |                  |
                                               |-- fr.js
                                               |
                                               |-- index.js
                                               |
                                               |-- ja.js
                                               |
                                               |-- pt.js
                                               |
                                               |-- ru.js
                                               |
                                               |-- zh_cn.js

________________________

The structure is the same as in my last post bar two exceptions:
1) In my last post I forgot to show the position of the file "SunEditor - Page Source - 0021.html".
2) Now this file has a new name "SunEditor - Page Source - 0023.html" as I included the changes for switching the button language.

________________________


Code:
<!DOCTYPE html>
<html lang="en">
<head>
 
<script src="dist/suneditor.min.js"></script>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<title>SunEditor</title>
    <!-- sample css -->
</head>
<body>
 
 
 
<div class="content" style="max-width: 1452px;">
    
 
<!-- suneditor -->
<link href="dist/css/suneditor.min.css" rel="stylesheet">
 
<textarea id="editor_classic">
<p><br></p>
<p>This is SunEditor</p>
    </textarea>
 
    <footer>
        <p>Footer</p>
    </footer>
</div>
 
 
<script src="src/lang/es.js"></script>
<script>
    
    SUNEDITOR.create('editor_classic', {     
        display: 'block',
        width: '100%',
        height: 'auto',
        popupDisplay: 'full',
        charCounter: true,
        font : [
             'Arial',
             'Tahoma',
             'Noto Sans'
        ],
        fontSize : [
             0.75, 1.00, 1.10, 1.25, 1.50, 1.75, 2.00,  2.50, 3.00, 3.50, 4.00
        ],
        "fontSizeUnit": "em",
        colorList : [
             ['#c0c0c0', '#dedede', 'OrangeRed', 'Orange', 'RoyalBlue', 'SaddleBrown'],
             ['SlateGray', 'BurlyWood', 'DeepPink', 'FireBrick', 'Gold', 'SeaGreen'],
        ],
        "paragraphStyles": [
             "neon",
             "spaced",
             {
                 "name": "Box",
                 "class": "__se__box"
             },
             {
                 "name": "test",
                 "class": "__se__test"
             }
         ],
         "textStyles": [
             "translucent",
             {
                 "name": "blue",
                 "style": "color: #00f;",
                 "tag": "span"
             }
         ],
         "lineHeights": [
             {
                 "text": "Single",
                 "value": 1
             },
             {
                 "text": "One and a half",
                 "value": 1.5
             },
             {
                 "text": "Double",
                 "value": 2
             }
         ],
         buttonList: [
             ['undo', 'redo'],
             ['font', 'fontSize', 'formatBlock'],
             ['paragraphStyle'],
             ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'],
             ['fontColor', 'hiliteColor', 'textStyle'],
             ['removeFormat'],
             ['outdent', 'indent'],
             ['align', 'horizontalRule', 'list', 'lineHeight'],
             ['table', 'link', 'image', 'video'],
             ['fullScreen', 'showBlocks', 'codeView'],
             ['preview', 'print'],
             ['save', 'template']
         ],
         placeholder: 'This is a great wysiwyg editor!',
         templates: [
             {
                 name: 'Template-1',
                 html: '<p>HTML source1</p>'
             },
             {
                 name: 'Template-2',
                 html: '<p>HTML source2</p>'
             }
         ],
         lang : SUNEDITOR_LANG.es
    });
 
</script>
</body>
</html>

________________________

I also want to add the lines the developer of SunEditor wrote to me regarding the output of the editor:

How do I save the output of SunEditor? :

You can use the "save" or "getContents" method.
The "save" method stores the contents in "textarea", which is the basis for editor creation.
The "getContents" method gets the contents of the current editor.
const editor = suneditor.create('id');
editor.save();
editor.getContents();

https://github.com/JiHong88/SunEditor#functions


Is this of any help?

And, well, yes, I would still be glad to receive some hints on how I should proceed in replacing CKEditor with SunEditor in GetSimple CMS. Then not only I would have a wysiwy editor within a superb CMS - the acme of website building!


Best regards
Samson
Reply


Messages In This Thread
Modify or Replace CKEditor - by Samson - 2019-09-30, 19:42:09
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-02, 00:25:38
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-02, 00:26:38
Thank you: Modify or Replace CKEditor - by Samson - 2019-10-02, 04:01:36
RE: Modify or Replace CKEditor - by Felix - 2019-10-02, 05:06:04
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 08:50:32
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:11:07
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:14:17
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:15:25
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:16:59
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:21:39
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:23:17
RE: Modify or Replace CKEditor - by datiswous - 2019-10-03, 19:09:41
RE: Modify or Replace CKEditor - by Samson - 2019-10-04, 01:33:56
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 04:47:51
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 05:03:14
RE: Modify or Replace CKEditor - by Samson - 2019-10-05, 06:06:39
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 06:18:31
RE: Modify or Replace CKEditor - by Felix - 2019-10-05, 09:52:48
RE: Modify or Replace CKEditor - by Samson - 2020-01-05, 22:27:23
RE: Modify or Replace CKEditor - by Samson - 2020-01-07, 08:12:34
RE: Modify or Replace CKEditor - by Samson - 2020-01-12, 08:52:56
RE: Modify or Replace CKEditor - by Samson - 2020-01-15, 02:21:58



Users browsing this thread: 1 Guest(s)