adding keyboard shortcuts

This commit is contained in:
Rolux 2010-02-08 15:15:48 +05:30
parent 417c641e74
commit 273e13190a
2 changed files with 16 additions and 15 deletions

View file

@ -2458,7 +2458,7 @@ requires
$("<td>", { $("<td>", {
"class": "OxCell OxModifiers", "class": "OxCell OxModifiers",
html: $.map(self.options.keyboard.modifiers, function(modifier) { html: $.map(self.options.keyboard.modifiers, function(modifier) {
return oxui.symbol[modifier]; return oxui.symbols[modifier];
}).join("") }).join("")
}) })
) )
@ -2466,7 +2466,8 @@ requires
$("<td>", { $("<td>", {
"class": "OxCell Ox" + (self.options.items.length ? "Submenu" : "Key"), "class": "OxCell Ox" + (self.options.items.length ? "Submenu" : "Key"),
html: self.options.items.length ? oxui.symbols.triangle_right : html: self.options.items.length ? oxui.symbols.triangle_right :
oxui.symbols[self.options.keyboard.key] || self.options.keyboard.key oxui.symbols[self.options.keyboard.key] ||
self.options.keyboard.key.toUpperCase()
}) })
); );

View file

@ -74,26 +74,26 @@
id: "file", id: "file",
title: "File", title: "File",
items: [ items: [
{ id: "load", title: "Load" }, { id: "load", keyboard: "control o", title: "Open" },
{ id: "save", title: "Save" }, { id: "save", keyboard: "control a", title: "Save" },
{ id: "save_ad", title: "Save As..."} { id: "save_ad", keyboard: "shift control s", title: "Save As..."}
] ]
}, },
{ {
id: "edit", id: "edit",
title: "Edit", title: "Edit",
items: [ items: [
{ id: "undo", title: "Undo" }, { id: "undo", keyboard: "control z", title: "Undo" },
{ id: "redo", title: "Redo" }, { id: "redo", keyboard: "shift control z", title: "Redo" },
{}, {},
{ id: "cut", title: "Cut" }, { id: "cut", keyboard: "control x", title: "Cut" },
{ id: "copy", title: "Copy" }, { id: "copy", keyboard: "control c", title: "Copy" },
{ id: "paste", title: "Paste"}, { id: "paste", keyboard: "control v", title: "Paste"},
{ id: "delete", title: "Delete"}, { id: "delete", keyboard: "delete", title: "Delete"},
{}, {},
{ id: "select_all", title: "Select All" }, { id: "select_all", keyboard: "control a", title: "Select All" },
{ id: "select_none", title: "Select None" }, { id: "select_none", keyboard: "shift control a", title: "Select None" },
{ id: "invert_selection", title: "Invert Selection" }, { id: "invert_selection", keyboard: "alt control a", title: "Invert Selection" },
] ]
}, },
{ {
@ -114,7 +114,7 @@
id: "help", id: "help",
title: "Help", title: "Help",
items: [ items: [
{ id: "help", title: "Help" } { id: "help", keyboard: "control h", title: "Help" }
] ]
} }
], ],