adds demo show_settings_menu
adds keyboard shortcut on init adds keyboard shortcut on init
This commit is contained in:
parent
7aac105a07
commit
3adba8eb21
4 changed files with 69 additions and 8 deletions
|
|
@ -61,7 +61,7 @@ define(function(require, exports, module) {
|
|||
* ☭ Hial Atropa!! ☭
|
||||
* @param {ace.Editor} editor An instance of the ace editor.
|
||||
*/
|
||||
module.exports.showKeyboardShortcuts = function showKeyboardShortcuts (editor) {
|
||||
function showKeyboardShortcuts (editor) {
|
||||
// make sure the menu isn't open already.
|
||||
if(!document.getElementById('kbshortcutmenu')) {
|
||||
var overlayPage = require('./menu_tools/overlay_page').overlayPage;
|
||||
|
|
@ -79,7 +79,17 @@ define(function(require, exports, module) {
|
|||
overlayPage(editor, el, '0', '0', '0', null);
|
||||
}
|
||||
};
|
||||
Editor.prototype.showKeyboardShortcuts = function () {
|
||||
module.exports.showKeyboardShortcuts(this);
|
||||
module.exports.init = function (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();
|
||||
}
|
||||
}]);
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -384,15 +384,25 @@ define(function(require, exports, module) {
|
|||
* ☭ Hial Atropa!! ☭
|
||||
* @param {ace.Editor} editor An instance of the ace editor.
|
||||
*/
|
||||
module.exports.showSettingsMenu = function showSettingsMenu (editor) {
|
||||
function showSettingsMenu (editor) {
|
||||
// make sure the menu isn't open already.
|
||||
if(!document.getElementById('settingsmenu')) {
|
||||
addEditorMenuOptions(editor);
|
||||
generateMenu(editor);
|
||||
}
|
||||
};
|
||||
Editor.prototype.showSettingsMenu = function () {
|
||||
module.exports.showSettingsMenu(this);
|
||||
};
|
||||
|
||||
module.exports.init = function (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
|
||||
}]);
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue