Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a toolbox directory and the FDC3 Explained app #367

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
53cd01c
Merge pull request #3 from finos/master
donbasuno Jan 17, 2020
ff49da2
OpenFin Manifest for test page
donbasuno Jan 29, 2020
d06e9b5
Basic FDC3 demo app
donbasuno Jan 29, 2020
ea52a26
Changing url
donbasuno Jan 30, 2020
13844fd
Local version
donbasuno Jan 30, 2020
ef9994e
Removing
donbasuno Jan 30, 2020
5cffe7a
Minor updates
donbasuno Feb 21, 2020
015b35f
Updating FDC3 check
donbasuno Feb 25, 2020
22cd023
Adding file
donbasuno Mar 6, 2020
3f2915a
Create test.html
donbasuno Apr 8, 2020
1b432e2
New version
donbasuno May 21, 2020
7dc7b18
Adding basic receive file
donbasuno May 21, 2020
a62de00
Update fdc3_explained.html
donbasuno May 21, 2020
64e3d35
Delete test.html
donbasuno May 22, 2020
8f04737
Delete receive.html
donbasuno May 22, 2020
0aa25b1
Create receive.html
donbasuno May 22, 2020
a3f0e5a
Update fdc3_explained.html
donbasuno May 22, 2020
d462c5b
Create runtime_app.json
donbasuno May 22, 2020
d9b79ac
Delete fdc3_explained.json
donbasuno May 22, 2020
8249e8e
Create service_app.json
donbasuno May 22, 2020
9a3968f
Fetching channels from API
donbasuno Jun 12, 2020
87eb93d
Fixing app link
donbasuno Jun 19, 2020
2e59d4c
Update fdc3_explained.html
donbasuno Oct 9, 2020
4a09c69
Update fdc3_explained.html
mpthan Oct 29, 2020
23df140
Merge pull request #4 from mpthan/master
donbasuno Oct 29, 2020
bf83b53
split into html,js and css
WatsonCIQ Feb 5, 2021
5cc3978
All elements of fdc3-explained working as expected
WatsonCIQ Feb 6, 2021
44daa77
add raise intent
WatsonCIQ Feb 6, 2021
335dc93
add name for Finsemble
WatsonCIQ Feb 6, 2021
2f9e1df
added todo
WatsonCIQ Feb 6, 2021
4c50cb6
Remove app loader.
WatsonCIQ Feb 8, 2021
ad658f3
Update broadcast and contextListener.
WatsonCIQ Feb 8, 2021
c659472
background of white
WatsonCIQ Feb 8, 2021
da95f93
add catches for errors with messages
WatsonCIQ Feb 8, 2021
2fd6139
Update toolbox/fdc3-explained/index.html
WatsonCIQ Feb 9, 2021
6e0ab38
Update toolbox/fdc3-explained/index.html
WatsonCIQ Feb 9, 2021
39a38d2
Update toolbox/fdc3-explained/index.html
WatsonCIQ Feb 9, 2021
11a4397
Update toolbox/fdc3-explained/index.html
WatsonCIQ Feb 9, 2021
a4d05d2
Merge pull request #5 from WatsonCIQ/fdc3_explained-1.0.1
donbasuno Feb 15, 2021
261776e
Add files via upload
donbasuno Feb 15, 2021
434632a
Update legacy.html
donbasuno Feb 15, 2021
ffb0ebb
Add files via upload
donbasuno Feb 15, 2021
a59d9a8
Update fdc3_explained.html
donbasuno Feb 15, 2021
5d31aab
Update fdc3_explained.html
donbasuno Feb 15, 2021
e18a459
Update index.html
donbasuno Feb 15, 2021
88e0adb
Update fdc3_explained.html
donbasuno Feb 15, 2021
10fd706
split app into versioned folders
WatsonCIQ Feb 15, 2021
73c1cf3
change url to 1.1 versionand file location
WatsonCIQ Feb 15, 2021
5222ba0
revert the polling solution to check for FDC3 in version 1.1
WatsonCIQ Feb 15, 2021
83fc8b9
add FDC3 supported version
WatsonCIQ Feb 15, 2021
c90019b
add links to full versions
WatsonCIQ Feb 15, 2021
f402107
Add a version section
WatsonCIQ Feb 15, 2021
dae3b17
defer the javascript unti page load
WatsonCIQ Feb 15, 2021
bca6fae
defer the javascript unti page load
WatsonCIQ Feb 15, 2021
ef0d1b1
Merge branch 'multi-site-support' of https://github.com/WatsonCIQ/FDC…
WatsonCIQ Feb 15, 2021
8a38b65
moved the let up in scope due to initialization error
WatsonCIQ Feb 15, 2021
5340149
style the dropdowns
WatsonCIQ Feb 16, 2021
0c58cc0
remove inline events move to event listeners
WatsonCIQ Feb 16, 2021
23b7441
add eventListeners, version selector and fix add app channel list.
WatsonCIQ Feb 16, 2021
b78359a
ensure 1.1 has the same changes as 1.2
WatsonCIQ Feb 16, 2021
e8e4fbe
ensure content is center at all sizes
WatsonCIQ Feb 16, 2021
33e1c1d
Merge pull request #6 from WatsonCIQ/multi-site-support
donbasuno Feb 18, 2021
aa9f7b0
Add files via upload
donbasuno Feb 18, 2021
ac1d6c7
Update fdc3_explained.html
donbasuno Feb 18, 2021
1a3328c
Update index.html
donbasuno Feb 18, 2021
47b3978
Update index.html
donbasuno Feb 18, 2021
18f2018
Update index.html
donbasuno Feb 18, 2021
5228d9d
Update index.html
donbasuno Feb 18, 2021
72beefb
Update index.html
donbasuno Feb 18, 2021
2347d23
Update legacy.html
donbasuno Feb 18, 2021
df468dc
Update legacy.html
donbasuno Feb 18, 2021
29b67c1
Add files via upload
donbasuno Feb 18, 2021
e7b43d9
Update fdc3_explained.html
donbasuno Feb 18, 2021
c1896ee
Update runtime_app.json
donbasuno Feb 18, 2021
50be9b0
Update service_app.json
donbasuno Feb 18, 2021
86514fa
Adding tests for OpenFin platform with fdc3
donbasuno Jun 9, 2021
29a640c
Update service_app.json
donbasuno Jun 9, 2021
4eee101
Update legacy.html
donbasuno Jul 8, 2021
85fb3c4
Update legacy.html
donbasuno Jul 8, 2021
e2dacee
Update legacy.html
donbasuno Jul 8, 2021
da236f9
Update legacy.html
donbasuno Jul 8, 2021
c6493e6
Update legacy.html
donbasuno Jul 8, 2021
77c2c31
Adding an rt19 version
donbasuno Sep 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions toolbox/demoapps/receive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<html>

