mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 02:16:16 -04:00
feat(admin): Added shoutout to admin panel (#6346)
* Added shoutout * Added shoutout function * Fixed test. * Included feedback from review. * Removed unnecessary file
This commit is contained in:
parent
d64924e9f5
commit
e12be96102
14 changed files with 467 additions and 214 deletions
|
@ -250,11 +250,27 @@ const handshake = async () => {
|
|||
socket.on('disconnect', (reason) => {
|
||||
// The socket.io client will automatically try to reconnect for all reasons other than "io
|
||||
// server disconnect".
|
||||
console.log(`Socket disconnected: ${reason}`)
|
||||
if (reason !== 'io server disconnect') return;
|
||||
socketReconnecting();
|
||||
socket.connect();
|
||||
});
|
||||
|
||||
|
||||
socket.on('shout', (obj) => {
|
||||
if(obj.type === "COLLABROOM") {
|
||||
let date = new Date(obj.data.payload.timestamp);
|
||||
$.gritter.add({
|
||||
// (string | mandatory) the heading of the notification
|
||||
title: 'Admin message',
|
||||
// (string | mandatory) the text inside the notification
|
||||
text: '[' + date.toLocaleTimeString() + ']: ' + obj.data.payload.message.message,
|
||||
// (bool | optional) if you want it to fade out on its own or just sit there
|
||||
sticky: obj.data.payload.message.sticky
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('reconnecting', socketReconnecting);
|
||||
|
||||
socket.on('reconnect_failed', (error) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue