Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Issue 7 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions 18 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ In the below `C-x` refers to the `Ctrl-x` keystroke, while `M-x` refers to the `
<dd>refresh line (clear screen in shell)</dd>
<dt><code>Tab</code></dt>
<dd>Invoke completion handler for text under cursor</dd>
<dt><code>C-c</code> or <code>Esc</code></dt>
<dd>Deactivate Readline (closes the shell)</dd>
<dt><code>~</code></dt>
<dd>Activate Readline (opens the shell)</dd>
<dt><code>Esc</code> in reverse search</dt>
<dd>Cancel search</dd>
<dt><code>C-c</code></dt>
<dd>call <code>onCancel</code> handler</dd>
<dt><code>C-d</code> on empty line</dt>
<dd>call <code>onCancel</code> handler</dd>
</dl>

### shell.js
Expand All @@ -123,8 +125,14 @@ By implementing the functions `getNode` and `getChildNodes`, this library adds p

## Changelog

**0.2.6** --
* Removed Activation/Deactivation keybindings from Readline, making it an outside concern (see: [Issue 2](https://github.com/sdether/josh.js/issues/2 )
* Fixed Backspace regression introduced by 0.2.5
* Fixed `M-d` not deleting last character of line
* Example shell can now be resized (via jquery-ui.resizable)

**0.2.5** -- 2013/01/14
* Implemented missing Readline behavior (see: [Issue 1](https://github.com/sdether/josh.js/issues/1)
* Implemented missing Readline behavior (see: [Issue 1](https://github.com/sdether/josh.js/issues/1 )
* Added scrollbar to sample implemenation (also adds scrollwheel support)

**0.2.4** -- 2013/01/14
Expand Down
6 changes: 5 additions & 1 deletion 6 index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Shell testbed</title>

<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script>Josh = {Debug: true };</script>
<script src="js/history.js"></script>
Expand Down Expand Up @@ -41,5 +44,6 @@
<div>
<p>Press <strong>~</strong> to activate console.</p>
</div>

</body>
</html>
35 changes: 24 additions & 11 deletions 35 js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,37 @@
};

$(document).ready(function() {
var consolePanel = $('#shell-panel');

$(document).keypress(function(event) {
if(shell.isActive()) {
return;
}
_console.log("activating shell");
if(event.keyCode == 126) {
event.preventDefault();
shell.activate();
showConsole();
}
});
var $consolePanel = $('#shell-panel');
$consolePanel.resizable({ handles: "s"});
function showConsole() {
consolePanel.slideDown();
consolePanel.focus();
$consolePanel.slideDown();
$consolePanel.focus();
}

function hideConsole() {
consolePanel.slideUp();
consolePanel.blur();
$consolePanel.slideUp();
$consolePanel.blur();
}

shell.onActivate(function() {
showConsole();
});
shell.onDeactivate(function() {
function hideAndDeactivate() {
_console.log("deactivating shell")
shell.deactivate();
hideConsole();
});
}

shell.onEOT(hideAndDeactivate);
shell.onCancel(hideAndDeactivate);
});
Josh.Instance = {
Tree: root,
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.