Skip to content

Commit

Permalink
Update to latest version of Blazorise & roosterjs
Browse files Browse the repository at this point in the history
  • Loading branch information
njannink committed Mar 13, 2024
1 parent 0218d00 commit f873d82
Show file tree
Hide file tree
Showing 5 changed files with 1,374 additions and 10 deletions.
9 changes: 7 additions & 2 deletions Blazorise.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.runsettings = .runsettings
DotnetWatchRunAll.bat = DotnetWatchRunAll.bat
CREDITS.md = CREDITS.md
DotnetWatchRunAll.bat = DotnetWatchRunAll.bat
README.md = README.md
EndProjectSection
EndProject
Expand Down Expand Up @@ -153,7 +153,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazorise.Captcha", "Source
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazorise.Captcha.ReCaptcha", "Source\Extensions\Blazorise.Captcha.ReCaptcha\Blazorise.Captcha.ReCaptcha.csproj", "{2B4FD79A-42E2-4B81-828B-0799E4744ADA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazorise.RichTextEdit.Rooster", "Source\Extensions\Blazorise.RichTextEdit.Rooster\Blazorise.RichTextEdit.Rooster.csproj", "{D03708E9-0E38-4AD1-87DF-DA349E7DC271}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazorise.RichTextEdit.Rooster", "Source\Extensions\Blazorise.RichTextEdit.Rooster\Blazorise.RichTextEdit.Rooster.csproj", "{D03708E9-0E38-4AD1-87DF-DA349E7DC271}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -401,6 +401,10 @@ Global
{2B4FD79A-42E2-4B81-828B-0799E4744ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B4FD79A-42E2-4B81-828B-0799E4744ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B4FD79A-42E2-4B81-828B-0799E4744ADA}.Release|Any CPU.Build.0 = Release|Any CPU
{D03708E9-0E38-4AD1-87DF-DA349E7DC271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D03708E9-0E38-4AD1-87DF-DA349E7DC271}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D03708E9-0E38-4AD1-87DF-DA349E7DC271}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D03708E9-0E38-4AD1-87DF-DA349E7DC271}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -469,6 +473,7 @@ Global
{FE5BCD94-0215-4BF1-8CF7-0F97C20B0054} = {9731051E-0AA7-411E-A76A-987854F034DA}
{D24EA4EF-0AEC-43B2-BCDC-56229D60C285} = {9731051E-0AA7-411E-A76A-987854F034DA}
{2B4FD79A-42E2-4B81-828B-0799E4744ADA} = {9731051E-0AA7-411E-A76A-987854F034DA}
{D03708E9-0E38-4AD1-87DF-DA349E7DC271} = {9731051E-0AA7-411E-A76A-987854F034DA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {205B3EA4-470F-45DA-911E-346AF7D0A9A5}
Expand Down
2 changes: 1 addition & 1 deletion Build/Blazorise.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Company>Megabit</Company>
<Copyright>Copyright 2018-2024 Megabit</Copyright>

<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<LangVersion>10.0</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getRequiredElement, loadScript } from "../Blazorise/utilities.js?v=1.2.2.0";
import { getRequiredElement } from "../Blazorise/utilities.js?v=1.4.2.0";

const _instances = [];

document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend", "<link rel=\"stylesheet\" href=\"_content/Blazorise.RichTextEdit.Rooster/blazorise.rooster.css?v=1.2.2.0\" />");
document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend", "<link rel=\"stylesheet\" href=\"_content/Blazorise.RichTextEdit.Rooster/blazorise.rooster.css?v=1.4.2.0\" />");

export async function initialize(dotNetAdapter, element, elementId, options) {
element = getRequiredElement(element, elementId);
Expand All @@ -11,10 +11,10 @@ export async function initialize(dotNetAdapter, element, elementId, options) {
return;

if (typeof roosterjs === 'undefined') {
await loadScript("_content/Blazorise.RichTextEdit.Rooster/vendors/rooster.js?v=4.88.0");
await loadRoosterJs();
}

const instance = {
const instance = {
options: options,
adapter: dotNetAdapter,
editor: null,
Expand Down Expand Up @@ -48,3 +48,28 @@ export function format(element, elementId, action, args) {
roosterjs[action](instance.editor, args);
}

function loadRoosterJs() {
return new Promise((resolve, reject) => {
try {
const scriptEle = document.createElement("script");
scriptEle.type = "text/javascript";
scriptEle.async = true;
scriptEle.src = "_content/Blazorise.RichTextEdit.Rooster/vendors/rooster.js?v=1.4.2.0";

scriptEle.addEventListener("load", (ev) => {
resolve({ status: true });
});

scriptEle.addEventListener("error", (ev) => {
reject({
status: false,
message: `Failed to load roosterjs`
});
});

document.body.appendChild(scriptEle);
} catch (error) {
reject(error);
}
});
}
1,339 changes: 1,337 additions & 2 deletions Source/Extensions/Blazorise.RichTextEdit.Rooster/wwwroot/vendors/rooster.js

Large diffs are not rendered by default.

This file was deleted.

0 comments on commit f873d82

Please sign in to comment.