Compare commits

..
26 Commits
Author SHA1 Message Date
Paris a88e27cc7d Bump version to 0.32 2016-02-09 14:50:34 +02:00
Paris 7cab2501da Merge branch 'master' of github.com:sourcelair/xterm.js 2016-02-09 12:49:21 +00:00
Paris dd93e62a41 Update README 2016-02-09 14:48:54 +02:00
Paris d238a1998c Update .gitignore to ingore npm logs 2016-02-09 14:42:33 +02:00
Paris Kasidiaris 6bbb21490c Merge pull request #45 from sourcelair/package-json
Package json
2016-02-06 18:41:54 +02:00
Paris 9f0fa2f815 Update package.json (name, repository, license) 2016-02-06 18:41:24 +02:00
Paris f5fb10063c Fix version 2016-01-09 19:43:56 +02:00
Paris 721bd272b5 Add package.json 2016-01-09 19:43:18 +02:00
Thanasis Daglis c170156147 Merge pull request #44 from sourcelair/issue/18
Cursor is now invisible in IE
2015-11-12 17:47:03 +02:00
TDaglis a2f6f2be03 added comment for fix
explained IE "hack" to fix textarea's blinking cursor
2015-11-12 15:05:51 +02:00
Thanasis Daglis 412260392f Merge pull request #43 from sourcelair/fix/marginal-terminal-width
Fixed marginal width geometry
2015-11-12 11:42:37 +02:00
TDaglis 5f8585a625 made cursor invisible in IE
fixes #18
2015-11-11 10:37:21 +02:00
TDaglis ee0d15c878 added *.css rules in .editorconfig for indent consistency 2015-11-11 10:36:20 +02:00
TDaglis 3f0b584f25 fixed marginal width geometry 2015-11-10 18:27:17 +02:00
Thanasis Daglis 41fd20c6e4 Merge pull request #42 from sourcelair/fix/fit-width
Fixed width of fit
2015-11-04 11:45:21 +02:00
Thanasis Daglis 01e9524098 Merge pull request #41 from sourcelair/fix/firefox-selection
Fixed selection in firefox
2015-11-04 11:45:09 +02:00
TDaglis d9d99c1c27 fixed width of fit
removed firefox hack since it is no longer needed
2015-11-03 14:55:24 +02:00
TDaglis f53f5735e1 added selection.type fallback check
for browsers that might not support Selection.isCollapsed property
2015-11-03 12:00:28 +02:00
TDaglis 7a88a4b0e9 fixed selection in firefox 2015-11-03 09:32:43 +00:00
Thanasis Daglis 85733fea56 Merge pull request #40 from sourcelair/fix/keydown-filtering
Better filtering of input
2015-10-29 18:36:19 +02:00
TDaglis 369e1f4c1e exclude alt and meta keys from ctrl default case 2015-10-29 18:34:20 +02:00
TDaglis 702fd24ce8 ignore ctrl+shift characters in keydown input 2015-10-29 18:27:46 +02:00
Thanasis Daglis 961e62207c Merge pull request #38 from sourcelair/fix/focus-events
Fix xterm focus events
2015-10-27 11:30:00 +02:00
TDaglis cc950614c5 blur textarea on terminal blur 2015-10-26 17:13:04 +02:00
TDaglis 556140e7d9 added .editorconfig 2015-10-26 17:07:34 +02:00
TDaglis 987f09d880 auto emit blur and focus of textarea 2015-10-26 15:07:15 +00:00
11 changed files with 572 additions and 546 deletions
+16
View File
@@ -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
+1
View File
@@ -9,3 +9,4 @@ Makefile.gyp
*.node
example/*.log
docs/_build
npm-debug.log
+5 -5
View File
@@ -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.
![xterm.js screenshot](xtermjs.png)
@@ -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
View File
@@ -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);
};
});
});
+1 -1
View File
@@ -7,4 +7,4 @@
width: auto;
height: auto;
z-index: 255;
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "xterm.js",
"version": "0.31",
"version": "0.32",
"ignore": ["demo", "test", ".gitignore"]
}
+1 -1
View File
@@ -23,4 +23,4 @@ h1 {
#terminal-container .terminal .terminal-cursor {
background-color: #fafafa;
}
}
+8
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+15 -9
View File
@@ -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
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 212 KiB