-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
851 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,13 @@ | |
"author": "[email protected]", | ||
"license": "SEE LICENSE IN LICENSE.MD", | ||
"dependencies": { | ||
"@finos/fdc3": "^2.1.0-beta.8", | ||
"@openfin/cloud-interop": "^0.4.0", | ||
"@openfin/core-web": "^0.38.41", | ||
"@finos/fdc3": "2.0.3", | ||
"@openfin/cloud-interop": "0.38.42", | ||
"@openfin/core-web": "^0.38.42", | ||
"buffer": "^6.0.3" | ||
}, | ||
"devDependencies": { | ||
"@openfin/core": "38.81.41", | ||
"@openfin/core": "38.81.42", | ||
"@openfin/node-adapter": "34.78.80", | ||
"copy-webpack-plugin": "^12.0.2", | ||
"eslint": "8.57.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ | |
"author": "[email protected]", | ||
"license": "SEE LICENSE IN LICENSE.MD", | ||
"dependencies": { | ||
"@finos/fdc3": "^2.1.0-beta.8", | ||
"@openfin/core-web": "^0.38.41", | ||
"@finos/fdc3": "2.0.3", | ||
"@openfin/core-web": "^0.38.42", | ||
"buffer": "^6.0.3" | ||
}, | ||
"devDependencies": { | ||
"@openfin/core": "38.81.41", | ||
"@openfin/core": "38.81.42", | ||
"@openfin/node-adapter": "34.78.80", | ||
"eslint": "8.57.0", | ||
"eslint-config-airbnb": "19.0.4", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { Context } from "@finos/fdc3"; | ||
import { init } from "../platform/api"; | ||
|
||
window.addEventListener("DOMContentLoaded", async () => { | ||
// setTimeout(async () => { | ||
await init(false); | ||
await initializeDOM(); | ||
// }, 1000); | ||
}); | ||
|
||
/** | ||
* Adds an FDC3 context listener to the window. | ||
*/ | ||
async function addFDC3Listener(): Promise<void> { | ||
if (window.fdc3) { | ||
await window.fdc3.addContextListener(null, (context) => { | ||
updateDOMElements(context); | ||
}); | ||
} else { | ||
window.addEventListener("fdc3Ready", async () => { | ||
await window.fdc3.addContextListener(null, (context) => { | ||
updateDOMElements(context); | ||
}); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Updates the DOM elements with the provided context. | ||
* @param context The context to update the DOM elements with. | ||
*/ | ||
function updateDOMElements(context: Context): void { | ||
const contextTypeSpan = document.querySelector<HTMLSpanElement>("#contextType"); | ||
const contextNameSpan = document.querySelector<HTMLSpanElement>("#contextName"); | ||
const contextBodyPre = document.querySelector<HTMLPreElement>("#contextBody"); | ||
|
||
if (contextTypeSpan !== null && contextNameSpan !== null && contextBodyPre !== null) { | ||
contextTypeSpan.textContent = context.type; | ||
contextNameSpan.textContent = context.name ?? "No name provided."; | ||
contextBodyPre.textContent = JSON.stringify(context, null, 2); | ||
} | ||
} | ||
|
||
/** | ||
* Initialize the DOM elements. | ||
*/ | ||
async function initializeDOM(): Promise<void> { | ||
await addFDC3Listener(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.