Client fixes
Client is partially done. 227 warnings left out of 1500 I like Rider
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
@namespace Oqtane.Modules.Controls
|
||||
@inherits ModuleBase
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
@if (filemanagervisible)
|
||||
@if (_filemanagervisible)
|
||||
{
|
||||
<FileManager @ref="filemanager" Filter="@Constants.ImageFiles" />
|
||||
@((MarkupString)@message)
|
||||
<FileManager @ref="_fileManager" Filter="@Constants.ImageFiles" />
|
||||
@((MarkupString)_message)
|
||||
<br />
|
||||
}
|
||||
<div class="row justify-content-center">
|
||||
<button type="button" class="btn btn-success" @onclick="InsertImage">Insert Image</button>
|
||||
@if (filemanagervisible)
|
||||
@if (_filemanagervisible)
|
||||
{
|
||||
@((MarkupString)" ")
|
||||
<button type="button" class="btn btn-secondary" @onclick="CloseFileManager">Close</button>
|
||||
@ -18,10 +18,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class ="col">
|
||||
<div @ref="@ToolBar">
|
||||
<div @ref="@_toolBar">
|
||||
@ToolbarContent
|
||||
</div>
|
||||
<div @ref="@EditorElement">
|
||||
<div @ref="@_editorElement">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -42,20 +42,20 @@
|
||||
[Parameter]
|
||||
public string DebugLevel { get; set; } = "info";
|
||||
|
||||
private ElementReference EditorElement;
|
||||
private ElementReference ToolBar;
|
||||
bool filemanagervisible = false;
|
||||
FileManager filemanager;
|
||||
string message = "";
|
||||
private ElementReference _editorElement;
|
||||
private ElementReference _toolBar;
|
||||
bool _filemanagervisible = false;
|
||||
FileManager _fileManager;
|
||||
string _message = "";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await RichTextEditorInterop.CreateEditor(
|
||||
JSRuntime,
|
||||
EditorElement,
|
||||
ToolBar,
|
||||
JsRuntime,
|
||||
_editorElement,
|
||||
_toolBar,
|
||||
ReadOnly,
|
||||
Placeholder,
|
||||
Theme,
|
||||
@ -66,68 +66,68 @@
|
||||
public async Task<string> GetText()
|
||||
{
|
||||
return await RichTextEditorInterop.GetText(
|
||||
JSRuntime,
|
||||
EditorElement);
|
||||
JsRuntime,
|
||||
_editorElement);
|
||||
}
|
||||
|
||||
public async Task<string> GetHTML()
|
||||
public async Task<string> GetHtml()
|
||||
{
|
||||
return await RichTextEditorInterop.GetHTML(
|
||||
JSRuntime,
|
||||
EditorElement);
|
||||
return await RichTextEditorInterop.GetHtml(
|
||||
JsRuntime,
|
||||
_editorElement);
|
||||
}
|
||||
|
||||
public async Task<string> GetContent()
|
||||
{
|
||||
return await RichTextEditorInterop.GetContent(
|
||||
JSRuntime,
|
||||
EditorElement);
|
||||
JsRuntime,
|
||||
_editorElement);
|
||||
}
|
||||
|
||||
public async Task LoadContent(string Content)
|
||||
public async Task LoadContent(string content)
|
||||
{
|
||||
await RichTextEditorInterop.LoadEditorContent(
|
||||
JSRuntime,
|
||||
EditorElement, Content);
|
||||
JsRuntime,
|
||||
_editorElement, content);
|
||||
}
|
||||
|
||||
public async Task EnableEditor(bool mode)
|
||||
{
|
||||
await RichTextEditorInterop.EnableEditor(
|
||||
JSRuntime,
|
||||
EditorElement, mode);
|
||||
JsRuntime,
|
||||
_editorElement, mode);
|
||||
}
|
||||
|
||||
public async Task InsertImage()
|
||||
{
|
||||
if (filemanagervisible)
|
||||
if (_filemanagervisible)
|
||||
{
|
||||
int fileid = filemanager.GetFileId();
|
||||
int fileid = _fileManager.GetFileId();
|
||||
if (fileid != -1)
|
||||
{
|
||||
await RichTextEditorInterop.InsertImage(
|
||||
JSRuntime,
|
||||
EditorElement, ContentUrl(fileid));
|
||||
filemanagervisible = false;
|
||||
message = "";
|
||||
JsRuntime,
|
||||
_editorElement, ContentUrl(fileid));
|
||||
_filemanagervisible = false;
|
||||
_message = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "<br /><div class=\"alert alert-warning\" role=\"alert\">You Must Select An Image To Insert</div>";
|
||||
_message = "<br /><div class=\"alert alert-warning\" role=\"alert\">You Must Select An Image To Insert</div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
filemanagervisible = true;
|
||||
message = "";
|
||||
_filemanagervisible = true;
|
||||
_message = "";
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void CloseFileManager()
|
||||
{
|
||||
filemanagervisible = false;
|
||||
message = "";
|
||||
_filemanagervisible = false;
|
||||
_message = "";
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user