--- /dev/null
+"use strict";function config(e){e.html5Mode(!0)}function IndexController(e,n,o,s,a){function t(e){switch(u){case"salesforce-lightning":c.screenPop({type:c.SCREENPOP_TYPE.SOBJECT,params:{recordId:e.recordId}});break;case"salesforce-classic":c.screenPop("00001002",!0);break;case"salesforce-desk":c.screenPop(e.recordId.toString(),"object=case")}}function l(e,o){n.parent.postMessage({id:"salesforce-classic"===u?"scc_widget_SoftphoneIframe":null,className:"salesforce-lightning"===u?"openctiSoftPhone":null,tag:"salesforce-desk"===u?"iframe":null,uniqueid:o,options:{url:e}},"*")}var i=this,c=null,r=null,u=null,d={},p=null;i.phone="",i.inCall=!1,s.search().mode&&"lightning"===s.search().mode.toLowerCase()?(u="salesforce-lightning",r="js/salesforce/lightning.js",c=sforce.opencti):s.search().type&&"desk"===s.search().type.toLowerCase()?(u="salesforce-desk",r="js/salesforce/interaction-desk.js",c=desk.interaction.cti):(u="salesforce-classic",r="js/salesforce/interaction.js",c=sforce.interaction.cti),i.compose=function(e){i.phone=i.phone.concat(e)},i.remove=function(){i.phone=i.phone.substring(0,i.phone.length-1)},i.hangup=function(){var e=Date.now();d[e]=function(){i.inCall=!1},l("http://localhost:9888/api/hangup",e)},i.dial=function(){var e=Date.now();d[e]=function(){i.inCall=!0},l("http://localhost:9888/api/originate/"+i.phone,e)},angular.element(document.createElement("base")).href=window.location.pathname,a.loadScript(r).then(function(){switch(console.log("Script loaded succesfully",u),u){case"salesforce-lightning":case"salesforce-classic":c.getCallCenterSettings({callback:function(e){i.host=e.returnValue["/Motion/Host"]}}),c.enableClickToDial({callback:function(e){console.log("enableClickToDial")}}),c.onClickToDial({listener:function(e){i.online&&e.number&&(i.phone=e.number,i.dial())}});break;case"salesforce-desk":i.host=s.search().host,desk.ready(function(e){c.enableClickToDial(function(e){console.log("enableClickToDial")}),c.onClickToDial(function(e){i.online&&e.number&&(i.phone=e.number,i.dial())})});break;default:console.log("unknown integration")}}).catch(function(e){console.error(e)}),o(function(){var e=Date.now();d[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);i.id=n.id,i.username=n.username,i.displayName=n.displayName,i.internal=n.internal,i.online=!0,p||i.host&&i.id&&((p=io(i.host,{query:{id:i.id},autoConnect:!1,transports:["websocket","polling"]})).on("trigger:salesforce:display",t),p.on("trigger:desk:display",t)),p&&p.disconnected&&p.connect()}else i.online=!1},l("http://localhost:9888/api/agent",e)},2e3),o(function(){var e=Date.now();d[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);i.inCall=!!n.length}else i.inCall=!1},l("http://localhost:9888/api/calls",e)},2e3),n.addEventListener("message",function(n){var o=n.data;d[o.uniqueid]&&(d[o.uniqueid](o),delete d[o.uniqueid],e.$apply())},!1)}config.$inject=["$locationProvider"],IndexController.$inject=["$scope","$window","$interval","$location","angularLoad"];var motion=angular.module("motion",["ngMaterial","angularLoad"]);motion.config(config),motion.controller("IndexController",IndexController);
\ No newline at end of file
+++ /dev/null
-"use strict";function config(e){e.html5Mode(!0)}function IndexController(e,n,o,i,a){function l(e){sforce.opencti.screenPop({type:sforce.opencti.SCREENPOP_TYPE.SOBJECT,params:{recordId:e.recordId}})}function s(e,o){n.parent.postMessage({id:"salesforce-classic"===c.version?"scc_widget_SoftphoneIframe":null,className:"salesforce-lightning"===c.version?"openctiSoftPhone":null,tag:"salesforce-desk"===c.version?"iframe":null,uniqueid:o,options:{url:e}},"*")}var t,c=this;console.log("$location",i.search()),c.phone="",c.inCall=!1,c.version=null,c.uriVersion=null,i.search().mode&&"lightning"===i.search().mode.toLowerCase()?(c.version="salesforce-lightning",c.uriVersion="js/salesforce/lightning.js"):i.search().type&&"desk"===i.search().type.toLowerCase()?(c.version="salesforce-desk",c.uriVersion="js/salesforce/interaction-desk.js"):(c.version="salesforce-classic",c.uriVersion="js/salesforce/interaction.js"),c.callbacks={},c.compose=function(e){c.phone=c.phone.concat(e)},c.remove=function(){c.phone=c.phone.substring(0,c.phone.length-1)},c.hangup=function(){var e=Date.now();c.callbacks[e]=function(){c.inCall=!1},s("http://localhost:9888/api/hangup",e)},c.dial=function(){var e=Date.now();c.callbacks[e]=function(){c.inCall=!0},s("http://localhost:9888/api/originate/"+c.phone,e)},c.keepalive=function(){var e=Date.now();c.callbacks[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);c.id=n.id,c.displayName=n.displayName,c.internal=n.internal,c.online=!0,t||c.host&&c.id&&(t=io(c.host,{query:{id:c.id},autoConnect:!1,transports:["websocket","polling"]})).on("trigger:salesforce:display",l),t&&t.disconnected&&t.connect()}else c.online=!1},s("http://localhost:9888/api/agent",e)},c.checkStatus=function(){var e=Date.now();c.callbacks[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);c.inCall=!!n.length}else c.inCall=!1},s("http://localhost:9888/api/calls",e)},angular.element(document.createElement("base")).href=window.location.pathname,a.loadScript(c.uriVersion).then(function(){switch(console.log("Script loaded succesfully",c.version),c.version){case"salesforce-lightning":sforce.opencti.getCallCenterSettings({callback:function(e){c.host=e.returnValue["/Motion/Host"]}}),sforce.opencti.enableClickToDial({callback:function(e){console.log("enableClickToDial")}}),sforce.opencti.onClickToDial({listener:function(e){c.online&&e.number&&(c.phone=e.number,c.dial())}});break;case"salesforce-classic":sforce.interaction.cti.getCallCenterSettings({callback:function(e){c.host=e.returnValue["/Motion/Host"]}}),sforce.interaction.cti.enableClickToDial({callback:function(e){console.log("enableClickToDial")}}),sforce.interaction.cti.onClickToDial({listener:function(e){c.online&&e.number&&(c.phone=e.number,c.dial())}});break;case"salesforce-desk":c.host=i.search().host,desk.ready(function(e){desk.interaction.cti.enableClickToDial(function(e){console.log("enableClickToDial")}),desk.interaction.cti.onClickToDial(function(e){c.online&&e.number&&(c.phone=e.number,c.dial())})});break;default:console.log("unknown integration")}}).catch(function(e){console.error(e)}),o(c.keepalive,2e3),o(c.checkStatus,2e3),n.addEventListener("message",function(n){var o=n.data;c.callbacks[o.uniqueid]&&(c.callbacks[o.uniqueid](o),delete c.callbacks[o.uniqueid],e.$apply())},!1)}config.$inject=["$locationProvider"],IndexController.$inject=["$scope","$window","$interval","$location","angularLoad"];var motion=angular.module("motion",["ngMaterial","angularLoad"]);motion.config(config),motion.controller("IndexController",IndexController);
\ No newline at end of file
<html ng-app="motion">
<head>
<meta charset="utf-8">
- <title></title>
+ <title>XCALLY Motion Dialpad</title>
+
+ <link rel="stylesheet" href="vendor.b5ccb327.css">
+
<link rel="stylesheet" href="vendor.b5ccb327.css">
</head>
<body ng-controller="IndexController as vm">
<div layout="row">
<div flex>
<div>
- <span ng-if="!vm.displayName">Agent offline</span>
- <span ng-if="vm.displayName">{{vm.displayName}}, {{vm.internal}}</span>
+ <span ng-if="!(vm.displayName || vm.username)">Agent offline</span>
+ <span ng-if="vm.displayName || vm.username">{{vm.displayName || vm.username}}, {{vm.internal}}</span>
</div>
</div>
<div flex="10" layout="row" layout-align="end center">
document.write("<base href='" + window.location.pathname + "' />");
</script>
- <script src="app.b0167c1d.js"></script>
+ <script src="app.a9c70aec.js"></script>
</body>
</html>