From b1c3af091b893ca8f20355bade1af118e31011b7 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 18 Apr 2012 07:45:17 +0000 Subject: [PATCH] use new api of oxjs video widgets (timeline types) --- static/js/pandora/editor.js | 15 +++++++++++---- static/js/pandora/list.js | 9 +++++---- static/js/pandora/player.js | 8 +++++--- static/js/pandora/timeline.js | 10 +++++++--- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/static/js/pandora/editor.js b/static/js/pandora/editor.js index a81900932..3820ff1fd 100644 --- a/static/js/pandora/editor.js +++ b/static/js/pandora/editor.js @@ -24,11 +24,13 @@ pandora.ui.editor = function(data) { getFrameURL: function(position) { return '/' + pandora.user.ui.item + '/' + pandora.user.ui.videoResolution + 'p' + position + '.jpg'; }, - getLargeTimelineImageURL: function(i) { - return '/' + pandora.user.ui.item + '/timeline64p' + i + '.png'; + getLargeTimelineURL: function(type, i) { + type = ''; + return '/' + pandora.user.ui.item + '/timeline' + type + '64p' + i + '.png'; }, - getSmallTimelineImageURL: function(i) { - return '/' + pandora.user.ui.item + '/timeline16p' + i + '.png'; + getSmallTimelineURL: function(type, i) { + type = ''; + return '/' + pandora.user.ui.item + '/timeline' + type + '16p' + i + '.png'; }, height: pandora.$ui.contentPanel.size(1), id: 'editor', @@ -54,6 +56,8 @@ pandora.ui.editor = function(data) { showLayers: Ox.clone(pandora.user.ui.showLayers), showUsers: pandora.site.annotations.showUsers, subtitles: data.subtitles, + timeline: pandora.user.ui.videoTimeline, + timelines: pandora.site.timelines, tooltips: true, video: data.video, videoRatio: data.videoRatio, @@ -216,6 +220,9 @@ pandora.ui.editor = function(data) { subtitles: function(data) { pandora.UI.set('videoSubtitles', data.subtitles); }, + timeline: function(data) { + pandora.UI.set('videoTimeline', data.timeline); + }, togglecalendar: function(data) { pandora.UI.set('showAnnotationsCalendar', !data.collapsed); }, diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index e22fac896..8471f8524 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -305,8 +305,9 @@ pandora.ui.list = function() { options: { duration: data.duration, find: isClipsQuery ? clipsQuery.conditions[0].value : '', - getImageURL: function(i) { - return '/' + data.id + '/timeline16p' + i + '.png'; + getImageURL: function(type, i) { + type = ''; + return '/' + data.id + '/timeline' + type + '16p' + i + '.png'; }, position: pandora.user.ui.videoPoints[data.id] ? pandora.user.ui.videoPoints[data.id].position : 0, @@ -314,9 +315,9 @@ pandora.ui.list = function() { return {'in': clip['in'], out: clip.out}; }) : [], subtitles: isClipsQuery ? data.clips.map(function(clip) { - Ox.Log('', 'CLIP:::::', clip) return {'in': clip['in'], out: clip.out, text: clip.annotations[0].value}; - }) : [] + }) : [], + type: pandora.user.ui.videoTimeline } } }; diff --git a/static/js/pandora/player.js b/static/js/pandora/player.js index 022b32811..1166511d3 100644 --- a/static/js/pandora/player.js +++ b/static/js/pandora/player.js @@ -20,8 +20,9 @@ pandora.ui.player = function(data) { enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel, enableSubtitles: pandora.user.ui.videoSubtitles, find: pandora.user.ui.itemFind, - getTimelineImageURL: function(i) { - return '/' + pandora.user.ui.item + '/timeline64p' + i + '.png'; + getLargeTimelineURL: function(type, i) { + type = ''; + return '/' + pandora.user.ui.item + '/timeline' + type + '64p' + i + '.png'; }, height: pandora.$ui.contentPanel.size(1), 'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'], @@ -40,9 +41,10 @@ pandora.ui.player = function(data) { showLayers: Ox.clone(pandora.user.ui.showLayers), showUsers: pandora.site.annotations.showUsers, showTimeline: pandora.user.ui.showTimeline, + smallTimelineURL: '/' + pandora.user.ui.item + '/timeline16p.png', subtitles: data.subtitles, + timeline: pandora.user.ui.videoTimeline, tooltips: true, - timeline: '/' + pandora.user.ui.item + '/timeline16p.png', video: data.video, volume: pandora.user.ui.videoVolume, width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 diff --git a/static/js/pandora/timeline.js b/static/js/pandora/timeline.js index aac2e6847..3006d3f23 100644 --- a/static/js/pandora/timeline.js +++ b/static/js/pandora/timeline.js @@ -21,8 +21,9 @@ pandora.ui.timeline = function(data) { getFrameURL: function(position) { return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg'; }, - getTimelineImageURL: function(i) { - return '/' + ui.item + '/timeline64p' + i + '.png'; + getLargeTimelineURL: function(type, i) { + type = ''; + return '/' + ui.item + '/timeline' + type + '64p' + i + '.png'; }, height: pandora.$ui.contentPanel.size(1), layers: data.annotations, @@ -37,8 +38,8 @@ pandora.ui.timeline = function(data) { showAnnotationsMap: ui.showAnnotationsMap, showLayers: Ox.clone(ui.showLayers), showUsers: pandora.site.annotations.showUsers, + smallTimelineURL: '/' + ui.item + '/timeline16p.png', timeline: ui.videoTimeline, - timelineImageURL: '/' + ui.item + '/timeline16p.png', timelines: pandora.site.timelines, video: data.video, videoRatio: data.videoRatio, @@ -82,6 +83,9 @@ pandora.ui.timeline = function(data) { select: function(data) { pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]); }, + timeline: function(data) { + pandora.UI.set('videoTimeline', data.timeline); + }, toggleannotations: function(data) { pandora.UI.set('showAnnotations', data.showAnnotations); },