Add keybinding selection to textarea bookmarklet

This commit is contained in:
Chester Wood 2013-01-04 17:34:12 -07:00 committed by nightwing
commit bd2e5381cc

View file

@ -324,6 +324,19 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
editorDiv.style.fontSize = value;
break;
case "keybindings":
switch (value) {
case "vim":
editor.setKeyboardHandler(require("ace/keyboard/vim").handler);
break;
case "emacs":
editor.setKeyboardHandler(require("ace/keyboard/emacs").handler);
break;
default:
editor.setKeyboardHandler(null);
}
break;
case "softWrap":
switch (value) {
case "off":
@ -391,6 +404,7 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) {
theme: "Theme:",
fontSize: "Font Size:",
softWrap: "Soft Wrap:",
keybindings: "Keyboard",
showPrintMargin: "Show Print Margin:",
useSoftTabs: "Use Soft Tabs:",
showInvisibles: "Show Invisibles"
@ -456,6 +470,11 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) {
80: "80",
free: "Free"
},
keybindings: {
ace: "ace",
vim: "vim",
emacs: "emacs"
},
showPrintMargin: BOOL,
useSoftTabs: BOOL,
showInvisibles: BOOL
@ -518,6 +537,7 @@ exports.options = {
gutter: "false",
fontSize: "12px",
softWrap: "off",
keybindings: "ace",
showPrintMargin: "false",
useSoftTabs: "true",
showInvisibles: "true"