From 40472ec6f9cb39cb138c8a111ee76fba7c012c44 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 5 Oct 2017 21:22:11 +0200 Subject: [PATCH] subtitle preview --- cdoseaplay/static/index.html | 6 ++++-- cdoseaplay/static/subtitles.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cdoseaplay/static/index.html b/cdoseaplay/static/index.html index 71f0186..f35eb13 100644 --- a/cdoseaplay/static/index.html +++ b/cdoseaplay/static/index.html @@ -1,9 +1,11 @@ diff --git a/cdoseaplay/static/subtitles.js b/cdoseaplay/static/subtitles.js index d9b681d..2525bac 100644 --- a/cdoseaplay/static/subtitles.js +++ b/cdoseaplay/static/subtitles.js @@ -21,21 +21,25 @@ app.render = function() { app.status.subtitles[app.status.current].forEach(function(sub) { if (app.status.currentTime >= sub['in'] && app.status.currentTime < sub.out) { //html += '

' + sub['in'] + ' ' + sub.out + ': ' + sub.value + '' - html += '

' + sub.value + '' - showNext = 10 + html += '

' + sub.value.replace('\n', '
\n') + '
' + showNext = 8 update = true } else if (showNext) { //html += '

' + sub['in'] + ' ' + sub.out + ': ' + sub.value - html += '

' + sub.value + html += '

' + sub.value.replace('\n', '
\n') showNext -= 1 } }) } if (app.status.subtitles[app.status.next]) { + if (showNext) { + html += '

' + app.status.next.slice(0, 1).toUpperCase() + '' + showNext -= 1 + } app.status.subtitles[app.status.next].forEach(function(sub) { if (showNext) { //html += '

' + sub['in'] + ' ' + sub.out + ': ' + sub.value - html += '

' + sub.value + html += '

' + sub.value.replace('\n', '
\n') showNext -= 1 } })