1.0.2 • Published 3 years ago

@amerandish/farsava-ckeditor v1.0.2

Weekly downloads
-
License
LGPL-3.0-or-later
Repository
-
Last release
3 years ago

افزونه فارس‌آوا برای CKEditor5

به کمک دستور زیر می‌توانید افزونه فارس‌آوا را نصب کنید:

npm install --save @amerandish/farsava-ckeditor

پس از نصب افزونه، نیاز است تا در CKEditor5 خود افزونه را اضافه کنید.

به عنوان مثال:

// index.js
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
import {CONSTANTS, Farsava} from "@amerandish/farsava-ckeditor";

ClassicEditor
    .create(document.querySelector('#editor'), {
        plugins: [Essentials, Paragraph, Bold, Italic, Farsava],
        toolbar: ['bold', 'italic', CONSTANTS.buttons.duration, CONSTANTS.buttons.toggle, CONSTANTS.buttons.download],
        farsavaConfig: {
            liveUrl: '<LIVE_URL>', // آدرس سرور
            apiKey: '<API_KEY>',   // توکن
        },
    })
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error.stack);
    });

برای استفاده نیاز است آدرس سرور و همینطور توکن خود را در بخش زیر قرار دهید:

farsavaConfig: {
    liveUrl: '<LIVE_URL>', // آدرس سرور
    apiKey: '<API_KEY>'   // توکن
}        

این افزونه شامل ۵ آیتم نمایشی است که میتوانید به صورت دلخواه در CKEditor خود قرار دهید:

CONSTANTS.buttons.duration

CONSTANTS.buttons.start

CONSTANTS.buttons.stop

CONSTANTS.buttons.stop

CONSTANTS.buttons.start

CONSTANTS.buttons.toggle

CONSTANTS.buttons.download

حالت های آیتم های نمایشی:

ضبط متوقف شده/آماده به ضبط

CONSTANTS.buttons.start, CONSTANTS.buttons.toggle

ضبط متوقف شده/آماده به ضبط

CONSTANTS.buttons.stop

در حال ضبط

CONSTANTS.buttons.start, CONSTANTS.buttons.toggle

در حال ضبط

CONSTANTS.buttons.stop

در حال توقف ضبط

CONSTANTS.buttons.stop, CONSTANTS.buttons.toggle