Skip to content

New version 3.9.2. Read more https://github.com/xdan/jodit/blob/maste…

Compare
Choose a tag to compare
@xdan xdan released this 26 Oct 17:20

💥 Breaking Change

  • Removed Travis.CI 👋👋👋
  • EventsNative module - renamed to EventEmitter
const editor = Jodit.make('#editor');

console.log(editor.e instanceof Jodit.modules.EventEmitter); // true
console.log(editor.events instanceof Jodit.modules.EventEmitter); // true
console.log(editor.events instanceof Jodit.modules.EventsNative); // true, deprecated
  • BOOM: Move Ajax class into request folder.
import { Ajax } from 'jodit/src/core/request';
  • Changed the signature of the send method in the Ajax API and is closer to the fetch () API
const editor = Jodit.make('#editor');

// Before
await new Ajax(editor, {
	url: 'index.php'
}).send(); // {success: true, data: ...}

// Now
await new Ajax(editor, {
	url: 'index.php'
})
	.send()˚
	.then(resp => resp.json()); // {success: true, data: ...}
  • In .npmignore added:
    • build-system/
    • test.html
    • .eslintrc.js
    • .eslintignore
    • .editorconfig
    • .gitignore
    • .prettierrc.json
    • .stylelintrc
    • app.css
    • composer.json

🚀 New Feature

In Dom module added nextGen and eachGen methods. These methods return generators:

const editor = Jodit.make('#editor');
editor.value = '<ul><li><img>1</li><li>2</li><li>3</li></ul>';

const gen = Dom.nextGen(editor.editor.querySelector('img'), editor.editor);
let next = gen.next();

while (!next.done) {
	console.log(next.value); // 1, LI, 2, LI, 3
	next = gen.next();
}

const gen2 = Dom.eachGen(editor.editor);
let next2 = gen2.next();

while (!next2.done) {
	console.log(next2.value); // UL, LI, 1, LI, 2, LI, 3
	next2 = gen2.next();
}

🐛 Bug Fix