<head>
<title>
FDC3 Receive
</title>

<script language="javascript">

<!-- Check if FDC3 is avaialable -->

function fdc3Init(callback){
let fdc3Tries = 10; //lets not check forever...
const onFDC3Ready = () => {
if (window.fdc3) {
callback.call(this);
}
else {
if (fdc3Tries > 0){
fdc3Tries--;
window.setTimeout(onFDC3Ready,100);
}
}
};
onFDC3Ready();
}

<!-- Enable Functionality when FDC3 is available -->

document.addEventListener("DOMContentLoaded",() => {
fdc3Init(function(){
enablePage();
});
});

<!-- Various poor examples of FDC3 functionality -->

function enablePage(){

console.log('FDC3 is available');

if(window.fin){
fin.desktop.Application.getCurrent().getInfo((info) => {document.getElementById('providerDetails').innerHTML = 'Available - ' + info.manifest.startup_app.name})
} else {
document.getElementById('providerDetails').innerHTML = 'Available - Not specified';
}

document.getElementById('btnClearContext').disabled = false;
document.getElementById('txtContextData').disabled = false;

fdc3.addContextListener(function(ctx){
document.getElementById('txtContextData').value = JSON.stringify(ctx) + '\n-----------\n' + document.getElementById('txtContextData').value;
});

}

</script>

<style>

textarea {width:400px;height:100px;}

select {width:238px;height:24px;}

.ctxInput {width:241px;height:24px;}

.urlInput {width:400px;height:24px;}

.header {width:200px;height:40px;font-weight:700;}

</style>

</head>

<body>

<table border="1">

<tr>
<td class="header">FDC3 Provider Service:</td>
<td><span id="providerDetails">FDC3 Not Available</span></td>
</tr>

<tr>
<td colspan="3"><hr></td>
</tr>

<tr>
<td class="header">Context:</td>
<td><textarea id="txtContextData" disabled></textarea></td>
<td><input type="button" value="Clear" id="btnClearContext" onClick="document.getElementById('txtContextData').value='';" disabled></td>
</tr>

</table>

</body>

</html>
233 changes: 233 additions & 0 deletions toolbox/fdc3-explained/1.0/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
<html>

<head>
<title>
FDC3 Explained
</title>

<script type=module>
import setVersionList from '../versions.js';

// <!-- Various global stuff -->
var channelArray = [];

// <!-- Check if FDC3 is avaialable -->
function fdc3Init(callback){
let fdc3Tries = 10; //lets not check forever...
const onFDC3Ready = () => {
if (window.fdc3) {
callback.call(this);
}
else {
if (fdc3Tries > 0){
fdc3Tries--;
window.setTimeout(onFDC3Ready,100);
}
}
};
onFDC3Ready();
}

// <!-- Enable application when FDC3 is available -->
document.addEventListener("DOMContentLoaded",() => {

fdc3Init(async () => {

const systemChannels = await fdc3.getSystemChannels();

systemChannels.forEach(channel => {
const thisChannel = channel;
channelArray.push(channel.id);
//alert(channel.id);
//createChannelRow(channel);
//listeners[channel.id] = channel.addContextListener((context) => {updateChannelRow(thisChannel, context);});
});
//populateChannels(channelArray);
enablePage();
});

// set the versions of FDC3 Explained in the dropdown
setVersionList()
});

