Skip to content

Commit

Permalink
Merge pull request #6 from WatsonCIQ/multi-site-support
Browse files Browse the repository at this point in the history
Multi site support + new 1.2 version with new UI
  • Loading branch information
donbasuno authored Feb 18, 2021
2 parents 88e0adb + e8e4fbe commit 33e1c1d
Show file tree
Hide file tree
Showing 10 changed files with 675 additions and 62 deletions.
56 changes: 35 additions & 21 deletions toolbox/legacy.html → toolbox/fdc3-explained/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
FDC3 Explained v.2
</title>

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

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

<!-- Check if FDC3 is avaialable -->
// <!-- Check if FDC3 is avaialable -->
function fdc3Init(callback){
let fdc3Tries = 10; //lets not check forever...
const onFDC3Ready = () => {
Expand All @@ -27,13 +28,13 @@
onFDC3Ready();
}

<!-- Enable application when FDC3 is available -->
// <!-- 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);
Expand All @@ -44,13 +45,16 @@
//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 -->

// <!-- Special case for Openfin to read App Name -->
if (window.FSBL){
window.FSBL.getFSBLInfo().then((info) => {
document.getElementById('providerDetails').innerHTML = 'Available - Finsemble ' + info.FSBLVersion;
Expand All @@ -62,17 +66,17 @@
document.getElementById('providerDetails').innerHTML = 'Available - Not specified';
}
document.getElementById('directoryDetails').innerHTML = 'TBD';
<!-- enable page obects -->

// <!-- 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 -->

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

function populateChannels(channelArray){

Expand Down Expand Up @@ -101,34 +105,34 @@
}

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;}
textarea {width:400px;height:100px;}

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

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

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

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

Expand All @@ -143,6 +147,16 @@
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta charset="UTF-8">
<link rel="stylesheet" href="./styles.css">
<script src="./main.js"></script>
<script type="module" src="./main.js" defer></script>

</head>

Expand All @@ -34,6 +34,17 @@
<td><span id="providerDetails">FDC3 Not Available</span></td>
</tr>

<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>
Expand All @@ -43,7 +54,7 @@
<tr>
<td class="header">App Directory:</td>
<td><span id="directoryDetails">Not supported yet!</span></td>
<td><input type="button" value="Connect" disabled></td>
<td><input type="button" value="Connect" class="not-supported" disabled></td>
</tr>

<tr>
Expand Down Expand Up @@ -71,15 +82,15 @@
<tr>
<td class="header">Add App Channel:</td>
<td><input id="app-channel"></input></td>
<td><Button type="button" onclick="addAppChannel()">Add</Button></td>
<td><Button type="button" id="add-app-channel__btn" disabled>Add</Button></td>
</tr>

<tr>
<td class="header">Join Channel:</td>
<td>Channel: <select class="fdc3-channels" id="join-channel"></select>
<Button type="button" onclick="joinChannel()">Join</Button>
<Button type="button" id="join-channel__btn" disabled>Join</Button>
</td>
<td><Button type="button" onclick="fdc3.leaveCurrentChannel()">Leave</Button></td>
<td><Button type="button" id="leave-channel__btn" disabled>Leave</Button></td>
</tr>

<tr>
Expand All @@ -94,7 +105,7 @@
<tr>
<td><textarea id="txtBroadcastData">{"id":{"ISIN":"US0378331005","SEDOL":"2046251","ticker":"AAPL"},"name":"Apple Inc.","type":"fdc3.instrument"}
</textarea></td>
<td rowspan="2"><input type="button" value="Send" id="btnBroadcast" onclick="broadcastFDC3Context();">
<td rowspan="2"><Button type="button" id="broadcast__btn" disabled>Send</Button>
</td>
</tr>

Expand Down Expand Up @@ -126,12 +137,11 @@

<tr>
<td><textarea id="intent-context">{"id":{"ISIN":"US0378331005","SEDOL":"2046251","ticker":"AAPL"},"name":"Apple Inc.","type":"fdc3.instrument"}</textarea></td>
<td><Button onclick="raiseIntent()">Raise Intent </Button></td>
<td><Button id="raise-intent__btn" disabled>Raise Intent </Button></td>
</tr>

</table>
</div>

</body>

</html>
Loading

0 comments on commit 33e1c1d

Please sign in to comment.