WIP: toolbar
This commit is contained in:
@@ -1,38 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Editor</title>
|
||||
<style type="text/css" media="screen">
|
||||
.ace_editor,
|
||||
.toolbar {
|
||||
border: 1px solid lightgray;
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ace_editor {
|
||||
height: 200px;
|
||||
#editor {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({
|
||||
paths: {
|
||||
"ace": "src-min-noconflict"
|
||||
}
|
||||
});
|
||||
// load ace and extensions
|
||||
require(["ace/ace", "ace/ext-language_tools"], function(ace) {
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<script src="src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var buildDom = ace.require("ace/lib/dom").buildDom;
|
||||
var editor = ace.edit();
|
||||
editor.setOptions({
|
||||
@@ -66,6 +60,7 @@
|
||||
function save() {
|
||||
alert("not yet implemented");
|
||||
}
|
||||
|
||||
editor.commands.addCommand({
|
||||
name: "save",
|
||||
exec: save,
|
||||
@@ -112,9 +107,7 @@
|
||||
document.body.appendChild(editor.container)
|
||||
|
||||
window.editor = editor;
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user