1212 a .button { display : inline-block; padding : 10px 14px ; background : # 0969da ; color : # fff ; border-radius : 6px ; text-decoration : none; cursor : pointer; }
1313 a .button : hover { background : # 0758b7 ; }
1414 a .button .disabled { background : # ccc ; cursor : not-allowed; }
15-
1615 </ style >
1716</ head >
1817< body >
@@ -21,6 +20,7 @@ <h1 id="welcome-message">Benvenuto!</h1>
2120 < p class ="email " id ="email-line "> </ p >
2221
2322 < a id ="btn-open-chat " class ="button disabled "> Caricamento Chat...</ a >
23+
2424 < div style ="margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; ">
2525 < button onclick ="logout() " style ="background: none; border: none; color: #dc3545; cursor: pointer; text-decoration: underline; font-size: 14px; ">
2626 Esci e cambia utente
@@ -61,21 +61,17 @@ <h1 id="welcome-message">Benvenuto!</h1>
6161 try {
6262 const userEmail = localStorage . getItem ( 'email' ) || '' ;
6363 console . log ( "1. Email recuperata:" , userEmail ) ;
64- //sezione setting
65- //setting lingua
66- embeddedservice_bootstrap . settings . language = 'it' ; //va passata per ogni sito con lingua diversa da Italiano
67- // imposta false per bloccare la scrittura da parte dell'utente mentre che l'agente sta rispondendo
68- embeddedservice_bootstrap . settings . enableUserInputForConversationWithBot = false ;
69-
70-
71-
7264
65+ // --- SEZIONE SETTINGS ---
66+ embeddedservice_bootstrap . settings . language = 'it' ;
7367
74- // Evento
68+ // BLOCCO SCRITTURA UTENTE (Correttamente posizionato qui!)
69+ embeddedservice_bootstrap . settings . enableUserInputForConversationWithBot = false ;
70+
71+ // --- EVENT LISTENER ---
7572 window . addEventListener ( "onEmbeddedMessagingReady" , ( ) => {
7673 console . log ( "2. EVENTO RICEVUTO: Messaging Ready!" ) ;
7774
78- //funzione salesforce - Usare la stessa variabile - CaseSensitive - Json con tutti i parametri
7975 try {
8076 embeddedservice_bootstrap . prechatAPI . setHiddenPrechatFields ( {
8177 "Login_Email_Consulente" : userEmail
@@ -91,7 +87,7 @@ <h1 id="welcome-message">Benvenuto!</h1>
9187 btn . classList . remove ( 'disabled' ) ;
9288 } ) ;
9389
94- // Chat agent case support - Inserimento del nome dell'embeeded service
90+ // --- INIT ---
9591 embeddedservice_bootstrap . init (
9692 '00DfZ000000Aod3' ,
9793 'Case_Support_Agent_With_variable' ,
@@ -100,16 +96,16 @@ <h1 id="welcome-message">Benvenuto!</h1>
10096 scrt2URL : 'https://chogangroup--devai1.sandbox.my.salesforce-scrt.com'
10197 }
10298 ) ;
103- // Se arriviamo qui senza errori, l'init è partita.
104- // Ora aspettiamo l'evento "onEmbeddedMessagingReady" definito sopra.
10599
106100 } catch ( err ) {
107- console . error ( 'Eccezione ne llo script di init: ' , err ) ;
101+ console . error ( 'Eccezione nello script di init: ' , err ) ;
108102 }
109103 } ;
110104 </ script >
111105
112106 < script type ='text/javascript ' src ='https://chogangroup--devai1.sandbox.my.site.com/ESWCaseSupportAgentTes1764164304917/assets/js/bootstrap.min.js ' onload ='initEmbeddedMessaging() '> </ script >
113107
108+ < script src ="script.js "> </ script >
109+
114110</ body >
115111</ html >
0 commit comments