feature(key) <shift> + <f7> - add new file

This commit is contained in:
coderaiser 2014-01-30 04:13:54 -05:00
parent b86fa21803
commit c8d7f88e37
3 changed files with 12 additions and 4 deletions

View file

@ -82,6 +82,7 @@ Hot keys
- **F5** - copy
- **F6** - rename/move
- **F7** - new dir
- **F7** + **shift** = new file
- **F8, Delete** - remove current file
- **F9** - menu
- **F10** - config

View file

@ -704,7 +704,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
*
*/
this.promptNewDir = function() {
Cmd.promptNewFile('directory', '?dir');
promptNew('directory', '?dir');
};
/**
@ -713,7 +713,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
* @pTypeName
* @pType
*/
this.promptNewFile = function(pTypeName, pType) {
this.promptNewFile = function() {
promptNew('file');
};
function promptNew(pTypeName, pType) {
var lName = Cmd.getCurrentName(),
lDir = Cmd.getCurrentDirPath(),
lMsg = 'New ' + pTypeName || 'File',
@ -726,7 +730,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (lName)
RESTful.save(lDir + lName + lType, null, CloudCmd.refresh);
};
}
/**
* zip file

View file

@ -260,7 +260,10 @@ var CloudCmd, Util, DOM;
break;
case Key.F7:
DOM.promptNewDir();
if (shift)
DOM.promptNewFile();
else
DOM.promptNewDir();
break;
case Key.F8: