From 6a6433d615bca274b41c7a0238e332b5c39c4d9c Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Tue, 10 Dec 2024 12:30:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20Editor=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj b/src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj index 225cc5f6f91..eb31d6393ea 100644 --- a/src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj +++ b/src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj @@ -34,7 +34,7 @@ - + @@ -53,7 +53,7 @@ - + From 8c04237b8efbb0ff89d2d69a5858513f70d3578b Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Tue, 10 Dec 2024 12:41:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?doc(Editor):=20=E5=A2=9E=E5=8A=A0=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E4=BB=A3=E7=A0=81=E8=8E=B7=E5=BE=97=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Editors.razor | 47 +++++++++++-------- .../Components/Samples/Editors.razor.cs | 7 +++ src/BootstrapBlazor.Shared/Locales/en-US.json | 3 +- src/BootstrapBlazor.Shared/Locales/zh-CN.json | 3 +- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor b/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor index 7364c8803c0..37e6cc19f92 100644 --- a/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor +++ b/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor @@ -16,20 +16,24 @@ -

@((MarkupString)Localizer["EditorNormalDescription"].Value)

-
@((MarkupString)Localizer["EditorNormalDiv"].Value)
+
+

@((MarkupString)Localizer["EditorNormalDescription"].Value)

+
@((MarkupString)Localizer["EditorNormalDiv"].Value)
+
-

@((MarkupString)Localizer["EditorSubmitDescription"].Value)

- +
+

@((MarkupString)Localizer["EditorSubmitDescription"].Value)

+ + +
-
-

@((MarkupString)Localizer["EditorPlaceholderDescription"].Value)

+
@((MarkupString)Localizer["EditorPlaceholderDescription"].Value)
@@ -42,34 +46,39 @@ -

@((MarkupString)Localizer["EditorOnValueChangedDescription"].Value)

+
@((MarkupString)Localizer["EditorOnValueChangedDescription"].Value)
- - - -
- -
+
+ + +
+ +
+
-

@((MarkupString)Localizer["EditorCustomerToolbarButtonsDescription"].Value)

+
@((MarkupString)Localizer["EditorCustomerToolbarButtonsDescription"].Value)
-

@((MarkupString)Localizer["EditorToolbarItemsDescription"].Value)

+
@((MarkupString)Localizer["EditorToolbarItemsDescription"].Value)
- -

@((MarkupString)Localizer["DoMethodAsyncDescription"].Value)

+ +
@((MarkupString)Localizer["DoMethodAsyncDescription"].Value)
-
+
-
+ + +
+ +
diff --git a/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor.cs b/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor.cs index fcdaf45647b..aea996d24dc 100644 --- a/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor.cs +++ b/src/BootstrapBlazor.Shared/Components/Samples/Editors.razor.cs @@ -111,6 +111,13 @@ private async Task InsertHtmlAsync() await Editor.DoMethodAsync("pasteHTML", $"

{Localizer["DoMethodAsyncPasteHTML"]}

"); } + private string? _editorCode; + + private async Task OnGetCode() + { + _editorCode = await Editor.GetCode(); + } + private AttributeItem[] GetAttributes() => [ new() diff --git a/src/BootstrapBlazor.Shared/Locales/en-US.json b/src/BootstrapBlazor.Shared/Locales/en-US.json index de8d836cd80..b32e8193d6f 100644 --- a/src/BootstrapBlazor.Shared/Locales/en-US.json +++ b/src/BootstrapBlazor.Shared/Locales/en-US.json @@ -2597,7 +2597,7 @@ "Att3": "Component height", "Att4": "Rich Text Box Toolbar Tool", "Att5": "Custom button", - "DoMethodAsync": "Instance Method", + "DoMethodAsyncTitle": "Instance Method", "DoMethodAsyncIntro": "Call the instance method, please refer summernote api", "DoMethodAsyncDescription": "In this example, by setting the ToolbarItems property, the default available toolbar buttons are changed", "EditorEmptyPlaceholder": "Customize the prompt message for empty values", @@ -2615,6 +2615,7 @@ "DoMethodAsyncButton1": "Insert Html", "DoMethodAsyncButton2": "Update to H2", "DoMethodAsyncButton3": "Insert Image", + "DoMethodAsyncButton4": "Get Code", "DoMethodAsyncPasteHTML": "Here is the content inserted by the external button" }, "BootstrapBlazor.Shared.Components.Samples.EditorForms": { diff --git a/src/BootstrapBlazor.Shared/Locales/zh-CN.json b/src/BootstrapBlazor.Shared/Locales/zh-CN.json index 5a1a8646eb7..137b52e0efd 100644 --- a/src/BootstrapBlazor.Shared/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Shared/Locales/zh-CN.json @@ -2597,7 +2597,7 @@ "Att3": "组件高度", "Att4": "富文本框工具栏工具", "Att5": "自定义按钮", - "DoMethodAsync": "实例方法", + "DoMethodAsyncTitle": "实例方法", "DoMethodAsyncIntro": "使用实例方法从外部操作 Editor,具体的参数参照 summernote api", "DoMethodAsyncDescription": "本例中通过设置 ToolbarItems 属性,更改默认可用的工具栏按钮", "EditorEmptyPlaceholder": "自定义空值的提示信息", @@ -2615,6 +2615,7 @@ "DoMethodAsyncButton1": "插入一段 Html", "DoMethodAsyncButton2": "将段落修改为 H2", "DoMethodAsyncButton3": "添加一张图片", + "DoMethodAsyncButton4": "获得组件内容", "DoMethodAsyncPasteHTML": "这里是外部按钮插入的内容" }, "BootstrapBlazor.Shared.Components.Samples.EditorForms": {