Merge pull request #608 from jimspillane/AddJavaScriptDependencyManager

Add JavaScript dependency manager
This commit is contained in:
Shaun Walker
2020-06-14 11:00:27 -04:00
committed by GitHub
8 changed files with 56 additions and 23 deletions

View File

@ -117,6 +117,11 @@
{
if (firstRender)
{
var oqtaneInterop = new Interop(JsRuntime);
await oqtaneInterop.LoadInteropScript("js/quill-interop.js");
var interop = new RichTextEditorInterop(JsRuntime);
await interop.CreateEditor(

View File

@ -13,7 +13,7 @@ namespace Oqtane.Modules.Controls
_jsRuntime = jsRuntime;
}
public Task CreateEditor(
public async Task CreateEditor(
ElementReference quillElement,
ElementReference toolbar,
bool readOnly,
@ -23,15 +23,14 @@ namespace Oqtane.Modules.Controls
{
try
{
_jsRuntime.InvokeAsync<object>(
await _jsRuntime.InvokeAsync<object>(
"Oqtane.RichTextEditor.createQuill",
quillElement, toolbar, readOnly,
placeholder, theme, debugLevel);
return Task.CompletedTask;
quillElement, toolbar, readOnly, placeholder, theme, debugLevel);
return;
}
catch
{
return Task.CompletedTask;
// handle exception
}
}

View File

@ -29,10 +29,7 @@
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" },
// the following resources should be declared in the RichTextEditor component however the framework currently only supports resource management for modules and themes
new Resource { ResourceType = ResourceType.Stylesheet, Url = "css/quill/quill1.3.6.bubble.css" },
new Resource { ResourceType = ResourceType.Stylesheet, Url = "css/quill/quill1.3.6.snow.css" },
new Resource { ResourceType = ResourceType.Script, Url = "js/quill1.3.6.min.js" },
new Resource { ResourceType = ResourceType.Script, Url = "js/quill-blot-formatter.min.js" },
new Resource { ResourceType = ResourceType.Script, Url = "js/quill-interop.js" }
new Resource { ResourceType = ResourceType.Stylesheet, Url = "css/quill/quill1.3.6.snow.css" }
};
private RichTextEditor RichTextEditorHtml;