From 92ab6f6b48414fa5cb4199a7f5ef1d6e45fba289 Mon Sep 17 00:00:00 2001 From: Rolux Date: Mon, 8 Feb 2010 15:15:48 +0530 Subject: [PATCH] adding keyboard shortcuts --- build/js/ox.ui.js | 5 +++-- demos/test/index.html | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 4850f12..61eaae5 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -2458,7 +2458,7 @@ requires $("", { "class": "OxCell OxModifiers", html: $.map(self.options.keyboard.modifiers, function(modifier) { - return oxui.symbol[modifier]; + return oxui.symbols[modifier]; }).join("") }) ) @@ -2466,7 +2466,8 @@ requires $("", { "class": "OxCell Ox" + (self.options.items.length ? "Submenu" : "Key"), 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() }) ); diff --git a/demos/test/index.html b/demos/test/index.html index 1fe04c4..ef395b6 100644 --- a/demos/test/index.html +++ b/demos/test/index.html @@ -74,26 +74,26 @@ id: "file", title: "File", items: [ - { id: "load", title: "Load" }, - { id: "save", title: "Save" }, - { id: "save_ad", title: "Save As..."} + { id: "load", keyboard: "control o", title: "Open" }, + { id: "save", keyboard: "control a", title: "Save" }, + { id: "save_ad", keyboard: "shift control s", title: "Save As..."} ] }, { id: "edit", title: "Edit", items: [ - { id: "undo", title: "Undo" }, - { id: "redo", title: "Redo" }, + { id: "undo", keyboard: "control z", title: "Undo" }, + { id: "redo", keyboard: "shift control z", title: "Redo" }, {}, - { id: "cut", title: "Cut" }, - { id: "copy", title: "Copy" }, - { id: "paste", title: "Paste"}, - { id: "delete", title: "Delete"}, + { id: "cut", keyboard: "control x", title: "Cut" }, + { id: "copy", keyboard: "control c", title: "Copy" }, + { id: "paste", keyboard: "control v", title: "Paste"}, + { id: "delete", keyboard: "delete", title: "Delete"}, {}, - { id: "select_all", title: "Select All" }, - { id: "select_none", title: "Select None" }, - { id: "invert_selection", title: "Invert Selection" }, + { id: "select_all", keyboard: "control a", title: "Select All" }, + { id: "select_none", keyboard: "shift control a", title: "Select None" }, + { id: "invert_selection", keyboard: "alt control a", title: "Invert Selection" }, ] }, { @@ -114,7 +114,7 @@ id: "help", title: "Help", items: [ - { id: "help", title: "Help" } + { id: "help", keyboard: "control h", title: "Help" } ] } ],