Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
vendors:cisco:uc:ece:custom-buttons [2026/02/12 12:59] – [page1.html] gerardorourkevendors:cisco:uc:ece:custom-buttons [2026/02/25 15:54] (current) – [page1.html] gerardorourke
Line 40: Line 40:
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {
             if (data.Value>0){             if (data.Value>0){
- var sound = new Audio("https://ece-webserver.example.com/templates/chat/core/common/media/21.0.0/notify.wav"); sound.play(); 
  alert("Badge count is now: " + data.Value);  alert("Badge count is now: " + data.Value);
  }  }
Line 141: Line 140:
 <script language=javascript> <script language=javascript>
 function showChatButton() { function showChatButton() {
-  document.getElementById("chatBtn").style.display = "inline-block";+    document.getElementById("chatBtn").style.display = "inline-block";
 } }
  
 function hideChatButton() { function hideChatButton() {
-  document.getElementById("chatBtn").style.display = "none";+    document.getElementById("chatBtn").style.display = "none";
 } }
- 
  
 window.addEventListener("message", function (event) { window.addEventListener("message", function (event) {
Line 153: Line 151:
         const data = JSON.parse(event.data);         const data = JSON.parse(event.data);
  
- // This shows all ECE events to console (so disable / comment out this console output in production) +        // This shows all ECE events to console (so disable / comment out this console output in production) 
- console.log("MESSAGE RECEIVED:", event.data);+        console.log("MESSAGE RECEIVED:", event.data);
  
         // Detect minimize         // Detect minimize
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MINIMIZE") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MINIMIZE") {
- showChatButton();+            showChatButton();
         }         }
  
         // Detect maximize         // Detect maximize
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MAXIMIZE") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MAXIMIZE") {
- hideChatButton();+            hideChatButton(); 
 +            // Screen reader announcement 
 +            var announcer = document.getElementById("sr-announcer"); 
 +            announcer.textContent = ""; // Clear Screen Reader
         }         }
  
- // Detect Close Chat (this is only needed on 'chat' pages +        // Detect Close Chat (this is only needed on 'chat' pages 
- if (data.Caller === "EGLV_DOCK_CALLER_RESET" && data.Key === ""){ +        if (data.Caller === "EGLV_DOCK_CALLER_RESET" && data.Key === "") { 
- showChatButton();+            showChatButton();
         }         }
  
- // Detect badge count update+        // Detect badge count update
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {
             var unread = data.Value;             var unread = data.Value;
- if (unread > 0){ +            if (unread > 0) { 
- document.getElementById("chatBtn").innerText = "Resume Chat - Unread Messages: " + unread; +                document.getElementById("chatBtn").innerText = "Resume Chat - Unread Messages: " + unread; 
- +                var announcer document.getElementById("sr-announcer"); 
- // Play audio alert (download and host on your own webserver) +                if (unread === 1{ 
- var sound new Audio("https://webchat-test.example.com/templates/chat/core/common/media/21.0.0/notify.wav"); +                    // Screen reader announcement 
- sound.play()+                    announcer.textContent "Chat message received. You have 1 unread message."; 
- +                } else { 
- // Screen reader announcement +                    announcer.textContent = "Chat message received. You have " + unread + " unread messages."; 
- var announcer = document.getElementById("sr-announcer")+                } 
- announcer.textContent = "Chat message received. You have " + unread + " unread messages."; +            }
- }+
         }         }
  
Line 281: Line 281:
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MAXIMIZE") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "EG_MAXIMIZE") {
  hideChatButton();  hideChatButton();
 +            // Clear Screen reader announcement Text
 +            var announcer = document.getElementById("sr-announcer");
 +            announcer.textContent = ""; // Clear Screen Reader
 +
         }         }
  
- // Detect badge count update+        // Detect badge count update
         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {         if (data.Caller === "EGLV_DOCK_CALLER_SET" && data.Key === "egBadgeCount") {
             var unread = data.Value;             var unread = data.Value;
- if (unread > 0){ +            if (unread > 0) { 
- document.getElementById("chatBtn").innerText = "Resume Chat - Unread Messages: " + unread; +                document.getElementById("chatBtn").innerText = "Resume Chat - Unread Messages: " + unread; 
- // Play audio alert (download and host on your own webserver) +                var announcer document.getElementById("sr-announcer"); 
- var sound new Audio("https://webchat-test.example.com/templates/chat/core/common/media/21.0.0/notify.wav"); +                if (unread === 1{ 
- sound.play()+                    // Screen reader announcement 
- +                    announcer.textContent "Chat message received. You have 1 unread message."; 
- // Screen reader announcement +                } else { 
- var announcer = document.getElementById("sr-announcer")+                    announcer.textContent = "Chat message received. You have " + unread + " unread messages."; 
- announcer.textContent = "Chat message received. You have " + unread + " unread messages."; +                } 
- }+            }
         }         }
  
  • vendors/cisco/uc/ece/custom-buttons.1770901191.txt.gz
  • Last modified: 2026/02/12 12:59
  • by gerardorourke