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
|
||||
example/*.log
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
+4
-14
@@ -20,7 +20,7 @@
|
||||
} else {
|
||||
/*
|
||||
* Plain browser environment
|
||||
*/
|
||||
*/
|
||||
fit(this.Xterm);
|
||||
}
|
||||
})(function (Xterm) {
|
||||
@@ -44,23 +44,13 @@
|
||||
|
||||
subjectRow.style.display = 'inline';
|
||||
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.
|
||||
characterHeight = parseInt(subjectRow.offsetHeight);
|
||||
subjectRow.innerHTML = contentBuffer;
|
||||
|
||||
rows = parseInt(availableHeight / characterHeight);
|
||||
/*
|
||||
* 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);
|
||||
cols = parseInt(availableWidth / characterWidth) - 1;
|
||||
|
||||
geometry = {cols: cols, rows: rows};
|
||||
return geometry;
|
||||
@@ -71,4 +61,4 @@
|
||||
|
||||
this.resize(geometry.cols, geometry.rows);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: 255;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "xterm.js",
|
||||
"version": "0.31",
|
||||
"version": "0.32",
|
||||
"ignore": ["demo", "test", ".gitignore"]
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,4 +23,4 @@ h1 {
|
||||
|
||||
#terminal-container .terminal .terminal-cursor {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
+520
-515
File diff suppressed because it is too large
Load Diff
+15
-9
@@ -40,7 +40,7 @@
|
||||
} else {
|
||||
/*
|
||||
* Plain browser environment
|
||||
*/
|
||||
*/
|
||||
this.Xterm = xterm.call(this);
|
||||
this.Terminal = this.Xterm; /* Backwards compatibility with term.js */
|
||||
}
|
||||
@@ -394,7 +394,6 @@
|
||||
this.showCursor();
|
||||
this.textarea.focus();
|
||||
|
||||
this.emit('focus', {terminal: this});
|
||||
};
|
||||
|
||||
Terminal.prototype.blur = function() {
|
||||
@@ -404,12 +403,11 @@
|
||||
|
||||
this.cursorState = 0;
|
||||
this.refresh(this.y, this.y);
|
||||
this.textarea.blur();
|
||||
|
||||
if (this.sendFocus) {
|
||||
this.send('\x1b[O');
|
||||
}
|
||||
|
||||
this.emit('blur', {terminal: this});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -559,6 +557,12 @@
|
||||
this.textarea.setAttribute('autocapitalize', 'off');
|
||||
this.textarea.setAttribute('spellcheck', 'false');
|
||||
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);
|
||||
|
||||
for (; i < this.rows; i++) {
|
||||
@@ -580,8 +584,10 @@
|
||||
this.startBlink();
|
||||
|
||||
on(this.element, 'mouseup', function() {
|
||||
var selection = document.getSelection();
|
||||
if (selection.type != 'Range') {
|
||||
var selection = document.getSelection(),
|
||||
collapsed = selection.isCollapsed,
|
||||
isRange = typeof collapsed == 'boolean' ? !collapsed : selection.type == 'Range';
|
||||
if (!isRange) {
|
||||
self.focus();
|
||||
}
|
||||
});
|
||||
@@ -2342,7 +2348,7 @@
|
||||
break;
|
||||
default:
|
||||
// a-z and space
|
||||
if (ev.ctrlKey) {
|
||||
if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {
|
||||
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
|
||||
key = String.fromCharCode(ev.keyCode - 64);
|
||||
} else if (ev.keyCode === 32) {
|
||||
@@ -2379,7 +2385,7 @@
|
||||
|
||||
this.emit('keydown', ev);
|
||||
this.emit('key', key, ev);
|
||||
this.showCursor();
|
||||
this.showCursor();
|
||||
this.handler(key);
|
||||
|
||||
return this.cancel(ev);
|
||||
@@ -4784,4 +4790,4 @@
|
||||
Terminal.cancel = cancel;
|
||||
|
||||
return Terminal;
|
||||
});
|
||||
});
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 212 KiB |
Reference in New Issue
Block a user