From ab318020cec2e7703f2a4ef2bb7265f632c31eef Mon Sep 17 00:00:00 2001 From: TatLead Date: Thu, 7 Mar 2024 01:56:48 +0000 Subject: [PATCH] Update Demos --- README.md | 14 +++++++------- XtermBlazor.Demo.Server/Pages/Index.razor | 12 ++++++------ XtermBlazor.Demo.Server/Pages/_Host.cshtml | 12 ++++++------ XtermBlazor.Demo.Wasm/Pages/Index.razor | 12 ++++++------ XtermBlazor.Demo.Wasm/wwwroot/index.html | 12 ++++++------ 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index ce9c25b..922cde2 100644 --- a/README.md +++ b/README.md @@ -82,22 +82,22 @@ In the HTML body section of either `index.html` or `_Host.cshtml` add this: ## Addons Xterm supports [Addons](https://github.com/xtermjs/xterm.js/tree/master/addons) -To use `xterm-addon-fit` addon, you need to add the following to your HTML body section either `index.html` or `_Host.cshtml`. +To use `@xterm/addon-fit` addon, you need to add the following to your HTML body section either `index.html` or `_Host.cshtml`. ```html - + - + ``` ### Usage with addons ```razor - + @code { private Xterm _terminal; @@ -108,15 +108,15 @@ To use `xterm-addon-fit` addon, you need to add the following to your HTML body CursorStyle = CursorStyle.Bar, }; - private string[] _addonIds = new string[] + private HashSet _addons = new HashSet() { - "xterm-addon-fit", + "addon-fit", }; private async Task OnFirstRender() { // Invoke fit() function - await _terminal.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit"); + await _terminal.Addon("addon-fit").InvokeVoidAsync("fit"); await _terminal.WriteLine("Hello World"); } diff --git a/XtermBlazor.Demo.Server/Pages/Index.razor b/XtermBlazor.Demo.Server/Pages/Index.razor index 2dc910b..372b2e8 100644 --- a/XtermBlazor.Demo.Server/Pages/Index.razor +++ b/XtermBlazor.Demo.Server/Pages/Index.razor @@ -80,9 +80,9 @@ EventCallback Logs: private HashSet _addons = new HashSet() { - "xterm-addon-fit", - "xterm-addon-search", - "xterm-addon-web-links", + "addon-fit", + "addon-search", + "addon-web-links", }; private TerminalOptions _options2 = new TerminalOptions @@ -130,8 +130,8 @@ EventCallback Logs: }); } - await _terminal.Addon("xterm-addon-fit").InvokeVoidAsync("fit"); - await _terminalEvent.Addon("xterm-addon-fit").InvokeVoidAsync("fit"); + await _terminal.Addon("addon-fit").InvokeVoidAsync("fit"); + await _terminalEvent.Addon("addon-fit").InvokeVoidAsync("fit"); _columns = await _terminal.GetColumns(); _rows = await _terminal.GetRows(); @@ -245,7 +245,7 @@ EventCallback Logs: private async Task Search(MouseEventArgs args) { - bool searchSuccess = await _terminal.Addon("xterm-addon-search").InvokeAsync("findNext", _searchInput); + bool searchSuccess = await _terminal.Addon("addon-search").InvokeAsync("findNext", _searchInput); await _terminalEvent.WriteLine($"({++_eventId}) Search(): {searchSuccess}"); } diff --git a/XtermBlazor.Demo.Server/Pages/_Host.cshtml b/XtermBlazor.Demo.Server/Pages/_Host.cshtml index 2fa72d1..d8d3e37 100644 --- a/XtermBlazor.Demo.Server/Pages/_Host.cshtml +++ b/XtermBlazor.Demo.Server/Pages/_Host.cshtml @@ -33,17 +33,17 @@ 🗙 - - - + + + diff --git a/XtermBlazor.Demo.Wasm/Pages/Index.razor b/XtermBlazor.Demo.Wasm/Pages/Index.razor index 2dc910b..372b2e8 100644 --- a/XtermBlazor.Demo.Wasm/Pages/Index.razor +++ b/XtermBlazor.Demo.Wasm/Pages/Index.razor @@ -80,9 +80,9 @@ EventCallback Logs: private HashSet _addons = new HashSet() { - "xterm-addon-fit", - "xterm-addon-search", - "xterm-addon-web-links", + "addon-fit", + "addon-search", + "addon-web-links", }; private TerminalOptions _options2 = new TerminalOptions @@ -130,8 +130,8 @@ EventCallback Logs: }); } - await _terminal.Addon("xterm-addon-fit").InvokeVoidAsync("fit"); - await _terminalEvent.Addon("xterm-addon-fit").InvokeVoidAsync("fit"); + await _terminal.Addon("addon-fit").InvokeVoidAsync("fit"); + await _terminalEvent.Addon("addon-fit").InvokeVoidAsync("fit"); _columns = await _terminal.GetColumns(); _rows = await _terminal.GetRows(); @@ -245,7 +245,7 @@ EventCallback Logs: private async Task Search(MouseEventArgs args) { - bool searchSuccess = await _terminal.Addon("xterm-addon-search").InvokeAsync("findNext", _searchInput); + bool searchSuccess = await _terminal.Addon("addon-search").InvokeAsync("findNext", _searchInput); await _terminalEvent.WriteLine($"({++_eventId}) Search(): {searchSuccess}"); } diff --git a/XtermBlazor.Demo.Wasm/wwwroot/index.html b/XtermBlazor.Demo.Wasm/wwwroot/index.html index 4ebfe68..892611a 100644 --- a/XtermBlazor.Demo.Wasm/wwwroot/index.html +++ b/XtermBlazor.Demo.Wasm/wwwroot/index.html @@ -24,18 +24,18 @@ 🗙 - - - + + +