-
Notifications
You must be signed in to change notification settings - Fork 7
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
Dharmakeerthi De Soysa
committed
Nov 13, 2015
1 parent
b2c105f
commit cc5f205
Showing
5 changed files
with
127 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"path": "http://localhost:8000/page12", "version": "1.0.0", "agent": "displayagent"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,83 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="main.css"> | ||
<script type="text/javascript"> | ||
var currentFrame = "iFrameName1"; | ||
var tempFrame = "iFrameName2"; | ||
var configJsonFile = "current_resource.json"; | ||
var startupHtmlFile = "loading.html"; | ||
var pollingInterval = 2000; | ||
var transitionDelay = 2000; | ||
|
||
function ajax(method, url, successCallback, errorCallback) { | ||
var xhr; | ||
|
||
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari | ||
xhr = new XMLHttpRequest(); | ||
} else { // code for IE6, IE5 | ||
xhr = new ActiveXObject("Microsoft.XMLHTTP"); | ||
} | ||
|
||
xhr.onreadystatechange = function () { | ||
if (xhr.readyState == XMLHttpRequest.DONE) { | ||
if (xhr.status == 200) { if(successCallback) successCallback(xhr.responseText, xhr); | ||
return xhr.responseText; } | ||
else { | ||
if(errorCallback) errorCallback(xhr); | ||
return; | ||
} | ||
} | ||
}; | ||
|
||
xhr.open(method, url, true); | ||
|
||
try { | ||
xhr.send(); | ||
} catch ( e ) { | ||
if ( errorCallback ) { throw e; } | ||
} | ||
} | ||
|
||
function swapFrameRoles(a, b) { | ||
var t = a; | ||
a = b; | ||
b = t; | ||
} | ||
|
||
function swapFrames(a, b){ | ||
document.getElementById(a).style.display = 'none'; | ||
document.getElementById(b).style.display = 'block'; | ||
document.getElementById(a).src = ""; | ||
swapFrameRoles(a, b); | ||
} | ||
|
||
function urlChange(url) { | ||
document.getElementById(tempFrame).src = url; | ||
} | ||
|
||
function getCurrentUrl(currentUrl) { | ||
var newPath = currentUrl; //setting default | ||
var successCallback = function(data){ | ||
var path = JSON.parse(data).path; | ||
//alert(path); | ||
if(path && path != "" && newPath != path) {newPath = path; urlChange(newPath);} | ||
}; | ||
ajax("GET", configJsonFile, successCallback); | ||
setTimeout(function(){getCurrentUrl(newPath)}, pollingInterval); | ||
} | ||
|
||
window.onload = function () { | ||
document.getElementById(tempFrame).onload = function () { | ||
setTimeout(function() {swapFrames(currentFrame, tempFrame)}, transitionDelay); | ||
}; | ||
getCurrentUrl(startupHtmlFile); | ||
}; | ||
</script> | ||
</head> | ||
<body> | ||
<!-- <div id="content">--> | ||
<iframe id="iFrameName1" frameborder="0" src="loading.html" ></iframe> | ||
<iframe id="iFrameName2" frameborder="0" src="" style="display: none;"></iframe> | ||
<!-- </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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<html> | ||
<head> | ||
<title>WSO2 Digital Display</title> | ||
<style type="text/css"> | ||
html { | ||
width:100%; | ||
height:100%; | ||
background:url(digitaldisplay.png) center center no-repeat; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<!-- WSO2 Digital Display 1.0.0 Loading... --> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
body { | ||
margin: 0; | ||
} | ||
|
||
#content { | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
top: 0px; | ||
} | ||
#iFrameName1{ | ||
width: 80%; | ||
height: 100%; | ||
border: 0; | ||
position: absolute; | ||
padding: 0 10%; | ||
overflow:hidden; | ||
} | ||
|
||
#iFrameName2{ | ||
width: 80%; | ||
height: 100%; | ||
border: 0; | ||
position: absolute; | ||
padding: 0 10%; | ||
overflow:hidden; | ||
} |