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 @@ - + 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": {