mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(console) add clear with Ctrl + l
This commit is contained in:
parent
848dac0df1
commit
4730a2056e
2 changed files with 24 additions and 10 deletions
1
HELP.md
1
HELP.md
|
|
@ -155,6 +155,7 @@ Console
|
|||
| `~` | open
|
||||
| `Ctrl + p` | paste path of current directory
|
||||
| `Ctrl + z` | cancel current prompt
|
||||
| `Ctrl + l` | clear
|
||||
| `Esc` | close
|
||||
|
||||
Config
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
|
||||
this.show = show;
|
||||
this.clear = clear;
|
||||
|
||||
// Handle a command.
|
||||
function handler(command) {
|
||||
|
|
@ -66,16 +67,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
|
||||
jqconsole = $(Element).jqconsole('', '> ');
|
||||
|
||||
jqconsole.RegisterShortcut('Z', function() {
|
||||
jqconsole.SetPromptText('');
|
||||
});
|
||||
|
||||
jqconsole.RegisterShortcut('P', function() {
|
||||
var command = jqconsole.GetPromptText();
|
||||
|
||||
command += DOM.getCurrentDirPath();
|
||||
jqconsole.SetPromptText(command);
|
||||
});
|
||||
addShortCuts(jqconsole);
|
||||
}
|
||||
|
||||
CloudCmd.View.show(Element, {
|
||||
|
|
@ -131,6 +123,27 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
}
|
||||
}
|
||||
|
||||
function addShortCuts(jqconsole) {
|
||||
jqconsole.RegisterShortcut('Z', function() {
|
||||
jqconsole.SetPromptText('');
|
||||
});
|
||||
|
||||
jqconsole.RegisterShortcut('L', clear);
|
||||
|
||||
jqconsole.RegisterShortcut('P', function() {
|
||||
var command = jqconsole.GetPromptText();
|
||||
|
||||
command += DOM.getCurrentDirPath();
|
||||
jqconsole.SetPromptText(command);
|
||||
});
|
||||
}
|
||||
|
||||
function clear() {
|
||||
jqconsole.Reset();
|
||||
addShortCuts(jqconsole);
|
||||
jqconsole.Prompt(true, handler);
|
||||
}
|
||||
|
||||
function load(callback) {
|
||||
var dir = CloudCmd.LIBDIRCLIENT + 'console/',
|
||||
jsPath = dir + 'lib/',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue