From 09f30b3c5ae3351e27fbb044fe926f932a76d865 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 13 Sep 2014 23:59:23 +0200 Subject: [PATCH] subtitles in edits --- static/js/editPanel.js | 14 +++++++------- static/js/utils.js | 14 +++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/static/js/editPanel.js b/static/js/editPanel.js index bf8a9aaf..938d6776 100644 --- a/static/js/editPanel.js +++ b/static/js/editPanel.js @@ -58,13 +58,13 @@ pandora.ui.editPanel = function(isEmbed) { } function getVideos() { - var videos = {}; - pandora.site.video.resolutions.forEach(function(resolution) { - videos[resolution] = Ox.flatten(edit.clips.filter(function(clip) { - return clip.duration; - }).map(function(clip) { - return pandora.getClipVideos(clip, resolution); - })); + var videos = []; + edit.clips.filter(function(clip) { + return clip.duration; + }).map(function(clip) { + pandora.site.video.resolutions.forEach(function(resolution) { + videos = videos.concat(pandora.getClipVideos(clip, resolution)); + }); }); return videos; } diff --git a/static/js/utils.js b/static/js/utils.js index 90e7b4fe..7c1853a6 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1734,6 +1734,14 @@ pandora.getStatusText = function(data) { return parts.join(', '); }; +pandora.getSubtitlesLayer = function() { + return pandora.site.layers.filter(function(layer) { + return layer.isSubtitles; + }).map(function(layer) { + return layer.id; + })[0]; +} + pandora.getMediaURL = function(url) { return pandora.site.site.mediaprefix + url; }; @@ -1753,11 +1761,7 @@ pandora.getVideoOptions = function(data) { var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel, canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel, options = {}; - options.subtitlesLayer = pandora.site.layers.filter(function(layer) { - return layer.isSubtitles; - }).map(function(layer) { - return layer.id; - })[0]; + options.subtitlesLayer = pandora.getSubtitlesLayer(); options.censored = canPlayVideo ? [] : canPlayClips ? (