ssh-manager/static/xterm/xterm.min.js

1 line
191 KiB
JavaScript
Raw Normal View History

2020-11-16 16:41:02 +08:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Terminal=e()}}(function(){return function s(o,a,l){function h(t,e){if(!a[t]){if(!o[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var n=a[t]={exports:{}};o[t][0].call(n.exports,function(e){return h(o[t][1][e]||e)},n,n.exports,s,o,a,l)}return a[t].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)h(l[e]);return h}({1:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var l=e("./Strings"),s=e("./core/Platform"),o=e("./ui/RenderDebouncer"),a=e("./ui/Lifecycle"),h=e("./common/Lifecycle"),c=function(r){function e(e){var t=r.call(this)||this;t._terminal=e,t._liveRegionLineCount=0,t._charsToConsume=[],t._accessibilityTreeRoot=document.createElement("div"),t._accessibilityTreeRoot.classList.add("xterm-accessibility"),t._rowContainer=document.createElement("div"),t._rowContainer.classList.add("xterm-accessibility-tree"),t._rowElements=[];for(var i=0;i<t._terminal.rows;i++)t._rowElements[i]=t._createAccessibilityTreeNode(),t._rowContainer.appendChild(t._rowElements[i]);return t._topBoundaryFocusListener=function(e){return t._onBoundaryFocus(e,0)},t._bottomBoundaryFocusListener=function(e){return t._onBoundaryFocus(e,1)},t._rowElements[0].addEventListener("focus",t._topBoundaryFocusListener),t._rowElements[t._rowElements.length-1].addEventListener("focus",t._bottomBoundaryFocusListener),t._refreshRowsDimensions(),t._accessibilityTreeRoot.appendChild(t._rowContainer),t._renderRowsDebouncer=new o.RenderDebouncer(t._terminal,t._renderRows.bind(t)),t._refreshRows(),t._liveRegion=document.createElement("div"),t._liveRegion.classList.add("live-region"),t._liveRegion.setAttribute("aria-live","assertive"),t._accessibilityTreeRoot.appendChild(t._liveRegion),t._terminal.element.insertAdjacentElement("afterbegin",t._accessibilityTreeRoot),t.register(t._renderRowsDebouncer),t.register(t._terminal.addDisposableListener("resize",function(e){return t._onResize(e.rows)})),t.register(t._terminal.addDisposableListener("refresh",function(e){return t._refreshRows(e.start,e.end)})),t.register(t._terminal.addDisposableListener("scroll",function(e){return t._refreshRows()})),t.register(t._terminal.addDisposableListener("a11y.char",function(e){return t._onChar(e)})),t.register(t._terminal.addDisposableListener("linefeed",function(){return t._onChar("\n")})),t.register(t._terminal.addDisposableListener("a11y.tab",function(e){return t._onTab(e)})),t.register(t._terminal.addDisposableListener("key",function(e){return t._onKey(e)})),t.register(t._terminal.addDisposableListener("blur",function(){return t._clearLiveRegion()})),t.register(t._terminal.addDisposableListener("dprchange",function(){return t._refreshRowsDimensions()})),t.register(t._terminal.renderer.addDisposableListener("resize",function(){return t._refreshRowsDimensions()})),t.register(a.addDisposableDomListener(window,"resize",function(){return t._refreshRowsDimensions()})),t}return n(e,r),e.prototype.dispose=function(){r.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},e.prototype._onBoundaryFocus=function(e,t){var i=e.target,r=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===r){var n,s;if(0===t?(n=i,s=this._rowElements.pop(),this._rowContainer.removeChild(s)):(n