example code explains extension
This commit is contained in:
parent
3adba8eb21
commit
1a4af9aff9
2 changed files with 22 additions and 11 deletions
|
|
@ -21,12 +21,17 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<pre id="editor">function foo(items) {
|
||||
var i;
|
||||
for (i = 0; i < items.length; i++) {
|
||||
alert("Ace Rocks " + items[i]);
|
||||
<pre id="editor">Editor.prototype.showKeyboardShortcuts = function () {
|
||||
showKeyboardShortcuts(this);
|
||||
};
|
||||
editor.commands.addCommands([{
|
||||
name: "showKeyboardShortcuts",
|
||||
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
|
||||
exec: function(editor, line) {
|
||||
editor.showKeyboardShortcuts();
|
||||
}
|
||||
}</pre>
|
||||
}]);
|
||||
</pre>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../build/src-noconflict/ext-show_keyboard_shortcuts.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
|
|
|||
|
|
@ -21,12 +21,18 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<pre id="editor">function foo(items) {
|
||||
var i;
|
||||
for (i = 0; i < items.length; i++) {
|
||||
alert("Ace Rocks " + items[i]);
|
||||
}
|
||||
}</pre>
|
||||
<pre id="editor">Editor.prototype.showSettingsMenu = function () {
|
||||
showSettingsMenu(this);
|
||||
};
|
||||
editor.commands.addCommands([{
|
||||
name: "showSettingsMenu",
|
||||
bindKey: {win: "Ctrl-q", mac: "Command-q"},
|
||||
exec: function(editor, line) {
|
||||
editor.showSettingsMenu();
|
||||
},
|
||||
readOnly: true
|
||||
}]);
|
||||
</pre>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../build/src-noconflict/ext-show_settings_menu.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue