Change app name apps => terrminal

This commit is contained in:
ibuler
2016-10-17 15:24:41 +08:00
parent 4531157c72
commit 303659cb0e
24 changed files with 100 additions and 78 deletions

View File

@@ -588,7 +588,7 @@ Terminal.bindKeys = function(document) {
}, true);
// If we click somewhere other than a
// apps, unfocus the apps.
// terminal, unfocus the terminal.
on(document, 'mousedown', function(ev) {
if (!Terminal.focus) return;
@@ -742,7 +742,7 @@ Terminal.insertStyle = function(document, bg, fg) {
// textContent doesn't work well with IE for <style> elements.
style.innerHTML = ''
+ '.apps {\n'
+ '.terminal {\n'
+ ' float: left;\n'
+ ' border: ' + bg + ' solid 5px;\n'
+ ' font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;\n'
@@ -751,7 +751,7 @@ Terminal.insertStyle = function(document, bg, fg) {
+ ' background: ' + bg + ';\n'
+ '}\n'
+ '\n'
+ '.apps-cursor {\n'
+ '.terminal-cursor {\n'
+ ' color: ' + bg + ';\n'
+ ' background: ' + fg + ';\n'
+ '}\n';
@@ -802,7 +802,7 @@ Terminal.prototype.open = function(parent) {
this.isMSIE = !!~this.context.navigator.userAgent.indexOf('MSIE');
}
// Create our main apps element.
// Create our main terminal element.
this.element = this.document.createElement('div');
this.element.className = 'terminal';
this.element.style.outline = 'none';
@@ -811,7 +811,7 @@ Terminal.prototype.open = function(parent) {
this.element.style.backgroundColor = this.colors[256];
this.element.style.color = this.colors[257];
// Create the lines for our apps.
// Create the lines for our terminal.
this.children = [];
for (; i < this.rows; i++) {
div = this.document.createElement('div');
@@ -1020,7 +1020,7 @@ Terminal.prototype.open = function(parent) {
if (!('useMouse' in this.options) || this.options.useMouse) {
// Listen for mouse events and translate
// them into apps mouse protocols.
// them into terminal mouse protocols.
this.bindMouse();
}
@@ -1549,7 +1549,7 @@ Terminal.prototype.refresh = function(start, end) {
}
if (data !== this.defAttr) {
if (data === -1) {
out += '<span class="reverse-video apps-cursor">';
out += '<span class="reverse-video terminal-cursor">';
} else {
out += '<span style="';
@@ -1660,7 +1660,7 @@ Terminal.prototype.refresh = function(start, end) {
}
if (this._textarea) {
var cursorElement = this.element.querySelector('.apps-cursor');
var cursorElement = this.element.querySelector('.terminal-cursor');
if(cursorElement){
var cursor_x = cursorElement.offsetLeft;
var cursor_y = cursorElement.offsetTop;
@@ -2474,7 +2474,7 @@ Terminal.prototype.write = function(data) {
// break;
// CSI > Ps p Set pointer mode.
// CSI ! p Soft apps reset (DECSTR).
// CSI ! p Soft terminal reset (DECSTR).
// CSI Ps$ p
// Request ANSI mode (DECRQM).
// CSI ? Ps$ p
@@ -3959,7 +3959,7 @@ Terminal.prototype.HPositionRelative = function(params) {
};
// CSI Ps c Send Device Attributes (Primary DA).
// Ps = 0 or omitted -> request attributes from apps. The
// Ps = 0 or omitted -> request attributes from terminal. The
// response depends on the decTerminalID resource setting.
// -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')
// -> CSI ? 1 ; 0 c (``VT101 with No Options'')
@@ -3967,7 +3967,7 @@ Terminal.prototype.HPositionRelative = function(params) {
// -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')
// The VT100-style response parameters do not mean anything by
// themselves. VT220 parameters do, telling the host what fea-
// tures the apps supports:
// tures the terminal supports:
// Ps = 1 -> 132-columns.
// Ps = 2 -> Printer.
// Ps = 6 -> Selective erase.
@@ -3978,12 +3978,12 @@ Terminal.prototype.HPositionRelative = function(params) {
// Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).
// CSI > Ps c
// Send Device Attributes (Secondary DA).
// Ps = 0 or omitted -> request the apps's identification
// Ps = 0 or omitted -> request the terminal's identification
// code. The response depends on the decTerminalID resource set-
// ting. It should apply only to VT220 and up, but xterm extends
// this to VT100.
// -> CSI > Pp ; Pv ; Pc c
// where Pp denotes the apps type
// where Pp denotes the terminal type
// Pp = 0 -> ``VT100''.
// Pp = 1 -> ``VT220''.
// and Pv is the firmware version (for xterm, this was originally
@@ -3992,7 +3992,7 @@ Terminal.prototype.HPositionRelative = function(params) {
// always zero.
// More information:
// xterm/charproc.c - line 2012, for more information.
// vim responds with ^[[?0c or ^[[?1c after the apps's response (?)
// vim responds with ^[[?0c or ^[[?1c after the terminal's response (?)
Terminal.prototype.sendDeviceAttributes = function(params) {
if (params[0] > 0) return;
@@ -4217,19 +4217,19 @@ Terminal.prototype.setMode = function(params) {
// focusout: ^[[O
this.sendFocus = true;
break;
case 1005: // utf8 apps mode mouse
case 1005: // utf8 terminal mode mouse
this.utfMouse = true;
// for wide terminals
// simply encodes large values as utf8 characters
break;
case 1006: // sgr apps mode mouse
case 1006: // sgr terminal mode mouse
this.sgrMouse = true;
// for wide terminals
// does not add 32 to fields
// press: ^[[<b;x;yM
// release: ^[[<b;x;ym
break;
case 1015: // urxvt apps mode mouse
case 1015: // urxvt terminal mode mouse
this.urxvtMouse = true;
// for wide terminals
// numbers for fields
@@ -4406,13 +4406,13 @@ Terminal.prototype.resetMode = function(params) {
case 1004: // send focusin/focusout events
this.sendFocus = false;
break;
case 1005: // utf8 apps mode mouse
case 1005: // utf8 terminal mode mouse
this.utfMouse = false;
break;
case 1006: // sgr apps mode mouse
case 1006: // sgr terminal mode mouse
this.sgrMouse = false;
break;
case 1015: // urxvt apps mode mouse
case 1015: // urxvt terminal mode mouse
this.urxvtMouse = false;
break;
case 25: // hide cursor
@@ -4622,7 +4622,7 @@ Terminal.prototype.setPointerMode = function(params) {
;
};
// CSI ! p Soft apps reset (DECSTR).
// CSI ! p Soft terminal reset (DECSTR).
// http://vt100.net/docs/vt220-rm/table4-10.html
Terminal.prototype.softReset = function(params) {
this.cursorHidden = false;
@@ -4870,7 +4870,7 @@ Terminal.prototype.enableFilterRectangle = function(params) {
// CSI Ps x Request Terminal Parameters (DECREQTPARM).
// if Ps is a "0" (default) or "1", and xterm is emulating VT100,
// the control sequence elicits a response of the same form whose
// parameters describe the apps:
// parameters describe the terminal:
// Ps -> the given Ps incremented by 2.
// Pn = 1 <- no parity.
// Pn = 1 <- eight bits.
@@ -6030,7 +6030,7 @@ Terminal.charsets = {};
// DEC Special Character and Line Drawing Set.
// http://vt100.net/docs/vt102-ug/table5-13.html
// A lot of curses apps use this if they see TERM=xterm.
// A lot of curses terminal use this if they see TERM=xterm.
// testing: echo -e '\e(0a\e(B'
// The xterm output sometimes seems to conflict with the
// reference above. xterm seems in line with the reference
@@ -6113,7 +6113,7 @@ function inherits(child, parent) {
}
// if bold is broken, we can't
// use it in the apps.
// use it in the terminal.
function isBoldBroken(document) {
var body = document.getElementsByTagName('body')[0];
var terminal = document.createElement('div');