ckeditor5-classic-plus-fyp

1.0.2 • Public • Published

CKEditor 5 - Classic Plus

CKEditor 5 Classic Plus is a Custom Build built on top of CKEditor 5 Build - Classic (version: 29.1.0). It adds Simple Upload Adapter, Image Resize, Font Styling and much more to the official build.

alt text

Note, If you are looking for an easy way to create a custom build of CKEditor 5, check the online builder, which allows you to easily create a custom build through a simple and intuitive UI.

What's added to the official build?

Quick start

React

Installation

npm i @ckeditor/ckeditor5-react
npm i ckeditor5-classic-plus
import React, { useState } from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import ClassicEditor from "ckeditor5-classic-plus";

export default function MyEditor() {
  const [article, setArticle] = useState();
  
  return (
    <CKEditor
      editor={ClassicEditor}
      data={article}
      onInit={editor => {
        // You can store the "editor" and use when it is needed.
      }}
      onChange={(event, editor) => {
        const data = editor.getData();
        setArticle(data);
      }}
      config={{
        simpleUpload: {
          // The URL that the images are uploaded to.
          uploadUrl: "http://example.com",

          // Headers sent along with the XMLHttpRequest to the upload server.
          headers: {
            "X-CSRF-TOKEN": "CSFR-Token",
            Authorization: "Bearer <JSON Web Token>"
          }
        }
      }}
    />
  );
}

JS

Installation

npm i ckeditor5-classic-plus
import ClassicEditor from 'ckeditor5-classic-plus';

// Or using the CommonJS version:
// const ClassicEditor = require('ckeditor5-classic-plus');

ClassicEditor
  .create(document.querySelector('#editor'), {
  simpleUpload: {
      // The URL that the images are uploaded to.
      uploadUrl: "http://example.com",

      // Headers sent along with the XMLHttpRequest to the upload server.
      headers: {
        "X-CSRF-TOKEN": "CSFR-Token",
        Authorization: "Bearer <JSON Web Token>"
      }
    }
  })
  .then( editor => {
    window.editor = editor;
  })
  .catch( err => {
    console.error(err.stack);
  });

HTML

Installation

npm i ckeditor5-classic-plus
<div id="editor">
  <p>This is the editor content.</p>
</div>
<script src="./node_modules/ckeditor5-classic-plus/build/ckeditor.js"></script>
<script>
  ClassicEditor.create(document.querySelector("#editor"), {
    simpleUpload: {
      // The URL that the images are uploaded to.
      uploadUrl: "http://example.com/",

      // Headers sent along with the XMLHttpRequest to the upload server.
      headers: {
        "X-CSRF-TOKEN": "CSFR-Token",
        Authorization: "Bearer <JSON Web Token>"
      }
    }
  })
  .then(editor => {
    window.editor = editor;
  })
  .catch(err => {
    console.error(err.stack);
  });
</script>

Package Sidebar

Install

npm i ckeditor5-classic-plus-fyp

Weekly Downloads

1

Version

1.0.2

License

GPL-2.0-or-later

Unpacked Size

6.44 MB

Total Files

69

Last publish

Collaborators

  • guptaji048