From 69fec4e84274d70104804feadde6fe253b001c15 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 18 Jun 2014 15:31:41 +0200 Subject: [PATCH] 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 --- public/js/vroom.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index a91f284..c5b770e 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -868,7 +868,8 @@ function initVroom(room) { showLineNumbers: false, height: maxHeight()-7 + 'px', 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; updateDisplayName('local'); 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 $('#displayNamePre').on('input', function() {