Merge pull request #78 from sourcelair/drop-hidden-textarea

Drop hidden textarea for input handling
This commit is contained in:
Paris Kasidiaris
2016-06-07 09:36:44 +03:00
5 changed files with 149 additions and 522 deletions
+1
View File
@@ -0,0 +1 @@
web: ./bin/server
Executable
+4
View File
@@ -0,0 +1,4 @@
#! /usr/bin/env sh
# Development server for xterm.js
browser-sync start --server --port 8000 --files="**" --no-ui --index index.html --directory
+8 -2
View File
@@ -1,6 +1,6 @@
var terminalContainer = document.getElementById('terminal-container'),
term = new Terminal(),
shellprompt = '> ';
shellprompt = '$ ';
term.open(terminalContainer);
term.fit();
@@ -15,7 +15,9 @@ term.writeln('');
term.prompt();
term.on('key', function (key, ev) {
var printable = (!ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.metaKey);
var printable = (
!ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.metaKey
);
if (ev.keyCode == 13) {
term.prompt();
@@ -30,3 +32,7 @@ term.on('key', function (key, ev) {
term.write(key);
}
});
term.on('paste', function (data, ev) {
term.write(data);
});
+1 -18
View File
@@ -51,23 +51,6 @@
color: #000;
}
.terminal .xterm-helpers {
position: absolute;
top: 0;
}
.terminal .xterm-helper-textarea {
/*
* HACK: to fix IE's blinking cursor
* Move textarea out of the screen to the far left, so that the cursor is not visible.
*/
text-indent: -9999em;
opacity: 0;
width: 0;
height: 0;
z-index: -10;
}
/*
* Determine default colors for xterm.js
*/
@@ -2140,7 +2123,7 @@
* in order to allow child elements to adjust.
*/
.terminal .xterm-rows > div {
line-height: 1.2;
line-height: 1.3;
}
/**
+135 -502
View File
File diff suppressed because it is too large Load Diff