docs, prune
This commit is contained in:
+2
-6
@@ -21,15 +21,11 @@ app.get('/main.js', function(req, res){
|
|||||||
res.sendFile(__dirname + '/main.js');
|
res.sendFile(__dirname + '/main.js');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/zmodemjs/*.js', function(req, res){
|
|
||||||
res.sendFile(__dirname + req.url);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/js/*.js', function(req, res){
|
app.get('/js/*.js', function(req, res){
|
||||||
res.sendFile(__dirname + req.url);
|
res.sendFile(__dirname + req.url);
|
||||||
});
|
});
|
||||||
|
|
||||||
var shell_args = {
|
const SHELL_ARGS = {
|
||||||
bash: ['--login'],
|
bash: ['--login'],
|
||||||
'cmd.exe': [],
|
'cmd.exe': [],
|
||||||
};
|
};
|
||||||
@@ -39,7 +35,7 @@ var shell_name = process.platform === 'win32' ? 'cmd.exe' : 'bash';
|
|||||||
app.post('/terminals', function (req, res) {
|
app.post('/terminals', function (req, res) {
|
||||||
var cols = parseInt(req.query.cols),
|
var cols = parseInt(req.query.cols),
|
||||||
rows = parseInt(req.query.rows),
|
rows = parseInt(req.query.rows),
|
||||||
term = pty.spawn(shell_name, shell_args[shell_name], {
|
term = pty.spawn(shell_name, SHELL_ARGS[shell_name], {
|
||||||
encoding: null,
|
encoding: null,
|
||||||
name: 'xterm-color',
|
name: 'xterm-color',
|
||||||
cols: cols || 80,
|
cols: cols || 80,
|
||||||
|
|||||||
@@ -1,6 +1,25 @@
|
|||||||
//Eventually?
|
/**
|
||||||
//import { Zmodem } from './zmodemjs/dist/zmodem';
|
*
|
||||||
|
* Allow xterm.js to handle ZMODEM uploads and downloads.
|
||||||
|
*
|
||||||
|
* This addon is a wrapper around zmodem.js. It adds the following:
|
||||||
|
*
|
||||||
|
* - function `zmodemAttach(<WebSocket>)` - creates a Zmodem.Sentry
|
||||||
|
* on the passed WebSocket object.
|
||||||
|
*
|
||||||
|
* - event `zmodemDetect` - fired on Zmodem.Sentry’s `on_detect` callback.
|
||||||
|
* Passes the zmodem.js Detection object.
|
||||||
|
*
|
||||||
|
* - event `zmodemRetract` - fired on Zmodem.Sentry’s `on_retract` callback.
|
||||||
|
*
|
||||||
|
* You’ll need to provide logic to handle uploads and downloads.
|
||||||
|
* See zmodem.js’s documentation for more details.
|
||||||
|
*
|
||||||
|
* **IMPORTANT:** After you confirm() a zmodem.js Detection, if you have
|
||||||
|
* used the `attach` or `turbinado` addons, you’ll need to suspend their
|
||||||
|
* operation for the duration of the ZMODEM session. (The demo does this
|
||||||
|
* via `detach()` and a re-`attach()`.)
|
||||||
|
*/
|
||||||
(function (addon) {
|
(function (addon) {
|
||||||
if (typeof exports === 'object' && typeof module === 'object') {
|
if (typeof exports === 'object' && typeof module === 'object') {
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user