Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a88e27cc7d | ||
|
|
7cab2501da | ||
|
|
dd93e62a41 | ||
|
|
d238a1998c | ||
|
|
6bbb21490c | ||
|
|
9f0fa2f815 | ||
|
|
f5fb10063c | ||
|
|
721bd272b5 | ||
|
|
c170156147 | ||
|
|
a2f6f2be03 | ||
|
|
412260392f | ||
|
|
5f8585a625 | ||
|
|
ee0d15c878 | ||
|
|
3f0b584f25 | ||
|
|
41fd20c6e4 | ||
|
|
01e9524098 | ||
|
|
d9d99c1c27 | ||
|
|
f53f5735e1 | ||
|
|
7a88a4b0e9 | ||
|
|
85733fea56 | ||
|
|
369e1f4c1e | ||
|
|
702fd24ce8 | ||
|
|
961e62207c | ||
|
|
cc950614c5 | ||
|
|
556140e7d9 | ||
|
|
987f09d880 |
@@ -0,0 +1,16 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.js]
|
||||||
|
max_line_length = 100
|
||||||
|
|
||||||
|
[*.css]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
@@ -9,3 +9,4 @@ Makefile.gyp
|
|||||||
*.node
|
*.node
|
||||||
example/*.log
|
example/*.log
|
||||||
docs/_build
|
docs/_build
|
||||||
|
npm-debug.log
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# xterm.js — xterm, in the browser
|
# xterm.js
|
||||||
|
|
||||||
Xterm.js is a full xterm clone, written completely in JavaScript.
|
Xterm.js is a full xterm clone, written in JavaScript.
|
||||||
|
|
||||||
Xterm.js supplies a modular, event-based interface that lets developers build addons and themes that augment the experience of running a fully-featured terminal inside the browser.
|
It is used at [SourceLair](https://www.sourcelair.com/home) to help people develop their applications in their browsers.
|
||||||
|
|
||||||
Xterm.js serves as foundation for the terminal found at www.sourcelair.com.
|
Xterm.js supplies a modular, event-based interface that lets developers build addons and themes on top of it.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -14,6 +14,6 @@ If you contribute code to this project, you are implicitly allowing your code to
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Copyright (c) 2014-2015, SourceLair, Private Company (www.sourcelair.com) (MIT License)
|
Copyright (c) 2014-2016, SourceLair, Private Company ([www.sourcelair.com](https://www.sourcelair.com/home)) (MIT License)
|
||||||
|
|
||||||
Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||||
|
|||||||
+2
-12
@@ -44,23 +44,13 @@
|
|||||||
|
|
||||||
subjectRow.style.display = 'inline';
|
subjectRow.style.display = 'inline';
|
||||||
subjectRow.innerHTML = 'W'; // Common character for measuring width, although on monospace
|
subjectRow.innerHTML = 'W'; // Common character for measuring width, although on monospace
|
||||||
characterWidth = parseInt(subjectRow.offsetWidth);
|
characterWidth = subjectRow.getBoundingClientRect().width;
|
||||||
subjectRow.style.display = ''; // Revert style before calculating height, since they differ.
|
subjectRow.style.display = ''; // Revert style before calculating height, since they differ.
|
||||||
characterHeight = parseInt(subjectRow.offsetHeight);
|
characterHeight = parseInt(subjectRow.offsetHeight);
|
||||||
subjectRow.innerHTML = contentBuffer;
|
subjectRow.innerHTML = contentBuffer;
|
||||||
|
|
||||||
rows = parseInt(availableHeight / characterHeight);
|
rows = parseInt(availableHeight / characterHeight);
|
||||||
/*
|
cols = parseInt(availableWidth / characterWidth) - 1;
|
||||||
* The following hack takes place in order to get "fit" work properly
|
|
||||||
* in Mozilla Firefox.
|
|
||||||
* Most probably, because of a dimension calculation bug, Firefox
|
|
||||||
* calculates the width to be 1px less than it is actually drawn on
|
|
||||||
* screen.
|
|
||||||
*/
|
|
||||||
if (navigator.userAgent.match(/Firefox/)) {
|
|
||||||
characterWidth++;
|
|
||||||
}
|
|
||||||
cols = parseInt(availableWidth / characterWidth);
|
|
||||||
|
|
||||||
geometry = {cols: cols, rows: rows};
|
geometry = {cols: cols, rows: rows};
|
||||||
return geometry;
|
return geometry;
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "xterm.js",
|
"name": "xterm.js",
|
||||||
"version": "0.31",
|
"version": "0.32",
|
||||||
"ignore": ["demo", "test", ".gitignore"]
|
"ignore": ["demo", "test", ".gitignore"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "xterm",
|
||||||
|
"version": "0.32.0",
|
||||||
|
"ignore": ["demo", "test", ".gitignore"],
|
||||||
|
"main": "src/xterm.js",
|
||||||
|
"repository": "https://github.com/sourcelair/xterm.js",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
+7
-2
@@ -52,11 +52,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.terminal .xterm-helpers {
|
.terminal .xterm-helpers {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal .xterm-helper-textarea {
|
.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;
|
opacity: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
|||||||
+12
-6
@@ -394,7 +394,6 @@
|
|||||||
this.showCursor();
|
this.showCursor();
|
||||||
this.textarea.focus();
|
this.textarea.focus();
|
||||||
|
|
||||||
this.emit('focus', {terminal: this});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Terminal.prototype.blur = function() {
|
Terminal.prototype.blur = function() {
|
||||||
@@ -404,12 +403,11 @@
|
|||||||
|
|
||||||
this.cursorState = 0;
|
this.cursorState = 0;
|
||||||
this.refresh(this.y, this.y);
|
this.refresh(this.y, this.y);
|
||||||
|
this.textarea.blur();
|
||||||
|
|
||||||
if (this.sendFocus) {
|
if (this.sendFocus) {
|
||||||
this.send('\x1b[O');
|
this.send('\x1b[O');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit('blur', {terminal: this});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -559,6 +557,12 @@
|
|||||||
this.textarea.setAttribute('autocapitalize', 'off');
|
this.textarea.setAttribute('autocapitalize', 'off');
|
||||||
this.textarea.setAttribute('spellcheck', 'false');
|
this.textarea.setAttribute('spellcheck', 'false');
|
||||||
this.textarea.tabIndex = 0;
|
this.textarea.tabIndex = 0;
|
||||||
|
this.textarea.onfocus = function() {
|
||||||
|
self.emit('focus', {terminal: self});
|
||||||
|
}
|
||||||
|
this.textarea.onblur = function() {
|
||||||
|
self.emit('blur', {terminal: self});
|
||||||
|
}
|
||||||
this.helperContainer.appendChild(this.textarea);
|
this.helperContainer.appendChild(this.textarea);
|
||||||
|
|
||||||
for (; i < this.rows; i++) {
|
for (; i < this.rows; i++) {
|
||||||
@@ -580,8 +584,10 @@
|
|||||||
this.startBlink();
|
this.startBlink();
|
||||||
|
|
||||||
on(this.element, 'mouseup', function() {
|
on(this.element, 'mouseup', function() {
|
||||||
var selection = document.getSelection();
|
var selection = document.getSelection(),
|
||||||
if (selection.type != 'Range') {
|
collapsed = selection.isCollapsed,
|
||||||
|
isRange = typeof collapsed == 'boolean' ? !collapsed : selection.type == 'Range';
|
||||||
|
if (!isRange) {
|
||||||
self.focus();
|
self.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2342,7 +2348,7 @@
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// a-z and space
|
// a-z and space
|
||||||
if (ev.ctrlKey) {
|
if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {
|
||||||
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
|
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
|
||||||
key = String.fromCharCode(ev.keyCode - 64);
|
key = String.fromCharCode(ev.keyCode - 64);
|
||||||
} else if (ev.keyCode === 32) {
|
} else if (ev.keyCode === 32) {
|
||||||
|
|||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 212 KiB |
Reference in New Issue
Block a user