Fix all leading whitespaces (eliminate tabs)
This commit is contained in:
+82
-82
@@ -492,8 +492,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all selected text, inside the terminal.
|
* Clears all selected text, inside the terminal.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.clearSelection = function() {
|
Terminal.prototype.clearSelection = function() {
|
||||||
var selectionBaseNode = window.getSelection().baseNode;
|
var selectionBaseNode = window.getSelection().baseNode;
|
||||||
|
|
||||||
@@ -503,10 +503,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function temporarily enables (leases) the contentEditable value of the terminal, which
|
* This function temporarily enables (leases) the contentEditable value of the terminal, which
|
||||||
* should be set back to false within 5 seconds at most.
|
* should be set back to false within 5 seconds at most.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.leaseContentEditable = function (ms, callback) {
|
Terminal.prototype.leaseContentEditable = function (ms, callback) {
|
||||||
var term = this;
|
var term = this;
|
||||||
|
|
||||||
term.element.contentEditable = true;
|
term.element.contentEditable = true;
|
||||||
@@ -608,7 +608,7 @@
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
Terminal.prepareCopiedTextForClipboard = function (text) {
|
Terminal.prepareCopiedTextForClipboard = function (text) {
|
||||||
var space = String.fromCharCode(32),
|
var space = String.fromCharCode(32),
|
||||||
nonBreakingSpace = String.fromCharCode(160),
|
nonBreakingSpace = String.fromCharCode(160),
|
||||||
allNonBreakingSpaces = new RegExp(nonBreakingSpace, 'g'),
|
allNonBreakingSpaces = new RegExp(nonBreakingSpace, 'g'),
|
||||||
@@ -640,11 +640,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel the cut event completely.
|
* Cancel the cut event completely.
|
||||||
* @param {Xterm} term The terminal on which to bind the cut event handling functionality.
|
* @param {Xterm} term The terminal on which to bind the cut event handling functionality.
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
Terminal.bindCut = function(term) {
|
Terminal.bindCut = function(term) {
|
||||||
on(term.element, 'cut', function (ev) {
|
on(term.element, 'cut', function (ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
});
|
});
|
||||||
@@ -654,9 +654,9 @@
|
|||||||
/**
|
/**
|
||||||
* Do not perform the "drop" event. Altering the contents of the
|
* Do not perform the "drop" event. Altering the contents of the
|
||||||
* terminal with drag n drop is unwanted behavior.
|
* terminal with drag n drop is unwanted behavior.
|
||||||
* @param {Xterm} term The terminal on which to bind the drop event handling functionality.
|
* @param {Xterm} term The terminal on which to bind the drop event handling functionality.
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
Terminal.bindDrop = function (term) {
|
Terminal.bindDrop = function (term) {
|
||||||
on(term.element, 'drop', function (ev) {
|
on(term.element, 'drop', function (ev) {
|
||||||
term.cancel(ev, true);
|
term.cancel(ev, true);
|
||||||
@@ -665,9 +665,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel click handling on the given terminal
|
* Cancel click handling on the given terminal
|
||||||
* @param {Xterm} term The terminal on which to bind the click event handling functionality.
|
* @param {Xterm} term The terminal on which to bind the click event handling functionality.
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
Terminal.click = function (term) {
|
Terminal.click = function (term) {
|
||||||
on(term.element, 'click', function (ev) {
|
on(term.element, 'click', function (ev) {
|
||||||
term.cancel(ev, true);
|
term.cancel(ev, true);
|
||||||
@@ -1401,8 +1401,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the cursor element
|
* Display the cursor element
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.showCursor = function() {
|
Terminal.prototype.showCursor = function() {
|
||||||
if (!this.cursorState) {
|
if (!this.cursorState) {
|
||||||
this.cursorState = 1;
|
this.cursorState = 1;
|
||||||
@@ -1411,8 +1411,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scroll the terminal
|
* Scroll the terminal
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.scroll = function() {
|
Terminal.prototype.scroll = function() {
|
||||||
var row;
|
var row;
|
||||||
|
|
||||||
@@ -1454,9 +1454,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scroll the display of the terminal
|
* Scroll the display of the terminal
|
||||||
* @param {number} disp The number of lines to scroll down (negatives scroll up).
|
* @param {number} disp The number of lines to scroll down (negatives scroll up).
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.scrollDisp = function(disp) {
|
Terminal.prototype.scrollDisp = function(disp) {
|
||||||
this.ydisp += disp;
|
this.ydisp += disp;
|
||||||
|
|
||||||
@@ -2529,7 +2529,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a keydown event
|
* Handle a keydown event
|
||||||
* Key Resources:
|
* Key Resources:
|
||||||
* - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent
|
* - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent
|
||||||
* @param {KeyboardEvent} ev The keydown event to be handled.
|
* @param {KeyboardEvent} ev The keydown event to be handled.
|
||||||
@@ -2759,19 +2759,19 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the G level of the terminal
|
* Set the G level of the terminal
|
||||||
* @param g
|
* @param g
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.setgLevel = function(g) {
|
Terminal.prototype.setgLevel = function(g) {
|
||||||
this.glevel = g;
|
this.glevel = g;
|
||||||
this.charset = this.charsets[g];
|
this.charset = this.charsets[g];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset for the given G level of the terminal
|
* Set the charset for the given G level of the terminal
|
||||||
* @param g
|
* @param g
|
||||||
* @param charset
|
* @param charset
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.setgCharset = function(g, charset) {
|
Terminal.prototype.setgCharset = function(g, charset) {
|
||||||
this.charsets[g] = charset;
|
this.charsets[g] = charset;
|
||||||
if (this.glevel === g) {
|
if (this.glevel === g) {
|
||||||
@@ -2780,7 +2780,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a keypress event.
|
* Handle a keypress event.
|
||||||
* Key Resources:
|
* Key Resources:
|
||||||
* - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent
|
* - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent
|
||||||
* @param {KeyboardEvent} ev The keypress event to be handled.
|
* @param {KeyboardEvent} ev The keypress event to be handled.
|
||||||
@@ -2825,9 +2825,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send data for handling to the terminal
|
* Send data for handling to the terminal
|
||||||
* @param {string} data
|
* @param {string} data
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.send = function(data) {
|
Terminal.prototype.send = function(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
@@ -2842,9 +2842,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ring the bell.
|
* Ring the bell.
|
||||||
* Note: We could do sweet things with webaudio here
|
* Note: We could do sweet things with webaudio here
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.bell = function() {
|
Terminal.prototype.bell = function() {
|
||||||
if (!this.visualBell) return;
|
if (!this.visualBell) return;
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -2856,8 +2856,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log the current state to the console.
|
* Log the current state to the console.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.log = function() {
|
Terminal.prototype.log = function() {
|
||||||
if (!this.debug) return;
|
if (!this.debug) return;
|
||||||
if (!this.context.console || !this.context.console.log) return;
|
if (!this.context.console || !this.context.console.log) return;
|
||||||
@@ -2866,8 +2866,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log the current state as error to the console.
|
* Log the current state as error to the console.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.error = function() {
|
Terminal.prototype.error = function() {
|
||||||
if (!this.debug) return;
|
if (!this.debug) return;
|
||||||
if (!this.context.console || !this.context.console.error) return;
|
if (!this.context.console || !this.context.console.error) return;
|
||||||
@@ -2990,9 +2990,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the range of rows to refresh
|
* Updates the range of rows to refresh
|
||||||
* @param {number} y The number of rows to refresh next.
|
* @param {number} y The number of rows to refresh next.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.updateRange = function(y) {
|
Terminal.prototype.updateRange = function(y) {
|
||||||
if (y < this.refreshStart) this.refreshStart = y;
|
if (y < this.refreshStart) this.refreshStart = y;
|
||||||
if (y > this.refreshEnd) this.refreshEnd = y;
|
if (y > this.refreshEnd) this.refreshEnd = y;
|
||||||
@@ -3015,9 +3015,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the tab stops.
|
* Setup the tab stops.
|
||||||
* @param {number} i
|
* @param {number} i
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.setupStops = function(i) {
|
Terminal.prototype.setupStops = function(i) {
|
||||||
if (i != null) {
|
if (i != null) {
|
||||||
if (!this.tabs[i]) {
|
if (!this.tabs[i]) {
|
||||||
@@ -3035,9 +3035,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the cursor to the previous tab stop from the given position (default is current).
|
* Move the cursor to the previous tab stop from the given position (default is current).
|
||||||
* @param {number} x The position to move the cursor to the previous tab stop.
|
* @param {number} x The position to move the cursor to the previous tab stop.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.prevStop = function(x) {
|
Terminal.prototype.prevStop = function(x) {
|
||||||
if (x == null) x = this.x;
|
if (x == null) x = this.x;
|
||||||
while (!this.tabs[--x] && x > 0);
|
while (!this.tabs[--x] && x > 0);
|
||||||
@@ -3048,9 +3048,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move the cursor one tab stop forward from the given position (default is current).
|
* Move the cursor one tab stop forward from the given position (default is current).
|
||||||
* @param {number} x The position to move the cursor one tab stop forward.
|
* @param {number} x The position to move the cursor one tab stop forward.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.nextStop = function(x) {
|
Terminal.prototype.nextStop = function(x) {
|
||||||
if (x == null) x = this.x;
|
if (x == null) x = this.x;
|
||||||
while (!this.tabs[++x] && x < this.cols);
|
while (!this.tabs[++x] && x < this.cols);
|
||||||
@@ -3061,10 +3061,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erase in the identified line everything from "x" to the end of the line (right).
|
* Erase in the identified line everything from "x" to the end of the line (right).
|
||||||
* @param {number} x The column from which to start erasing to the end of the line.
|
* @param {number} x The column from which to start erasing to the end of the line.
|
||||||
* @param {number} y The line in which to operate.
|
* @param {number} y The line in which to operate.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.eraseRight = function(x, y) {
|
Terminal.prototype.eraseRight = function(x, y) {
|
||||||
var line = this.lines[this.ybase + y]
|
var line = this.lines[this.ybase + y]
|
||||||
, ch = [this.eraseAttr(), ' ', 1]; // xterm
|
, ch = [this.eraseAttr(), ' ', 1]; // xterm
|
||||||
@@ -3080,10 +3080,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erase in the identified line everything from "x" to the start of the line (left).
|
* Erase in the identified line everything from "x" to the start of the line (left).
|
||||||
* @param {number} x The column from which to start erasing to the start of the line.
|
* @param {number} x The column from which to start erasing to the start of the line.
|
||||||
* @param {number} y The line in which to operate.
|
* @param {number} y The line in which to operate.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.eraseLeft = function(x, y) {
|
Terminal.prototype.eraseLeft = function(x, y) {
|
||||||
var line = this.lines[this.ybase + y]
|
var line = this.lines[this.ybase + y]
|
||||||
, ch = [this.eraseAttr(), ' ', 1]; // xterm
|
, ch = [this.eraseAttr(), ' ', 1]; // xterm
|
||||||
@@ -3096,18 +3096,18 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erase all content in the given line
|
* Erase all content in the given line
|
||||||
* @param {number} y The line to erase all of its contents.
|
* @param {number} y The line to erase all of its contents.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.eraseLine = function(y) {
|
Terminal.prototype.eraseLine = function(y) {
|
||||||
this.eraseRight(0, y);
|
this.eraseRight(0, y);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the data array of a blank line/
|
* Return the data array of a blank line/
|
||||||
* @param {number} cur First bunch of data for each "blank" character.
|
* @param {number} cur First bunch of data for each "blank" character.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.blankLine = function(cur) {
|
Terminal.prototype.blankLine = function(cur) {
|
||||||
var attr = cur
|
var attr = cur
|
||||||
? this.eraseAttr()
|
? this.eraseAttr()
|
||||||
@@ -3126,9 +3126,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If cur return the back color xterm feature attribute. Else return defAttr.
|
* If cur return the back color xterm feature attribute. Else return defAttr.
|
||||||
* @param {object} cur
|
* @param {object} cur
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.ch = function(cur) {
|
Terminal.prototype.ch = function(cur) {
|
||||||
return cur
|
return cur
|
||||||
? [this.eraseAttr(), ' ', 1]
|
? [this.eraseAttr(), ' ', 1]
|
||||||
@@ -3137,9 +3137,9 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluate if the current erminal is the given argument.
|
* Evaluate if the current erminal is the given argument.
|
||||||
* @param {object} term The terminal to evaluate
|
* @param {object} term The terminal to evaluate
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.is = function(term) {
|
Terminal.prototype.is = function(term) {
|
||||||
var name = this.termName;
|
var name = this.termName;
|
||||||
return (name + '').indexOf(term) === 0;
|
return (name + '').indexOf(term) === 0;
|
||||||
@@ -3147,18 +3147,18 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emit the 'data' event and populate the given data.
|
* Emit the 'data' event and populate the given data.
|
||||||
* @param {string} data The data to populate in the event.
|
* @param {string} data The data to populate in the event.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.handler = function(data) {
|
Terminal.prototype.handler = function(data) {
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emit the 'title' event and populate the given title.
|
* Emit the 'title' event and populate the given title.
|
||||||
* @param {string} title The title to populate in the event.
|
* @param {string} title The title to populate in the event.
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.handleTitle = function(title) {
|
Terminal.prototype.handleTitle = function(title) {
|
||||||
this.emit('title', title);
|
this.emit('title', title);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user