From 356c9d3a914663fc374cf0dc6112f281730c17a7 Mon Sep 17 00:00:00 2001 From: Eddy Lynch Date: Fri, 20 Dec 2024 16:08:41 +0000 Subject: [PATCH 1/5] Remove jQuery from highchart add-in --- .../BusinessChart/js/BusinessChartAddIn.js | 28 ++++++++++++------- .../src/BusinessChart.ControlAddin.al | 1 - ...micsNavClientBusinessChart.ControlAddin.al | 1 - .../BusinessChart/js/BusinessChartAddIn.js | 28 ++++++++++++------- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js index 7b83440bf1..ba55587c9b 100644 --- a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -17,9 +17,9 @@ var BEFORE_CHART_FORMAT_TEMPLATE = // Initialization of the control add-in. // Note: This function is called by the manifest after loading the control add-in. function Initialize() { - $(window).resize(function () { - var width = $(this).width(); - var height = $(this).height(); + window.addEventListener('resize', function () { + var width = window.document.documentElement.clientWidth; + var height = window.document.documentElement.clientHeight; onChartSizeChanged(width, height); }); @@ -27,6 +27,10 @@ function Initialize() { raiseAddInReady(); } +function controlAddIn() { + return document.getElementById('controlAddIn'); +} + // Update the chart with the supplied chart data. // Note: This function is called from the application code. function Update(chartData) { @@ -96,7 +100,7 @@ function createUI(chartData) { } // Remove any existing content - $("#controlAddIn").empty(); + controlAddIn().innerHTML = ''; if (validateChartData(chartData)) { initializeChartLanguage(chartData); @@ -152,9 +156,11 @@ function validateYAxisRange(chartData) { // Create a DIV containing the specified message text. function createMessage(text) { - $("#controlAddIn").append( - '
' + text + "
" - ); + var element = document.createElement("div"); + element.className = getMessageClassName(); + element.innerHTML = '' + text + ''; + + controlAddIn().appendChild(element); } // Initialize the month, short month, and weekday names of the chart. @@ -403,10 +409,12 @@ function createChart(chartData) { ); // Make chart non-focusable - $(chart.container).find("svg").attr("focusable", "false"); + chart.container.querySelectorAll("svg").forEach(svg => { + svg.setAttribute("focusable", "false") + }); - var width = $(chart.container).width(); - var height = $(chart.container).height(); + var width = chart.container.getBoundingClientRect().width; + var height = chart.container.getBoundingClientRect().height; // Update the size-dependent properties if (width > 0 && height > 0) { diff --git a/src/System Application/App/ControlAddIns/src/BusinessChart.ControlAddin.al b/src/System Application/App/ControlAddIns/src/BusinessChart.ControlAddin.al index ad0e973bc2..efe09b8596 100644 --- a/src/System Application/App/ControlAddIns/src/BusinessChart.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/BusinessChart.ControlAddin.al @@ -17,7 +17,6 @@ controladdin BusinessChart HorizontalShrink = true; Scripts = 'Resources\BusinessChart\js\BusinessChartAddIn.js', - 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', 'https://bc-cdn.dynamics.com/common/js/highcharts-9.1.1.js', 'https://bc-cdn.dynamics.com/common/js/highcharts-more-9.1.1.js', 'https://bc-cdn.dynamics.com/common/js/accessibility-9.1.1.js', diff --git a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientBusinessChart.ControlAddin.al b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientBusinessChart.ControlAddin.al index a622f9d590..ca851c8a23 100644 --- a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientBusinessChart.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientBusinessChart.ControlAddin.al @@ -20,7 +20,6 @@ controladdin "Microsoft.Dynamics.Nav.Client.BusinessChart" HorizontalShrink = true; Scripts = 'Resources\BusinessChart\js\BusinessChartAddIn.js', - 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', 'https://bc-cdn.dynamics.com/common/js/highcharts-9.1.1.js', 'https://bc-cdn.dynamics.com/common/js/highcharts-more-9.1.1.js', 'https://bc-cdn.dynamics.com/common/js/accessibility-9.1.1.js', diff --git a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js index 7b83440bf1..fb4ceb3bb1 100644 --- a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -17,9 +17,9 @@ var BEFORE_CHART_FORMAT_TEMPLATE = // Initialization of the control add-in. // Note: This function is called by the manifest after loading the control add-in. function Initialize() { - $(window).resize(function () { - var width = $(this).width(); - var height = $(this).height(); + window.addEventListener('resize', function () { + var width = window.document.documentElement.clientWidth; + var height = window.document.documentElement.clientHeight; onChartSizeChanged(width, height); }); @@ -27,6 +27,10 @@ function Initialize() { raiseAddInReady(); } +function controlAddIn() { + return document.getElementById('controlAddIn'); +} + // Update the chart with the supplied chart data. // Note: This function is called from the application code. function Update(chartData) { @@ -96,7 +100,7 @@ function createUI(chartData) { } // Remove any existing content - $("#controlAddIn").empty(); + controlAddIn().innerHTML = ''; if (validateChartData(chartData)) { initializeChartLanguage(chartData); @@ -152,9 +156,11 @@ function validateYAxisRange(chartData) { // Create a DIV containing the specified message text. function createMessage(text) { - $("#controlAddIn").append( - '
' + text + "
" - ); + var element = document.createElement("div"); + element.className = getMessageClassName(); + element.innerHTML = '' + text + ''; + + controlAddIn().appendChild(element); } // Initialize the month, short month, and weekday names of the chart. @@ -403,10 +409,12 @@ function createChart(chartData) { ); // Make chart non-focusable - $(chart.container).find("svg").attr("focusable", "false"); + chart.container.querySelectorAll("svg").forEach(svg => { + svg.setAttribute("focusable", "false") + }); - var width = $(chart.container).width(); - var height = $(chart.container).height(); + var width = chart.container.getBoundingClientRect().width; + var height = chart.container.getBoundingClientRect() // Update the size-dependent properties if (width > 0 && height > 0) { From 03fc1f4204080190fed06d3a492224fc25e42142 Mon Sep 17 00:00:00 2001 From: Eddy Lynch Date: Mon, 6 Jan 2025 16:30:43 +0000 Subject: [PATCH 2/5] Use bounding client rect width and height --- .../Resources/BusinessChart/js/BusinessChartAddIn.js | 4 ++-- .../App/Resources/BusinessChart/js/BusinessChartAddIn.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js index ba55587c9b..5a01e95c3c 100644 --- a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -18,8 +18,8 @@ var BEFORE_CHART_FORMAT_TEMPLATE = // Note: This function is called by the manifest after loading the control add-in. function Initialize() { window.addEventListener('resize', function () { - var width = window.document.documentElement.clientWidth; - var height = window.document.documentElement.clientHeight; + var width = window.document.documentElement.getBoundingClientRect().width; + var height = window.document.documentElement.getBoundingClientRect().height; onChartSizeChanged(width, height); }); diff --git a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js index fb4ceb3bb1..5a01e95c3c 100644 --- a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -18,8 +18,8 @@ var BEFORE_CHART_FORMAT_TEMPLATE = // Note: This function is called by the manifest after loading the control add-in. function Initialize() { window.addEventListener('resize', function () { - var width = window.document.documentElement.clientWidth; - var height = window.document.documentElement.clientHeight; + var width = window.document.documentElement.getBoundingClientRect().width; + var height = window.document.documentElement.getBoundingClientRect().height; onChartSizeChanged(width, height); }); @@ -414,7 +414,7 @@ function createChart(chartData) { }); var width = chart.container.getBoundingClientRect().width; - var height = chart.container.getBoundingClientRect() + var height = chart.container.getBoundingClientRect().height; // Update the size-dependent properties if (width > 0 && height > 0) { From 861f729c43e5c55a748379769d6fdb13feb4c2f5 Mon Sep 17 00:00:00 2001 From: Eddy Lynch Date: Tue, 14 Jan 2025 15:00:54 +0000 Subject: [PATCH 3/5] Remove jquery from other control addins --- .../js/RoleCenterSelector.js | 2 +- .../WelcomeWizard/js/WelcomeWizard.js | 23 ++++++++++--------- ...avClientRoleCenterSelector.ControlAddin.al | 3 +-- ...micsNavClientWelcomeWizard.ControlAddin.al | 3 +-- .../src/RoleCenterSelector.ControlAddin.al | 3 +-- .../src/WelcomeWizard.ControlAddin.al | 3 +-- .../js/RoleCenterSelector.js | 2 +- .../WelcomeWizard/js/WelcomeWizard.js | 23 ++++++++++--------- 8 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/System Application/App/ControlAddIns/Resources/RoleCenterSelector/js/RoleCenterSelector.js b/src/System Application/App/ControlAddIns/Resources/RoleCenterSelector/js/RoleCenterSelector.js index a324e7a1a8..c18e60bb5e 100644 --- a/src/System Application/App/ControlAddIns/Resources/RoleCenterSelector/js/RoleCenterSelector.js +++ b/src/System Application/App/ControlAddIns/Resources/RoleCenterSelector/js/RoleCenterSelector.js @@ -45,7 +45,7 @@ function DrawPage() { } function ReplaceFeaturesContent() { - $("#featuretable").remove(); + document.getElementById("featuretable")?.remove(); InsertFeaturesContent(); } diff --git a/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js b/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js index a4a0cdd201..8f603eb06d 100644 --- a/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js +++ b/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js @@ -212,17 +212,18 @@ function DrawLayout(titletxt, subtitletxt, explanationtxt, intro, introDescripti canvas.appendChild(container); - $('#welcomeContainer').attr('role', 'dialog'); - $('#welcomeContainer').attr('aria-describedby', 'welcomeDivTag'); - $('#welcomePic').attr('role', 'presentation'); - $('#tile1Button').attr('aria-labelledby', 'tileDescription1 tileSubDescription1'); - $('#tile2Button').attr('aria-labelledby', 'tileDescription2 tileSubDescription2'); - $('#tile3Button').attr('aria-labelledby', 'tileDescription3 tileSubDescription3'); - $('#legalDescriptionDiv').attr('aria-labelledby', 'legalDiv'); - - $("#tile1Button").click(function(){ThumbnailClick(1);}); - $("#tile2Button").click(function(){ThumbnailClick(2);}); - $("#tile3Button").click(function(){ThumbnailClick(3);}); + const welcomeContainer = document.getElementById("welcomeContainer"); + welcomeContainer?.setAttribute('role', 'dialog'); + welcomeContainer?.setAttribute('aria-describedby', 'welcomeDivTag'); + document.getElementById('welcomePic')?.setAttribute('role', 'presentation'); + document.getElementById('tile1Button')?.setAttribute('aria-labelledby', 'tileDescription1 tileSubDescription1'); + document.getElementById('tile2Button')?.setAttribute('aria-labelledby', 'tileDescription2 tileSubDescription2'); + document.getElementById('tile3Button')?.setAttribute('aria-labelledby', 'tileDescription3 tileSubDescription3'); + document.getElementById('legalDescriptionDiv')?.setAttribute('aria-labelledby', 'legalDiv'); + + document.getElementById('tile1Button')?.addEventListener(() => ThumbnailClick(1)); + document.getElementById('tile2Button')?.addEventListener(() => ThumbnailClick(2)); + document.getElementById('tile3Button')?.addEventListener(() => ThumbnailClick(3)); } function ThumbnailClick(id) diff --git a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientRoleCenterSelector.ControlAddin.al b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientRoleCenterSelector.ControlAddin.al index ca9768d81d..0ed0638149 100644 --- a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientRoleCenterSelector.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientRoleCenterSelector.ControlAddin.al @@ -15,8 +15,7 @@ controladdin "Microsoft.Dynamics.Nav.Client.RoleCenterSelector" VerticalStretch = true; HorizontalStretch = true; - Scripts = 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', - 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', + Scripts = 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', 'Resources\RoleCenterSelector\js\RoleCenterSelector.js'; StartupScript = 'Resources\RoleCenterSelector\js\Startup.js'; RefreshScript = 'Resources\RoleCenterSelector\js\Refresh.js'; diff --git a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientWelcomeWizard.ControlAddin.al b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientWelcomeWizard.ControlAddin.al index 5e61ea92a7..60094e2f96 100644 --- a/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientWelcomeWizard.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/MicrosoftDynamicsNavClientWelcomeWizard.ControlAddin.al @@ -19,8 +19,7 @@ controladdin "Microsoft.Dynamics.Nav.Client.WelcomeWizard" HorizontalStretch = true; HorizontalShrink = true; - Scripts = 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', - 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', + Scripts = 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', 'Resources\WelcomeWizard\js\WelcomeWizard.js'; StartupScript = 'Resources\WelcomeWizard\js\Startup.js'; RefreshScript = 'Resources\WelcomeWizard\js\Refresh.js'; diff --git a/src/System Application/App/ControlAddIns/src/RoleCenterSelector.ControlAddin.al b/src/System Application/App/ControlAddIns/src/RoleCenterSelector.ControlAddin.al index 1e3a081246..9c2493bd98 100644 --- a/src/System Application/App/ControlAddIns/src/RoleCenterSelector.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/RoleCenterSelector.ControlAddin.al @@ -12,8 +12,7 @@ controladdin RoleCenterSelector VerticalStretch = true; HorizontalStretch = true; - Scripts = 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', - 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', + Scripts = 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', 'Resources\RoleCenterSelector\js\RoleCenterSelector.js'; StartupScript = 'Resources\RoleCenterSelector\js\Startup.js'; RefreshScript = 'Resources\RoleCenterSelector\js\Refresh.js'; diff --git a/src/System Application/App/ControlAddIns/src/WelcomeWizard.ControlAddin.al b/src/System Application/App/ControlAddIns/src/WelcomeWizard.ControlAddin.al index d9c74b9353..a0ca398429 100644 --- a/src/System Application/App/ControlAddIns/src/WelcomeWizard.ControlAddin.al +++ b/src/System Application/App/ControlAddIns/src/WelcomeWizard.ControlAddin.al @@ -16,8 +16,7 @@ controladdin WelcomeWizard HorizontalStretch = true; HorizontalShrink = true; - Scripts = 'https://bc-cdn.dynamics.com/common/js/jquery-3.5.1.min.js', - 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', + Scripts = 'https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js', 'Resources\WelcomeWizard\js\WelcomeWizard.js'; StartupScript = 'Resources\WelcomeWizard\js\Startup.js'; RefreshScript = 'Resources\WelcomeWizard\js\Refresh.js'; diff --git a/src/System Application/App/Resources/RoleCenterSelector/js/RoleCenterSelector.js b/src/System Application/App/Resources/RoleCenterSelector/js/RoleCenterSelector.js index a324e7a1a8..c18e60bb5e 100644 --- a/src/System Application/App/Resources/RoleCenterSelector/js/RoleCenterSelector.js +++ b/src/System Application/App/Resources/RoleCenterSelector/js/RoleCenterSelector.js @@ -45,7 +45,7 @@ function DrawPage() { } function ReplaceFeaturesContent() { - $("#featuretable").remove(); + document.getElementById("featuretable")?.remove(); InsertFeaturesContent(); } diff --git a/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js b/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js index a4a0cdd201..8f603eb06d 100644 --- a/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js +++ b/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js @@ -212,17 +212,18 @@ function DrawLayout(titletxt, subtitletxt, explanationtxt, intro, introDescripti canvas.appendChild(container); - $('#welcomeContainer').attr('role', 'dialog'); - $('#welcomeContainer').attr('aria-describedby', 'welcomeDivTag'); - $('#welcomePic').attr('role', 'presentation'); - $('#tile1Button').attr('aria-labelledby', 'tileDescription1 tileSubDescription1'); - $('#tile2Button').attr('aria-labelledby', 'tileDescription2 tileSubDescription2'); - $('#tile3Button').attr('aria-labelledby', 'tileDescription3 tileSubDescription3'); - $('#legalDescriptionDiv').attr('aria-labelledby', 'legalDiv'); - - $("#tile1Button").click(function(){ThumbnailClick(1);}); - $("#tile2Button").click(function(){ThumbnailClick(2);}); - $("#tile3Button").click(function(){ThumbnailClick(3);}); + const welcomeContainer = document.getElementById("welcomeContainer"); + welcomeContainer?.setAttribute('role', 'dialog'); + welcomeContainer?.setAttribute('aria-describedby', 'welcomeDivTag'); + document.getElementById('welcomePic')?.setAttribute('role', 'presentation'); + document.getElementById('tile1Button')?.setAttribute('aria-labelledby', 'tileDescription1 tileSubDescription1'); + document.getElementById('tile2Button')?.setAttribute('aria-labelledby', 'tileDescription2 tileSubDescription2'); + document.getElementById('tile3Button')?.setAttribute('aria-labelledby', 'tileDescription3 tileSubDescription3'); + document.getElementById('legalDescriptionDiv')?.setAttribute('aria-labelledby', 'legalDiv'); + + document.getElementById('tile1Button')?.addEventListener(() => ThumbnailClick(1)); + document.getElementById('tile2Button')?.addEventListener(() => ThumbnailClick(2)); + document.getElementById('tile3Button')?.addEventListener(() => ThumbnailClick(3)); } function ThumbnailClick(id) From 77b5333e1e4c8e467c3b3f8eff473342474e022d Mon Sep 17 00:00:00 2001 From: Eddy Lynch Date: Wed, 15 Jan 2025 08:41:31 +0000 Subject: [PATCH 4/5] Fixed error adding event listener --- .../Resources/WelcomeWizard/js/WelcomeWizard.js | 6 +++--- .../App/Resources/WelcomeWizard/js/WelcomeWizard.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js b/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js index 8f603eb06d..c4615e6334 100644 --- a/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js +++ b/src/System Application/App/ControlAddIns/Resources/WelcomeWizard/js/WelcomeWizard.js @@ -221,9 +221,9 @@ function DrawLayout(titletxt, subtitletxt, explanationtxt, intro, introDescripti document.getElementById('tile3Button')?.setAttribute('aria-labelledby', 'tileDescription3 tileSubDescription3'); document.getElementById('legalDescriptionDiv')?.setAttribute('aria-labelledby', 'legalDiv'); - document.getElementById('tile1Button')?.addEventListener(() => ThumbnailClick(1)); - document.getElementById('tile2Button')?.addEventListener(() => ThumbnailClick(2)); - document.getElementById('tile3Button')?.addEventListener(() => ThumbnailClick(3)); + document.getElementById('tile1Button')?.addEventListener("click", () => ThumbnailClick(1)); + document.getElementById('tile2Button')?.addEventListener("click", () => ThumbnailClick(2)); + document.getElementById('tile3Button')?.addEventListener("click", () => ThumbnailClick(3)); } function ThumbnailClick(id) diff --git a/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js b/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js index 8f603eb06d..c4615e6334 100644 --- a/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js +++ b/src/System Application/App/Resources/WelcomeWizard/js/WelcomeWizard.js @@ -221,9 +221,9 @@ function DrawLayout(titletxt, subtitletxt, explanationtxt, intro, introDescripti document.getElementById('tile3Button')?.setAttribute('aria-labelledby', 'tileDescription3 tileSubDescription3'); document.getElementById('legalDescriptionDiv')?.setAttribute('aria-labelledby', 'legalDiv'); - document.getElementById('tile1Button')?.addEventListener(() => ThumbnailClick(1)); - document.getElementById('tile2Button')?.addEventListener(() => ThumbnailClick(2)); - document.getElementById('tile3Button')?.addEventListener(() => ThumbnailClick(3)); + document.getElementById('tile1Button')?.addEventListener("click", () => ThumbnailClick(1)); + document.getElementById('tile2Button')?.addEventListener("click", () => ThumbnailClick(2)); + document.getElementById('tile3Button')?.addEventListener("click", () => ThumbnailClick(3)); } function ThumbnailClick(id) From a77ee0f87d139fe1f2c4f90acf9bbcd38fb4959f Mon Sep 17 00:00:00 2001 From: Eddy Lynch Date: Thu, 16 Jan 2025 16:49:28 +0000 Subject: [PATCH 5/5] Safely create message span --- .../Resources/BusinessChart/js/BusinessChartAddIn.js | 4 +++- .../App/Resources/BusinessChart/js/BusinessChartAddIn.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js index 5a01e95c3c..d08d8d59e2 100644 --- a/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/ControlAddIns/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -158,7 +158,9 @@ function validateYAxisRange(chartData) { function createMessage(text) { var element = document.createElement("div"); element.className = getMessageClassName(); - element.innerHTML = '' + text + ''; + var spanElement = document.createElement("span"); + spanElement.innerText = text; + element.appendChild(spanElement); controlAddIn().appendChild(element); } diff --git a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js index 5a01e95c3c..d08d8d59e2 100644 --- a/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js +++ b/src/System Application/App/Resources/BusinessChart/js/BusinessChartAddIn.js @@ -158,7 +158,9 @@ function validateYAxisRange(chartData) { function createMessage(text) { var element = document.createElement("div"); element.className = getMessageClassName(); - element.innerHTML = '' + text + ''; + var spanElement = document.createElement("span"); + spanElement.innerText = text; + element.appendChild(spanElement); controlAddIn().appendChild(element); }