Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 KB | None | 0 0
  1. <apex:page >
  2. <style type='text/css'>
  3. .embeddedServiceHelpButton .helpButton .uiButton {
  4. background-color: #0B4191;
  5. font-family: "Arial", sans-serif;
  6. min-width: auto;
  7. max-width: auto;
  8.  
  9. }
  10. .embeddedServiceHelpButton .helpButton .uiButton:focus {
  11. outline: 1px solid #0B4191;
  12. }
  13. .embeddedServiceHelpButton .uiButton .helpButtonLabel{
  14. display: none;
  15. }
  16.  
  17. .embeddedServiceSidebarHeader .headerText {
  18. display: flex;
  19. justify-content: center;
  20. align-items: center;
  21. flex-grow: 1;
  22. align-self: stretch;
  23. width: calc(100% - 96px);
  24. color: #fefefe;
  25. text-decoration: none;
  26. line-height: normal;
  27. overflow: hidden;
  28. text-overflow: ellipsis;
  29. white-space: nowrap;
  30. font-weight: normal;
  31. }
  32.  
  33. .embeddedServiceHelpButton .embeddedServiceIcon::before{
  34. display: block;
  35. font-family: "embeddedserviceiconfont";
  36. font-size: 2.25em;
  37. content: attr(data-icon);
  38. speak: none;
  39. text-rendering: auto;
  40. font-weight: normal;
  41. font-variant: normal;
  42. text-transform: none;
  43. -webkit-font-smoothing: antialiased;
  44. }
  45. </style>
  46.  
  47. <script type='text/javascript' src='https://service.force.com/embeddedservice/5.0/esw.min.js'></script>
  48. <script type='text/javascript'>
  49.  
  50. console.log("Iniciando Variables 1");
  51. var url = document.location.href;
  52. var urlName = "";
  53. console.log("El valor de Consola es: " + url);
  54. switch(url){
  55. case "https://c.cs1.visual.force.com/apex/TaTa":
  56. urlName = "Web Ta-ta";
  57. break;
  58. case "https://www.multiahorro.com.uy/":
  59. urlName = "Web MultiAhorro";
  60. break;
  61.  
  62. case "https://www.bas.com.uy/":
  63. urlName = "Web Bas";
  64. break;
  65.  
  66. case "http://plus.uy.s3-website-sa-east-1.amazonaws.com":
  67. urlName = "Web Plus";
  68. break;
  69.  
  70. case "https://www.plan-recambio.com.uy/":
  71. urlName = "Web recambio";
  72. break;
  73.  
  74. }
  75.  
  76. console.log("Valor de urlName es : " + urlName);
  77.  
  78. var initESW = function(gslbBaseURL) {
  79.  
  80.  
  81. embedded_svc.settings.displayHelpButton = true; //O falso
  82. embedded_svc.settings.language = 'es'; //Por ejemplo, introduzca 'en' o 'en-US'
  83.  
  84. embedded_svc.settings.defaultMinimizedText = ''; //(Toma como valor predeterminado Sesión de chat con un experto)
  85. embedded_svc.settings.disabledMinimizedText = 'Dejar un mensaje'; //(Toma como valor predeterminado Agente sin conexión)
  86. embedded_svc.settings.loadingText = 'Cargando...'; //(Toma como valor predeterminado Cargando)
  87.  
  88.  
  89. //Pre-Chat Values
  90. embedded_svc.settings.extraPrechatFormDetails = [
  91. {
  92. "label": "Origen",
  93. "value": urlName,
  94. "displayToAgent": true
  95. }
  96.  
  97. ];
  98.  
  99. embedded_svc.settings.extraPrechatInfo = [
  100.  
  101. {
  102. "entityName": "Contact",
  103. "showOnCreate": false,
  104. "entityFieldMaps": [
  105.  
  106. {
  107. "doCreate":true,
  108. "doFind":false,
  109. "fieldName":"FirstName",
  110. "isExactMatch":true,
  111. "label":"First Name"
  112. },
  113. {
  114. "doCreate":true,
  115. "doFind":false,
  116. "fieldName":"LastName",
  117. "isExactMatch":true,
  118. "label":"Last Name"
  119. }
  120. ]
  121. },
  122.  
  123. {
  124. "entityName": "Case",
  125. "showOnCreate": true,
  126. "saveToTranscript": "CaseId",
  127. "entityFieldMaps": [
  128. {
  129. "doCreate":true,
  130. "doFind":false,
  131. "fieldName":"Origin",
  132. "isExactMatch":true,
  133. "label":"Origen"
  134. },
  135. {
  136. "doCreate":true,
  137. "doFind":false,
  138. "fieldName":"SuppliedName",
  139. "isExactMatch":true,
  140. "label":"First Name"
  141. }
  142. ]
  143. }
  144.  
  145. ];
  146.  
  147. embedded_svc.settings.enabledFeatures = ['LiveAgent'];
  148. embedded_svc.settings.entryFeature = 'LiveAgent';
  149.  
  150. embedded_svc.init(
  151. 'https://cs1.salesforce.com',
  152. 'https://tatafull-tata.cs1.force.com/',
  153. gslbBaseURL,
  154. '00DS0000003EPKO',
  155. 'TATA',
  156. {
  157. baseLiveAgentContentURL: 'https://c.la1-c2cs-ph2.salesforceliveagent.com/content',
  158. deploymentId: '572S00000008Or8',
  159. buttonId: '573S00000008P3O',
  160. baseLiveAgentURL: 'https://d.la1-c2cs-ph2.salesforceliveagent.com/chat',
  161. eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04IS00000004CA6MAM_169136b63cf',
  162. isOfflineSupportEnabled: true
  163. }
  164. );
  165. };
  166.  
  167. if (!window.embedded_svc) {
  168. var s = document.createElement('script');
  169. s.setAttribute('src', 'https://cs1.salesforce.com/embeddedservice/5.0/esw.min.js');
  170. s.onload = function() {
  171. initESW(null);
  172. };
  173. document.body.appendChild(s);
  174. } else {
  175. initESW('https://service.force.com');
  176. }
  177. </script>
  178. </apex:page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement