mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Remove navigation mode/more rows element
This commit is contained in:
@@ -71,9 +71,6 @@
|
||||
<p>
|
||||
<label><input type="checkbox" id="option-screen-reader-mode"> screenReaderMode</label>
|
||||
</p>
|
||||
<p>
|
||||
<button id="screen-reader-navigation-mode" title="Only works when screenReaderMode is true">Enter navigation mode</button>
|
||||
</p>
|
||||
</div>
|
||||
<p><strong>Attention:</strong> The demo is a barebones implementation and is designed for xterm.js evaluation purposes only. Exposing the demo to the public as is would introduce security risks for the host.</p>
|
||||
<script src="dist/bundle.js" defer ></script>
|
||||
|
||||
@@ -33,7 +33,6 @@ var terminalContainer = document.getElementById('terminal-container'),
|
||||
bellStyle: document.querySelector('#option-bell-style'),
|
||||
screenReaderMode: document.querySelector('#option-screen-reader-mode')
|
||||
},
|
||||
navigationModeElement = document.querySelector('#screen-reader-navigation-mode'),
|
||||
colsElement = document.getElementById('cols'),
|
||||
rowsElement = document.getElementById('rows');
|
||||
|
||||
@@ -87,13 +86,6 @@ optionElements.tabstopwidth.addEventListener('change', function () {
|
||||
optionElements.screenReaderMode.addEventListener('change', function () {
|
||||
term.setOption('screenReaderMode', optionElements.screenReaderMode.checked);
|
||||
});
|
||||
navigationModeElement.addEventListener('click', function () {
|
||||
if (term.getOption('screenReaderMode')) {
|
||||
term.enterNavigationMode();
|
||||
} else {
|
||||
console.warn('screenReaderMode must be true to enter navigation mode');
|
||||
}
|
||||
});
|
||||
|
||||
createTerminal();
|
||||
|
||||
|
||||
@@ -23,11 +23,9 @@ export class AccessibilityManager implements IDisposable {
|
||||
private _rowContainer: HTMLElement;
|
||||
private _rowElements: HTMLElement[] = [];
|
||||
private _liveRegion: HTMLElement;
|
||||
private _moreRowsElement: HTMLElement;
|
||||
private _liveRegionLineCount: number = 0;
|
||||
|
||||
private _renderRowsDebouncer: RenderDebouncer;
|
||||
// private _navigationMode: NavigationMode;
|
||||
|
||||
private _topBoundaryFocusListener: (e: FocusEvent) => void;
|
||||
private _bottomBoundaryFocusListener: (e: FocusEvent) => void;
|
||||
@@ -49,12 +47,6 @@ export class AccessibilityManager implements IDisposable {
|
||||
this._accessibilityTreeRoot = document.createElement('div');
|
||||
this._accessibilityTreeRoot.classList.add('xterm-accessibility');
|
||||
|
||||
this._moreRowsElement = document.createElement('div');
|
||||
this._moreRowsElement.classList.add('xterm-message');
|
||||
this._moreRowsElement.style.clip = 'clip(0 0 0 0)';
|
||||
this._moreRowsElement.textContent = Strings.navigationModeMoreRows;
|
||||
this._accessibilityTreeRoot.appendChild(this._moreRowsElement);
|
||||
|
||||
this._rowContainer = document.createElement('div');
|
||||
this._rowContainer.classList.add('xterm-accessibility-tree');
|
||||
for (let i = 0; i < this._terminal.rows; i++) {
|
||||
@@ -178,25 +170,6 @@ export class AccessibilityManager implements IDisposable {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
|
||||
public get isNavigationModeActive(): boolean {
|
||||
// TODO: Remove this function
|
||||
return true;
|
||||
// return this._navigationMode.isActive;
|
||||
}
|
||||
|
||||
public enterNavigationMode(): void {
|
||||
// this._navigationMode.enter();
|
||||
|
||||
// this._isNavigationModeActive = true;
|
||||
this.announce('Entered line navigation mode');
|
||||
// this._rowContainer.tabIndex = 0;
|
||||
// this._rowContainer.setAttribute('role', 'list');
|
||||
// this._rowContainer.setAttribute('aria-activedescendant', this._activeItemId);
|
||||
// this._navigateToElement(this._terminal.buffer.ydisp + this._terminal.buffer.y);
|
||||
// this._rowContainer.focus();
|
||||
this._rowElements[this._rowElements.length - 1].focus();
|
||||
}
|
||||
|
||||
private _onResize(cols: number, rows: number): void {
|
||||
// Grow rows as required
|
||||
for (let i = this._rowContainer.children.length; i < this._terminal.rows; i++) {
|
||||
|
||||
@@ -4,5 +4,4 @@
|
||||
*/
|
||||
|
||||
export let promptLabel = 'Terminal input';
|
||||
export let navigationModeMoreRows = 'In order to properly navigation the terminal buffer you need to enter navigation mode';
|
||||
export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';
|
||||
|
||||
@@ -1374,12 +1374,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
}
|
||||
}
|
||||
|
||||
public enterNavigationMode(): void {
|
||||
if (this._accessibilityManager) {
|
||||
this._accessibilityManager.enterNavigationMode();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the terminal has an active selection.
|
||||
*/
|
||||
@@ -1420,10 +1414,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
|
||||
* @param {KeyboardEvent} ev The keydown event to be handled.
|
||||
*/
|
||||
protected _keyDown(ev: KeyboardEvent): boolean {
|
||||
if (this._accessibilityManager && this._accessibilityManager.isNavigationModeActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.customKeyEventHandler && this.customKeyEventHandler(ev) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,6 @@ import * as Browser from '../shared/utils/Browser';
|
||||
import { ITheme, IDisposable } from 'xterm';
|
||||
|
||||
export class MockTerminal implements ITerminal {
|
||||
enterNavigationMode(): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
getOption(key: any): any {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
Vendored
-6
@@ -370,12 +370,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
deregisterLinkMatcher(matcherId: number): void;
|
||||
|
||||
/**
|
||||
* Enters screen reader navigation mode. This will only work when
|
||||
* the screenReaderMode option is true.
|
||||
*/
|
||||
enterNavigationMode(): void;
|
||||
|
||||
/**
|
||||
* Gets whether the terminal has an active selection.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user