skip to Main Content

I added ckeditor using this syntax <script src="https://nightly.ckeditor.com/full/ckeditor.js"></script>. My ckeditor editor toolbar looks like below.

enter image description here

I would like to add new functionalities to an existing icon.

How can I do that ?

2

Answers


  1. Use this CKEditor version CDN

    <script src="https://cdn.ckeditor.com/ckeditor5/35.3.2/super-build/ckeditor.js"></script>
    

    for reference :- https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html#using-the-ckeditor-5-superbuild

    Login or Signup to reply.
  2. Try to add as a plugin like this,

    CKEDITOR.plugins.add("timestamp", {
      init: function (editor) {
        editor.addCommand("insertTimestamp", {
          exec: function (editor) {
            var now = new Date();
            editor.insertHtml(now.toString());
          },
        });
        editor.ui.addButton("Timestamp", {
          label: "Insert Timestamp",
          command: "insertTimestamp",
          toolbar: "insert",
          icon: "https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/Clock.png",
        });
      },
    });
    

    enter image description here

    Check the clock icon in the toolbar option besides smiley icon.
    You can add the functionality to be performed in the exec function

    Hope this helps

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search