function enablePage(){

console.log('FDC3 is available');

// <!-- Special case for Openfin to read App Name -->
if (window.FSBL){
window.FSBL.getFSBLInfo().then((info) => {
document.getElementById('providerDetails').innerHTML = 'Available - Finsemble ' + info.FSBLVersion;
});
} else if (window.fin){
fin.desktop.Application.getCurrent().getInfo((info) => {
document.getElementById('providerDetails').innerHTML = 'Available - ' + info.manifest.startup_app.name});
} else {
document.getElementById('providerDetails').innerHTML = 'Available - Not specified';
}
document.getElementById('directoryDetails').innerHTML = 'TBD';

// <!-- enable page obects -->
document.getElementById('btnBroadcast').disabled = false;
document.getElementById('txtBroadcastData').disabled = false;
document.getElementById('selBroadcastChannel').disabled = false;
document.getElementById('btnFetchChannels').disabled = false;
document.getElementById('txtAvailableChannels').disabled = false;

}

// <!-- Various poor examples of FDC3 functionality -->

function populateChannels(channelArray){

var i;
var selChannel = document.getElementById('selBroadcastChannel');
var txtChannels = document.getElementById('txtAvailableChannels');
var selOption;

txtChannels.value = channelArray;

for (i = 0; i < channelArray.length; i++) {
selOption = document.createElement("option");
selOption.text = channelArray[i];
selChannel.add(selOption);
}

}

function broadcastFDC3Context(){

var myContextData = document.getElementById('txtBroadcastData');
var ctx = JSON.parse(myContextData.value);
fdc3.broadcast(ctx);
//document.getElementById('txtBroadcastData').value = '';

}

function changeBroadcastChannel(){

alert('Not implemented yet!');
document.getElementById('selBroadcastChannel').selectedIndex = 0;

}

function appLoader(){

var myUrl = document.getElementById('appUrl').value;

if (myUrl.length>0){

window.open(myUrl);

}
}

</script>

<style>

textarea {width:400px;height:100px;}

select {width:238px;height:24px;}

.ctxInput {width:241px;height:24px;}

.urlInput {width:400px;height:24px;}

.header {width:200px;height:40px;font-weight:700;}

</style>

</head>

<body>

<table border="1">
<tr>
<td colspan="3" style="text-align:center;">Back to <a href="../../fdc3_explained.html">main page</a>.</td>
</tr>
<tr>
<td class="header">FDC3 Provider Service:</td>
<td><span id="providerDetails">FDC3 Not Available</span></td>

<tr>
<td class="header">FDC3 Supported Version:</td>
<td>1.1 </td>
<td>
<select id="versions" onchange="window.location.href=`../${this.value}`">
<option value="" disabled style="display:none;" selected>Change Version</option>
</select>

</td>
</tr>

<tr>
<td colspan="3"><hr></td>
</tr>

<tr>
<td class="header">App Directory:</td>
<td><span id="directoryDetails">No Application Directory Connected</span></td>
<td><input type="button" value="Connect" disabled></td>
</tr>

<tr>
<td class="header">Available Apps:</td>
<td><textarea disabled></textarea></td>
<td><input type="button" value="Fetch" disabled></td>
</tr>

<tr>
<td class="header">Load App Start Url:</td>
<td><input type="text" id="appUrl" class="urlInput" value="demoapps/receive.html"></td>
<td><input type="button" value="Open" onClick="appLoader();"></td>
</tr>

<tr>
<td colspan="3"><hr></td>
</tr>

<tr>
<td class="header">Available Channels:</td>
<td><textarea disabled id="txtAvailableChannels"></textarea></td>
<td><input type="button" value="Fetch" id="btnFetchChannels" disabled onClick="populateChannels(channelArray);">&nbsp;<input type="button" value="Add" disabled></td>
</tr>

<tr>
<td colspan="3"><hr></td>
</tr>

<tr>
<td class="header" rowspan="2">Broadcast Context:</td>
<td>Channel: <select id="selBroadcastChannel" disabled onChange="changeBroadcastChannel();"></select></td>
<td rowspan="2"><input type="button" value="Send" id="btnBroadcast" disabled onClick="broadcastFDC3Context();"></td>
</tr>

<tr>
<td><textarea id="txtBroadcastData" disabled>{"id":{"ISIN":"US0378331005","SEDOL":"2046251","ticker":"AAPL"},"name":"Apple Inc.","type":"fdc3.instrument"}
</textarea></td>
</tr>

<tr>
<td colspan="3"><hr></td>
</tr>

<tr>
<td class="header" rowspan="3">Get Context:</td>
<td>Channel: <select disabled></td>
<td rowspan="3"><input type="button" value="Fetch" disabled></td>
</tr>

<tr>
<td>Context: <input type="text" class="ctxInput" disabled></td>
</tr>

<tr>
<td><textarea disabled></textarea></td>
</tr>

</table>

</body>

</html>
Loading