forked from finos/FDC3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request finos#4 from finos-labs/rob-first-version
Rob first version
- Loading branch information
Showing
11 changed files
with
99 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import './app1' | ||
import './app2' | ||
|
||
/** | ||
* This demonstrates getting two separate APIs in the same app, and using them for | ||
* intra-app comms. | ||
*/ |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import { DesktopAgent} from '@finos/fdc3' | ||
import { strategy } from './strategies/post-message' | ||
import { AppIdentifierResolver, DEFAULT_OPTIONS, Options } from './types'; | ||
import { strategy } from './strategies/post-message-load-js' | ||
import { AppIdentifierResolver, DEFAULT_OPTIONS, DesktopAgentDetailResolver, Options } from './types'; | ||
|
||
/** | ||
* This configures the postMessage listener to respond to requests for desktop agent APIs. | ||
* Called by the desktop agent | ||
*/ | ||
export function supply(url: string, resolver: AppIdentifierResolver) { | ||
strategy.supply(url, resolver); | ||
export function supply(url: string, appIdResolver: AppIdentifierResolver, detailsResolver: DesktopAgentDetailResolver) { | ||
strategy.supply(url, appIdResolver, detailsResolver); | ||
} | ||
|
||
|
||
/** | ||
* This return an FDC3 API. Called by Apps. | ||
*/ | ||
export function load(options: Options = DEFAULT_OPTIONS) : Promise<DesktopAgent> { | ||
return strategy.load(options); | ||
|
||
function handleGenericOptions(da: DesktopAgent) { | ||
if ((options.setWindowGlobal) && (window.fdc3 == null)) { | ||
window.fdc3 = da; | ||
} | ||
|
||
return da; | ||
} | ||
|
||
return strategy | ||
.load(options) | ||
.then(da => handleGenericOptions(da)) | ||
} |
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,15 @@ | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>App 3</title> | ||
<meta charset="UTF-8" /> | ||
<script type="module" src="/src/demo/app3.ts"></script> | ||
</head> | ||
|
||
<body> | ||
<p>FDC3 For the Web App3</p> | ||
<button id="broadcast">Press Me To Broadcast</button> | ||
<div id="log"></div> | ||
</body> | ||
|
||
</html> |
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