github xdan/jodit 3.5.1
Groups buttons

latest releases: 4.2.41, 4.2.40, 4.2.39...
3 years ago

🏠 Internal

  • Removed useAceEditor option. #544
  • Added component and persistent decorators
import {component, persistent} from "./src/core/decorators";

@component
class Item extends UIElement{
    @persistent
    options = {
        some: true
    };
}

const item = new Item(jodit);
console.log(item.options); // {some: true}

item.options = {
 some: false
};

const item2 = new Item(jodit); // or reload page
console.log(item.options); // {some: false}
  • In UIInput added autocomplete, clearButton, icon options.

🐛 Bug Fix

🚀 New Feature

Jodit.atom

Jodit.Array and Jodit.Object marked as deprecated. In 3.5 they will be removed. Instead, use Jodit.atom.

const editor = Jodit.make('#editor', {
    buttons: Jodit.atom(['bold', 'italic']),
    popup: {
        img: Jodit.atom({
            // full rewrite
        })
    }
});
New option observer.maxHistoryLength: number = Infinity

Related with #574. In some cases need to limit size of undo history.

New options in link.plugin
  • @Property {"input"|"select"|""} link.modeClassName="input" Use an input text to ask the classname or a select or not ask
  • @Property {boolean} link.selectMultipleClassName=true Allow multiple choises (to use with modeClassName="select")
  • @Property {number} link.selectSizeClassName=3 The size of the select (to use with modeClassName="select")
  • @Property {IUIOption[]} link.selectOptionsClassName=[] The list of the option for the select (to use with modeClassName="select")
  • ex: [
  •   	{ value: "", text: "" },
    
  •   	{ value: "val1", text: "text1" },
    
  •   	{ value: "val2", text: "text2" },
    
  •   	{ value: "val3", text: "text3" }
    
  •   ]
    

PR: #577 Thanks @s-renier-taonix-fr

New option statusbar: boolean = true

Issue #535

const editor = Jodit.make('#editor', {
   statusbar: false
});
console.log(editor.statusbar.isShown); // false
editor.statusbar.show();
console.log(editor.statusbar.isShown); // true
Buttons groups

The buttons option can contain named groups of buttons.
Each plugin decides which button belongs to which group.
Thus, if you turn off the plugin, then its buttons will not be shown either.
Available groups: ["source", "font-style", "script", "list", "indent", "font", "color", "media", "state", "clipboard", "insert", "history", "search", "other", "info"];

const editor = Jodit.make('#editor', {
    buttons: [
        {
            group: "custom",
            buttons: []
        },
        "bold"
    ]
});

Jodit.defaultOptions.controls.someButton = {
    icon: 'pencil',
    command: 'selectall'
};

Jodit.plugins.add('somePlugin', function (editor) {
    editor.registerButton({
        name: 'someButton',
        group: 'custom'
    });
})
Hotkeys for BackSpace and Delete and remove part of text

Added hotkey settings for Delete and Backspace buttons.
And added hotkey ctrl+backspace for removing left part of text.
Issue: #532

Jodit.make('#editor', {
    delete: Jodit.atom({
        hotkeys: {
            delete: ['delete', 'cmd+backspace'],
            deleteWord: ['ctrl+delete', 'cmd+alt+backspace', 'ctrl+alt+backspace'],
            backspace: ['backspace'],
            backspaceWord: ['ctrl+backspace']
        }
    })
});
Added one method in event system
const editor = Jodit.make('#editor');

editor.events
    .one('keydown', () => {
        console.log('Fire only one time');
    })
    .on('keydown', () => {
        console.log('Fire everytime');
    });

Don't miss a new jodit release

NewReleases is sending notifications on new releases.