0.1.1-alpha.13 • Published 6 months ago
moroboxai-editor-web v0.1.1-alpha.13
moroboxai-editor-web
Embeddable code editor for coding AIs for MoroboxAI on the web.
Install
Using npm:
npm install moroboxai-editor-web --save
Or:
git clone https://github.com/moroboxai/moroboxai-editor-web.git
cd moroboxai-editor-web
npm i
npm run build
Usage
Create a sample.html
file in the moroboxai-editor-web
folder:
<html>
<div id="editor"></div>
<script type="text/javascript" src="./lib/umd/moroboxai-editor-web.js"></script>
<script type="text/javascript">
// Initialize the editor on our div
const editor = MoroboxAIEditor.init({
element: document.getElementById("editor"),
value: 'function foo() {\n console.log("foo");\n}\n',
width: "500px",
height: "400px"
});
</script>
</html>
Open sample.html
in your browser and check the console output.
Arguments
Name | Type | Default | Description |
---|---|---|---|
element | Element | DOM element to attach the editor to | |
language | string | javascript | Selected language |
value | string | Initial content of the editor | |
width | string | Width of the div element | |
height | string | Height of the div element | |
onLoad | func | noop | Signature: function(value: string) => void Function called when the Load button is clicked |
onUnload | func | noop | Signature: function() => void Function called when the Unload button is clicked |
License
This content is released under the MIT License.
0.1.1-alpha.8
7 months ago
0.1.1-alpha.7
7 months ago
0.1.1-alpha.9
7 months ago
0.1.1-alpha.11
6 months ago
0.1.1-alpha.10
6 months ago
0.1.1-alpha.13
6 months ago
0.1.1-alpha.12
6 months ago
0.1.1-alpha.4
8 months ago
0.1.1-alpha.6
7 months ago
0.1.1-alpha.5
7 months ago
0.1.1-alpha.3
2 years ago
0.1.1-alpha.2
2 years ago
0.1.1-alpha.1
2 years ago
0.1.0-alpha.1
2 years ago