Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 18b446c

Browse files
committed
Merge pull request #48 from woshilaiceshide/master
add the shortcut "ctrl+l" to clear the entire screen, and expose the "clearScreen" function.
2 parents 4dc0a68 + 3d405bf commit 18b446c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

jquery.console.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@
8585
70: moveForward,
8686
// C-k
8787
75: deleteUntilEnd,
88+
// C-l
89+
76: clearScreen,
8890
// C-u
89-
85 : clearCurrentPrompt
91+
85: clearCurrentPrompt
9092
};
9193
if(config.ctrlCodes) {
9294
$.extend(ctrlCodes, config.ctrlCodes);
@@ -164,6 +166,7 @@
164166
extern.scrollToBottom = scrollToBottom;
165167
extern.report = report;
166168
extern.showCompletion = showCompletion;
169+
extern.clearScreen = clearScreen;
167170
})();
168171

169172
////////////////////////////////////////////////////////////////////////
@@ -427,6 +430,13 @@
427430
function clearCurrentPrompt() {
428431
extern.promptText("");
429432
};
433+
434+
function clearScreen() {
435+
inner.children(".jquery-console-prompt-box, .jquery-console-message").remove();
436+
extern.report(" ");
437+
extern.promptText("");
438+
extern.focus();
439+
};
430440

431441
function deleteNextWord() {
432442
// A word is defined within this context as a series of alphanumeric

0 commit comments

Comments
 (0)