| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 6 |
<title>Editor</title> |
| 7 |
<style type="text/css" media="screen"> |
| 8 |
body { |
| 9 |
overflow: hidden; |
| 10 |
} |
| 11 |
#editor { |
| 12 |
margin: 0; |
| 13 |
position: absolute; |
| 14 |
top: 0; |
| 15 |
bottom: 0; |
| 16 |
left: 0; |
| 17 |
right: 0; |
| 18 |
} |
| 19 |
</style> |
| 20 |
</head> |
| 21 |
<body> |
| 22 |
|
| 23 |
<pre id="editor"></pre> |
| 24 |
|
| 25 |
<script src="kitchen-sink/require.js"></script> |
| 26 |
<script> |
| 27 |
// setup paths |
| 28 |
require.config({paths: { "ace" : "../src"}}); |
| 29 |
require(["ace/ace"], function(ace) { |
| 30 |
var editor = ace.edit("editor") |
| 31 |
editor.setTheme("ace/theme/twilight") |
| 32 |
editor.session.setMode("ace/mode/html") |
| 33 |
|
| 34 |
// add command to lazy-load keybinding_menu extension |
| 35 |
editor.commands.addCommand({ |
| 36 |
name: "showKeyboardShortcuts", |
| 37 |
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, |
| 38 |
exec: function(editor) { |
| 39 |
ace.config.loadModule("ace/ext/keybinding_menu", function(module) { |
| 40 |
module.init(editor); |
| 41 |
editor.showKeyboardShortcuts() |
| 42 |
}) |
| 43 |
} |
| 44 |
}) |
| 45 |
editor.execCommand("showKeyboardShortcuts") |
| 46 |
}) |
| 47 |
</script> |
| 48 |
|
| 49 |
<script src="./show_own_source.js"></script> |
| 50 |
</body> |
| 51 |
</html> |