diff options
author | MaZderMind | 2015-12-21 12:01:57 +0100 |
---|---|---|
committer | MaZderMind | 2015-12-21 12:01:57 +0100 |
commit | 44ed963ca873fb7cda35e56ff6b11887c257ad1b (patch) | |
tree | 1dc67a4e128437b4620bc0faa8e7d02b5863d27f /assets/js | |
parent | 03a9d969953df0a49df7bcb3fcb8df4d969220e0 (diff) |
show subtitles-silence-message after some time
Diffstat (limited to '')
-rw-r--r-- | assets/js/lustige-subtitles.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/assets/js/lustige-subtitles.js b/assets/js/lustige-subtitles.js index e8df92b..ac62879 100644 --- a/assets/js/lustige-subtitles.js +++ b/assets/js/lustige-subtitles.js @@ -96,6 +96,8 @@ function openSocket() var primus = Primus.connect(baseurl); window.primus_connection = primus; + window.silence_warning = window.setTimeout(showSilenceWarning, 10*1000); + primus.on('open', function() { primus.emit('join', room); @@ -116,10 +118,17 @@ function openSocket() if (text && text.trim().length > 0 && roomId == room) { //console.log('line', roomId, userId, text, color); appendLine(text); + window.clearTimeout(window.silence_warning); + window.silence_warning = window.setTimeout(showSilenceWarning, 60*1000); } }); } +function showSilenceWarning() +{ + appendLine('*silence*'); +} + function appendLine(line) { var |