Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page >
- <style type='text/css'>
- .embeddedServiceHelpButton .helpButton .uiButton {
- background-color: #0B4191;
- font-family: "Arial", sans-serif;
- min-width: auto;
- max-width: auto;
- }
- .embeddedServiceHelpButton .helpButton .uiButton:focus {
- outline: 1px solid #0B4191;
- }
- .embeddedServiceHelpButton .uiButton .helpButtonLabel{
- display: none;
- }
- .embeddedServiceSidebarHeader .headerText {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-grow: 1;
- align-self: stretch;
- width: calc(100% - 96px);
- color: #fefefe;
- text-decoration: none;
- line-height: normal;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-weight: normal;
- }
- .embeddedServiceHelpButton .embeddedServiceIcon::before{
- display: block;
- font-family: "embeddedserviceiconfont";
- font-size: 2.25em;
- content: attr(data-icon);
- speak: none;
- text-rendering: auto;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- -webkit-font-smoothing: antialiased;
- }
- </style>
- <script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
- <script type='text/javascript'>
- console.log("Iniciando Variables 1");
- var url = document.location.href;
- var urlName = "";
- console.log("El valor de Consola es: " + url);
- switch(url){
- case "https://c.cs1.visual.force.com/apex/TaTa":
- urlName = "Web Ta-ta";
- break;
- case "https://www.multiahorro.com.uy/":
- urlName = "Web MultiAhorro";
- break;
- case "https://www.bas.com.uy/":
- urlName = "Web Bas";
- break;
- case "http://plus.uy.s3-website-sa-east-1.amazonaws.com":
- urlName = "Web Plus";
- break;
- case "https://www.plan-recambio.com.uy/":
- urlName = "Web recambio";
- break;
- }
- console.log("Valor de urlName es : " + urlName);
- var initESW = function(gslbBaseURL) {
- embedded_svc.settings.displayHelpButton = true; //O falso
- embedded_svc.settings.language = 'es'; //Por ejemplo, introduzca 'en' o 'en-US'
- embedded_svc.settings.defaultMinimizedText = ''; //(Toma como valor predeterminado Sesión de chat con un experto)
- embedded_svc.settings.disabledMinimizedText = 'Dejar un mensaje'; //(Toma como valor predeterminado Agente sin conexión)
- embedded_svc.settings.loadingText = 'Cargando...'; //(Toma como valor predeterminado Cargando)
- //Pre-Chat Values
- embedded_svc.settings.extraPrechatFormDetails = [
- {
- "label": "Origen",
- "value": urlName,
- "displayToAgent": true
- }
- ];
- embedded_svc.settings.extraPrechatInfo = [
- {
- "entityName": "Contact",
- "showOnCreate": false,
- "entityFieldMaps": [
- {
- "doCreate":true,
- "doFind":false,
- "fieldName":"FirstName",
- "isExactMatch":true,
- "label":"First Name"
- },
- {
- "doCreate":true,
- "doFind":false,
- "fieldName":"LastName",
- "isExactMatch":true,
- "label":"Last Name"
- }
- ]
- },
- {
- "entityName": "Case",
- "showOnCreate": true,
- "saveToTranscript": "CaseId",
- "entityFieldMaps": [
- {
- "doCreate":true,
- "doFind":false,
- "fieldName":"Origin",
- "isExactMatch":true,
- "label":"Origen"
- },
- {
- "doCreate":true,
- "doFind":false,
- "fieldName":"SuppliedName",
- "isExactMatch":true,
- "label":"First Name"
- }
- ]
- }
- ];
- embedded_svc.settings.enabledFeatures = ['LiveAgent'];
- embedded_svc.settings.entryFeature = 'LiveAgent';
- embedded_svc.init(
- 'https://cs1.salesforce.com',
- 'https://tatafull-tata.cs1.force.com/',
- gslbBaseURL,
- '00DS0000003EPKO',
- 'TATA',
- {
- baseLiveAgentContentURL: 'https://c.la1-c2cs-ph2.salesforceliveagent.com/content',
- deploymentId: '572S00000008Or8',
- buttonId: '573S00000008P3O',
- baseLiveAgentURL: 'https://d.la1-c2cs-ph2.salesforceliveagent.com/chat',
- eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04IS00000004CA6MAM_169136b63cf',
- isOfflineSupportEnabled: true
- }
- );
- };
- if (!window.embedded_svc) {
- var s = document.createElement('script');
- s.setAttribute('src', 'https://cs1.salesforce.com/embeddedservice/5.0/esw.min.js');
- s.onload = function() {
- initESW(null);
- };
- document.body.appendChild(s);
- } else {
- initESW('https://service.force.com');
- }
- </script>
- </apex:page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement