Skip to content

Instantly share code, notes, and snippets.

@dimensi
Created April 7, 2019 09:11
Show Gist options
  • Save dimensi/2af7ab3b96cd6cccb7319f2eea836538 to your computer and use it in GitHub Desktop.
Save dimensi/2af7ab3b96cd6cccb7319f2eea836538 to your computer and use it in GitHub Desktop.
Example for use editorjs without js bundlers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Editor.js playground</title>
</head>
<body>
<div id="editor"></div>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
<script src="https://cdn.jsdelivr.net/combine/npm/@editorjs/image@2.2.0,npm/@editorjs/link@2.1.2"></script>
<script src="./index.js"></script>
</body>
</html>
const editor = new EditorJS({
/**
* Id of Element that should contain Editor instance
*/
holderId: 'editor',
tools: {
image: {
class: ImageTool,
config: {
endpoints: {
byFile: 'http://localhost:8008/uploadFile', // Your backend file uploader endpoint
byUrl: 'http://localhost:8008/fetchUrl', // Your endpoint that provides uploading by Url
}
}
},
link: LinkTool
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment