diff --git a/json/menu.json b/json/menu.json new file mode 100644 index 00000000..19986e53 --- /dev/null +++ b/json/menu.json @@ -0,0 +1,9 @@ +{ + "View" : "F3", + "Edit" : "F4", + "Rename" : "F2", + "Delete" : "F8", + "Cut" : "Ctrl+X", + "Copy" : "Ctrl+C", + "Paste" : "Ctrl+V" +} diff --git a/lib/client/files.js b/lib/client/files.js index efeec932..3f5da0c5 100644 --- a/lib/client/files.js +++ b/lib/client/files.js @@ -13,7 +13,7 @@ var Util, DOM, CloudCmd; var Promises = {}, Storage = DOM.Storage, Files = this, - FILES_JSON = 'config|modules|ext|edit', + FILES_JSON = 'config|modules|ext|edit|menu', FILES_HTML = 'file|path|link|pathLink|media', FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload', funcs = [], diff --git a/lib/client/menu.js b/lib/client/menu.js index 3d69a73a..d0f0188b 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -8,11 +8,13 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; function MenuProto(position) { var Buffer = DOM.Buffer, Info = DOM.CurrentInfo, + Files = DOM.Files, Loading = true, Key = CloudCmd.Key, Events = DOM.Events, Menu = this, Images = DOM.Images, + MenuKeys = {}, MenuShowedName, MenuContext, MenuContextFile, @@ -51,7 +53,11 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; if (error) DOM.Dialog.alert(error); else - showFunc(); + Files.get('menu', function(error, menu) { + Util.log(error); + MenuKeys = menu; + showFunc(); + }); }); }); }; @@ -109,7 +115,8 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; beforeClose : Key.setBind, beforeShow : Util.exec.with(beforeShow, func), beforeClick : beforeClick, - name : name + name : name, + keys : MenuKeys }; return options;