mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(menu) show hot keys in menu
This commit is contained in:
parent
809ad6f05d
commit
d622f6602c
3 changed files with 19 additions and 3 deletions
9
json/menu.json
Normal file
9
json/menu.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"View" : "F3",
|
||||
"Edit" : "F4",
|
||||
"Rename" : "F2",
|
||||
"Delete" : "F8",
|
||||
"Cut" : "Ctrl+X",
|
||||
"Copy" : "Ctrl+C",
|
||||
"Paste" : "Ctrl+V"
|
||||
}
|
||||
|
|
@ -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 = [],
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue