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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<pre id="editor">function foo(items) {
|
<pre id="editor">Editor.prototype.showKeyboardShortcuts = function () {
|
||||||
var i;
|
showKeyboardShortcuts(this);
|
||||||
for (i = 0; i < items.length; i++) {
|
};
|
||||||
alert("Ace Rocks " + items[i]);
|
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/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>
|
<script src="../build/src-noconflict/ext-show_keyboard_shortcuts.js" type="text/javascript" charset="utf-8"></script>
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,18 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<pre id="editor">function foo(items) {
|
<pre id="editor">Editor.prototype.showSettingsMenu = function () {
|
||||||
var i;
|
showSettingsMenu(this);
|
||||||
for (i = 0; i < items.length; i++) {
|
};
|
||||||
alert("Ace Rocks " + items[i]);
|
editor.commands.addCommands([{
|
||||||
}
|
name: "showSettingsMenu",
|
||||||
}</pre>
|
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/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>
|
<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