File tree Expand file tree Collapse file tree 5 files changed +145
-171
lines changed
Filter options
Expand file tree Collapse file tree 5 files changed +145
-171
lines changed
Original file line number Diff line number Diff line change @@ -94,10 +94,12 @@ In the below `C-x` refers to the `Ctrl-x` keystroke, while `M-x` refers to the `
94
94
<dd >refresh line (clear screen in shell)</dd >
95
95
<dt ><code >Tab</code ></dt >
96
96
<dd >Invoke completion handler for text under cursor</dd >
97
- <dt ><code >C-c</code > or <code >Esc</code ></dt >
98
- <dd >Deactivate Readline (closes the shell)</dd >
99
- <dt ><code >~</code ></dt >
100
- <dd >Activate Readline (opens the shell)</dd >
97
+ <dt ><code >Esc</code > in reverse search</dt >
98
+ <dd >Cancel search</dd >
99
+ <dt ><code >C-c</code ></dt >
100
+ <dd >call <code >onCancel</code > handler</dd >
101
+ <dt ><code >C-d</code > on empty line</dt >
102
+ <dd >call <code >onCancel</code > handler</dd >
101
103
</dl >
102
104
103
105
### shell.js
@@ -123,8 +125,14 @@ By implementing the functions `getNode` and `getChildNodes`, this library adds p
123
125
124
126
## Changelog
125
127
128
+ ** 0.2.6** --
129
+ * Removed Activation/Deactivation keybindings from Readline, making it an outside concern (see: [ Issue 2] ( https://github.com/sdether/josh.js/issues/2 )
130
+ * Fixed Backspace regression introduced by 0.2.5
131
+ * Fixed ` M-d ` not deleting last character of line
132
+ * Example shell can now be resized (via jquery-ui.resizable)
133
+
126
134
** 0.2.5** -- 2013/01/14
127
- * Implemented missing Readline behavior (see: [ Issue 1] ( https://github.com/sdether/josh.js/issues/1 )
135
+ * Implemented missing Readline behavior (see: [ Issue 1] ( https://github.com/sdether/josh.js/issues/1 )
128
136
* Added scrollbar to sample implemenation (also adds scrollwheel support)
129
137
130
138
** 0.2.4** -- 2013/01/14
Original file line number Diff line number Diff line change
1
+ <!doctype html>
1
2
< html >
2
3
< head >
3
4
< meta charset ="utf-8 ">
4
5
< meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 ">
5
6
< title > Shell testbed</ title >
6
7
7
8
< link href ='http://fonts.googleapis.com/css?family=Source+Code+Pro ' rel ='stylesheet ' type ='text/css '>
8
- < script src ="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js "> </ script >
9
+ < link rel ="stylesheet " href ="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css ">
10
+ < script src ="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js "> </ script >
11
+ < script src ="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js "> </ script >
9
12
< script src ="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js "> </ script >
10
13
< script > Josh = { Debug : true } ; </ script >
11
14
< script src ="js/history.js "> </ script >
41
44
< div >
42
45
< p > Press < strong > ~</ strong > to activate console.</ p >
43
46
</ div >
47
+
44
48
</ body >
45
49
</ html >
Original file line number Diff line number Diff line change 166
166
} ;
167
167
168
168
$ ( document ) . ready ( function ( ) {
169
- var consolePanel = $ ( '#shell-panel' ) ;
170
-
169
+ $ ( document ) . keypress ( function ( event ) {
170
+ if ( shell . isActive ( ) ) {
171
+ return ;
172
+ }
173
+ _console . log ( "activating shell" ) ;
174
+ if ( event . keyCode == 126 ) {
175
+ event . preventDefault ( ) ;
176
+ shell . activate ( ) ;
177
+ showConsole ( ) ;
178
+ }
179
+ } ) ;
180
+ var $consolePanel = $ ( '#shell-panel' ) ;
181
+ $consolePanel . resizable ( { handles : "s" } ) ;
171
182
function showConsole ( ) {
172
- consolePanel . slideDown ( ) ;
173
- consolePanel . focus ( ) ;
183
+ $ consolePanel. slideDown ( ) ;
184
+ $ consolePanel. focus ( ) ;
174
185
}
175
186
176
187
function hideConsole ( ) {
177
- consolePanel . slideUp ( ) ;
178
- consolePanel . blur ( ) ;
188
+ $ consolePanel. slideUp ( ) ;
189
+ $ consolePanel. blur ( ) ;
179
190
}
180
191
181
- shell . onActivate ( function ( ) {
182
- showConsole ( ) ;
183
- } ) ;
184
- shell . onDeactivate ( function ( ) {
192
+ function hideAndDeactivate ( ) {
193
+ _console . log ( "deactivating shell" )
194
+ shell . deactivate ( ) ;
185
195
hideConsole ( ) ;
186
- } ) ;
196
+ }
197
+
198
+ shell . onEOT ( hideAndDeactivate ) ;
199
+ shell . onCancel ( hideAndDeactivate ) ;
187
200
} ) ;
188
201
Josh . Instance = {
189
202
Tree : root ,
You can’t perform that action at this time.
0 commit comments