Use our displayName in etherpad

And reload the etherpad iFram when you change your name
Usefull in the timeline, where you can see who wrote what
master
Daniel Berteaud 11 years ago
parent c3543a77b5
commit 69fec4e842
  1. 13
      public/js/vroom.js

@ -868,7 +868,8 @@ function initVroom(room) {
showLineNumbers: false, showLineNumbers: false,
height: maxHeight()-7 + 'px', height: maxHeight()-7 + 'px',
border: 2, border: 2,
userColor: peers.local.color userColor: peers.local.color,
userName: peers.local.displayName
}); });
} }
@ -1455,6 +1456,16 @@ function initVroom(room) {
peers.local.displayName = name; peers.local.displayName = name;
updateDisplayName('local'); updateDisplayName('local');
webrtc.sendDirectlyToAll('vroom', 'setDisplayName', name); webrtc.sendDirectlyToAll('vroom', 'setDisplayName', name);
lastNameChange = +new Date;
// Should we reload etherpad iFrame with this new name ?
if (etherpad.enabled){
// Wait ~3 sec and reload etherpad
setTimeout(function(){
if (lastNameChange && lastNameChange + 3000 < +new Date){
loadEtherpadIframe();
}
}, 3100);
}
}); });
// This is the displayName input before joining the room // This is the displayName input before joining the room
$('#displayNamePre').on('input', function() { $('#displayNamePre').on('input', function() {

Loading…
Cancel
Save