#editjs
DIY: Build your custom web editor. We love to change your habit how you think of web editors.
Installation
npm install @editjs/editjs
Usage
<!DOCTYPE html>
<html>
<head>
<script data-main="node_modules/@editjs/editjs/editjs-config" src="node_modules/requirejs/require.js"></script>
<script>
require(["editjs"], function(editjs) {
editjs.onReady(function() {
var e = new editjs();
try {
e.emit("template", [ "editjs-tuts" ]);
e.watch("editjs-tuts", "error", function(error) {
console.log("onError:" + error);
});
e.dragDrop("drag", "drop-box",
function(event) { console.log(event); },
function(event) { console.log(event); }
);
}
catch (err) {
console.error(e.getLogs());
}
});
});
</script>
</head>
<body>
<template id="template">
<!-- The editjs goes awesome -->
Hello World! :-)
</template>
<div id="drag">
Drag me!
</div>
<div id="drop-box">
Drop here!
</div>
<lovely-editjs id="editjs-tuts"></lovely-editjs>
</body>
</html>
Tests
npm test
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.