2021-10-15 15:07:50 +03:00
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
|
|
namespace Radzen.Blazor
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A tool which creates links from the selection of a <see cref="RadzenHtmlEditor" />.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <example>
|
|
|
|
|
/// <code>
|
|
|
|
|
/// <RadzenHtmlEditor @bind-Value=@html>
|
|
|
|
|
/// <RadzenHtmlEditorLink />
|
|
|
|
|
/// </RadzenHtmlEdito>
|
|
|
|
|
/// @code {
|
2024-02-19 10:31:27 +02:00
|
|
|
/// string html = "@lt;strong>Hello</strong> world!";
|
2021-10-15 15:07:50 +03:00
|
|
|
/// }
|
|
|
|
|
/// </code>
|
|
|
|
|
/// </example>
|
2024-02-19 10:31:27 +02:00
|
|
|
public partial class RadzenHtmlEditorLink : RadzenHtmlEditorButtonBase
|
2021-10-15 15:07:50 +03:00
|
|
|
{
|
|
|
|
|
class LinkAttributes
|
|
|
|
|
{
|
2026-01-07 12:29:58 +05:00
|
|
|
public string? InnerText { get; set; }
|
|
|
|
|
public string? InnerHtml { get; set; }
|
|
|
|
|
public string? Href { get; set; }
|
|
|
|
|
public string? Target { get; set; }
|
2021-10-15 15:07:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the title (tooltip) displayed when the user hovers the tool. Set to <c>"Insert link"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string Title { get; set; } = "Insert link";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the text of the label suggesting the user to enter a web address. Set to <c>"Web address"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string UrlText { get; set; } = "Web address";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the text of the checkbox that opens the link in new window. Set to <c>"Open in new window"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string OpenInNewWindowText { get; set; } = "Open in new window";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the text of the label suggesting the user to change the text of the link. Set to <c>"Text"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string LinkText { get; set; } = "Text";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the text of button which inserts the image. Set to <c>"OK"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string OkText { get; set; } = "OK";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the text of button which cancels image insertion and closes the dialog. Set to <c>"Cancel"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string CancelText { get; set; } = "Cancel";
|
2024-02-19 10:31:27 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specifies the shortcut for the command. Set to <c>"Ctrl+K"</c> by default.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
2026-01-07 12:29:58 +05:00
|
|
|
public override string? Shortcut { get; set; } = "Ctrl+K";
|
2021-10-15 15:07:50 +03:00
|
|
|
}
|
2021-10-25 10:06:11 +03:00
|
|
|
}
|