*
*/
-var mainCanvas, bgCanvas, buttonCanvas;
-var mainCtx, bgCtx, buttonCtx, mouseCtx;
+var mainCanvas, bgCanvas, buttonCanvas,callCanvas;
+var mainCtx, bgCtx, buttonCtx, mouseCtx, callCtx;
var drawn = false;
var screenHeight;
var screenWidth;
$(buttonCanvas).attr('height', screenHeight);
$(mouseClicksLayer).attr('width', screenWidth);
$(mouseClicksLayer).attr('height', screenHeight);
+ $(callCanvas).attr('width', screenWidth);
+ $(callCanvas).attr('height', screenHeight);
if (currentPage)
initPages();
function init()
{
+ document.documentElement.style.overflow = 'hidden';
var activeAccount = null;
var listener = {
"onAccountUpdated": function(account) {},
bgCanvas = document.getElementById("bgCanvas");
buttonCanvas = document.getElementById("buttonCanvas");
mouseClicksLayer = document.getElementById("mouseClicks");
+ callCanvas = document.getElementById("callCanvas");
mainCtx = mainCanvas.getContext("2d");
bgCtx = bgCanvas.getContext("2d");
buttonCtx = buttonCanvas.getContext("2d");
mouseCtx = mouseClicksLayer.getContext("2d");
+ callCtx = callCanvas.getContext("2d");
var sources = {
phoneIcon: "images/bluetooth-smartphone.png",
initCallPage(currentState);
updateNumber(call.callData.LineIdentification);
updateCallStateText("Incoming Call...");
- switchMenu(callPage);
+ animateIncoming();
+ //switchMenu(callPage);
},
onDialing: function(call) {
activeCall = call;
activeCall = call;
},
onDisconnected: function(call, disconnectReason) {
- activeCall = null;
- stopTimer();
- switchMenu(mainPage);
+ if (currentState !== "idle")
+ {
+ currentState = "idle";
+ activeCall = null;
+ stopTimer();
+ animateFinished();
+ }
+ //switchMenu(mainPage);
},
onDisconnecting: function(call) {
- stopTimer();
- switchMenu(mainPage);
+ if (currentState !== "idle")
+ {
+ currentState = "idle";
+ stopTimer();
+ animateFinished();
+ }
+ //switchMenu(mainPage);
},
onAccepted: function(call) {
startTimer();
+ initButtons("activeCall");
updateCallStateText("Active");
+ callPage.drawMenu();
activeCall = call;
},
onActivated: function(call) {
- updateCallStateText("Active");
startTimer();
+ initButtons("activeCall");
+ updateCallStateText("Active");
+ callPage.drawMenu();
+ activeCall = call;
},
onError: function(call){
console.log("onError: "); console.log(call);
function switchMenu(nextMenu)
{
- currentPage.visible = false;
+ //currentPage.visible = false;
currentPage = nextMenu;
currentPage.visible = true;
currentPage.drawMenu();