From: Daniele Cinti Date: Wed, 23 Aug 2017 16:58:18 +0000 (+0200) Subject: Built xcally-motion-dialpad from commit 082cb75.|1.0.92 X-Git-Tag: 1.0.92 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=c53530800ae14ec89b9951396ed114c8706cc301;p=dialpad.git Built xcally-motion-dialpad from commit 082cb75.|1.0.92 --- diff --git a/app.2f80ec19.js b/app.2f80ec19.js new file mode 100644 index 0000000..28a8be9 --- /dev/null +++ b/app.2f80ec19.js @@ -0,0 +1 @@ +"use strict";function config(e){e.html5Mode(!0)}function IndexController(e,n,o,t,s){function a(e){r.host=e.returnValue["/Motion/Host"]}function i(e){r.online&&e.number&&(r.phone=e.number,r.dial())}function c(e){switch(f){case"salesforce-lightning":sforce.opencti.screenPop({type:u.SCREENPOP_TYPE.SOBJECT,params:{recordId:e.recordId}});break;case"salesforce-classic":sforce.interaction.cti.screenPop("00001002",!0);break;case"salesforce-desk":desk.interaction.cti.screenPop(e.recordId.toString(),"object=case");break;default:console.log("unknown integration")}}function l(e,o){n.parent.postMessage({id:"salesforce-classic"===f?"scc_widget_SoftphoneIframe":null,className:"salesforce-lightning"===f?"openctiSoftPhone":null,tag:"salesforce-desk"===f?"iframe":null,uniqueid:o,options:{url:e}},"*")}var r=this,u=null,d=null,f=null,p={},g=null;r.phone="",r.inCall=!1,r.compose=function(e){r.phone=r.phone.concat(e)},r.remove=function(){r.phone=r.phone.substring(0,r.phone.length-1)},r.hangup=function(){var e=Date.now();p[e]=function(){r.inCall=!1},l("http://localhost:9888/api/hangup",e)},r.dial=function(){var e=Date.now();p[e]=function(){r.inCall=!0},l("http://localhost:9888/api/originate/"+r.phone,e)},t.search().mode&&"lightning"===t.search().mode.toLowerCase()?(f="salesforce-lightning",d="js/salesforce/lightning.js"):t.search().type&&"desk"===t.search().type.toLowerCase()?(f="salesforce-desk",d="js/salesforce/interaction-desk.js"):(f="salesforce-classic",d="js/salesforce/interaction.js"),angular.element(document.createElement("base")).href=window.location.pathname,s.loadScript(d).then(function(){switch(console.log("Script loaded succesfully",f),f){case"salesforce-lightning":sforce.opencti.getCallCenterSettings({callback:a}),sforce.opencti.enableClickToDial(),sforce.opencti.onClickToDial({listener:i});break;case"salesforce-classic":sforce.interaction.cti.getCallCenterSettings({callback:a}),sforce.interaction.cti.enableClickToDial(),sforce.interaction.cti.onClickToDial({listener:i});break;case"salesforce-desk":r.host=t.search().host,desk.ready(function(e){desk.interaction.cti.enableClickToDial(),desk.interaction.cti.onClickToDial(i)});break;default:console.log("unknown integration")}}).catch(function(e){console.error(e)}),o(function(){var e=Date.now();p[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);r.id=n.id,r.username=n.username,r.displayName=n.displayName,r.internal=n.internal,r.online=!0,g||r.host&&r.id&&((g=io(r.host,{query:{id:r.id},autoConnect:!1,transports:["websocket","polling"]})).on("trigger:salesforce:display",c),g.on("trigger:desk:display",c)),g&&g.disconnected&&g.connect()}else r.online=!1},l("http://localhost:9888/api/agent",e)},2e3),o(function(){var e=Date.now();p[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);r.inCall=!!n.length}else r.inCall=!1},l("http://localhost:9888/api/calls",e)},2e3),n.addEventListener("message",function(n){var o=n.data;p[o.uniqueid]&&(p[o.uniqueid](o),delete p[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 diff --git a/app.6ebb5569.js b/app.6ebb5569.js deleted file mode 100644 index 80c81ea..0000000 --- a/app.6ebb5569.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";function config(e){e.html5Mode(!0)}function IndexController(e,n,o,t,a){function i(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 s(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 l=this,c=null,r=null,u=null,f={},d=null;l.phone="",l.inCall=!1,l.compose=function(e){l.phone=l.phone.concat(e)},l.remove=function(){l.phone=l.phone.substring(0,l.phone.length-1)},l.hangup=function(){var e=Date.now();f[e]=function(){l.inCall=!1},s("http://localhost:9888/api/hangup",e)},l.dial=function(){var e=Date.now();f[e]=function(){l.inCall=!0},s("http://localhost:9888/api/originate/"+l.phone,e)},t.search().mode&&"lightning"===t.search().mode.toLowerCase()?(u="salesforce-lightning",r="js/salesforce/lightning.js"):t.search().type&&"desk"===t.search().type.toLowerCase()?(u="salesforce-desk",r="js/salesforce/interaction-desk.js"):(u="salesforce-classic",r="js/salesforce/interaction.js"),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":sforce.opencti.getCallCenterSettings({callback:function(e){l.host=e.returnValue["/Motion/Host"]}}),sforce.opencti.enableClickToDial({callback:function(e){console.log("enableClickToDial")}}),sforce.opencti.onClickToDial({listener:function(e){l.online&&e.number&&(l.phone=e.number,l.dial())}});break;case"salesforce-classic":sforce.interaction.cti.getCallCenterSettings({callback:function(e){l.host=e.returnValue["/Motion/Host"]}}),sforce.interaction.cti.enableClickToDial({callback:function(e){console.log("enableClickToDial")}}),sforce.interaction.cti.onClickToDial({listener:function(e){l.online&&e.number&&(l.phone=e.number,l.dial())}});break;case"salesforce-desk":l.host=t.search().host,desk.ready(function(e){desk.interaction.cti.enableClickToDial(function(e){console.log("enableClickToDial")}),desk.interaction.cti.onClickToDial(function(e){l.online&&e.number&&(l.phone=e.number,l.dial())})});break;default:console.log("unknown integration")}}).catch(function(e){console.error(e)}),o(function(){var e=Date.now();f[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);l.id=n.id,l.username=n.username,l.displayName=n.displayName,l.internal=n.internal,l.online=!0,d||l.host&&l.id&&((d=io(l.host,{query:{id:l.id},autoConnect:!1,transports:["websocket","polling"]})).on("trigger:salesforce:display",i),d.on("trigger:desk:display",i)),d&&d.disconnected&&d.connect()}else l.online=!1},s("http://localhost:9888/api/agent",e)},2e3),o(function(){var e=Date.now();f[e]=function(e){if(e.response&&e.response.status>=200&&e.response.status<300){var n=JSON.parse(e.response.message);l.inCall=!!n.length}else l.inCall=!1},s("http://localhost:9888/api/calls",e)},2e3),n.addEventListener("message",function(n){var o=n.data;f[o.uniqueid]&&(f[o.uniqueid](o),delete f[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 diff --git a/index.html b/index.html index a024a2f..7d608b0 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@ document.write(""); - +