From 03124c51162be0e95d7e0c53b6080ea5fa028f18 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 1 Feb 2012 07:13:46 +0000 Subject: [PATCH] hookup annotation state to video player view --- static/js/pandora/item.js | 25 +++++++++++++++++++++---- static/js/pandora/utils.js | 3 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 50daf0eaf..a7d4739a9 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -121,11 +121,13 @@ pandora.ui.item = function() { } else if (pandora.user.ui.itemView == 'video') { pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.player = Ox.VideoPanel({ + annotationsCalendarSize: pandora.user.ui.annotationsCalendarSize, annotationsFont: pandora.user.ui.annotationsFont, + annotationsMapSize: pandora.user.ui.annotationsMapSize, annotationsRange: pandora.user.ui.annotationsRange, annotationsSize: pandora.user.ui.annotationsSize, annotationsSort: pandora.user.ui.annotationsSort, - censored: videoOptions.censored, + censored: videoOptions.censored, clickLink: pandora.clickLink, cuts: result.data.cuts || [], duration: result.data.duration, @@ -144,7 +146,10 @@ pandora.ui.item = function() { resolution: pandora.user.ui.videoResolution, scaleToFill: pandora.user.ui.videoScale == 'fill', showAnnotations: pandora.user.ui.showAnnotations, + showAnnotationsCalendar: pandora.user.ui.showAnnotationsCalendar, + showAnnotationsMap: pandora.user.ui.showAnnotationsMap, showLayers: pandora.user.ui.showLayers, + showUsers: pandora.site.annotations.showUsers, showTimeline: pandora.user.ui.showTimeline, showUsers: pandora.site.annotations.showUsers, subtitles: videoOptions.subtitles, @@ -184,6 +189,12 @@ pandora.ui.item = function() { resizeannotations: function(data) { pandora.UI.set('annotationsSize', data.annotationsSize); }, + resizecalendar: function(data) { + pandora.UI.set('annotationsCalendarSize', data.size); + }, + resizemap: function(data) { + pandora.UI.set('annotationsMapSize', data.size); + }, resolution: function(data) { pandora.UI.set('videoResolution', data.resolution); }, @@ -193,6 +204,12 @@ pandora.ui.item = function() { subtitles: function(data) { pandora.UI.set('videoSubtitles', data.subtitles); }, + togglemap: function(data) { + pandora.UI.set('showAnnotationsMap', !data.collapsed); + }, + togglesize: function(data) { + pandora.UI.set({videoSize: data.size}); + }, toggleannotations: function(data) { pandora.UI.set('showAnnotations', data.showAnnotations); }, @@ -299,10 +316,10 @@ pandora.ui.item = function() { pandora.$ui.placesDialog && pandora.$ui.placesDialog.remove(); pandora.$ui.placesDialog = pandora.ui.placesDialog(data).open(); }, - downloadVideo: function(data) { + downloadvideo: function(data) { document.location.href = '/' + pandora.user.ui.item + '/torrent/'; }, - downloadSelection: function(data) { + downloadselection: function(data) { document.location.href = [ '/', pandora.user.ui.item, @@ -337,7 +354,7 @@ pandora.ui.item = function() { }, callback); } }, - embedSelection: function(data) { + embedselection: function(data) { pandora.$ui.embedDialog && pandora.$ui.embedDialog.remove(); pandora.$ui.embedDialog = pandora.ui.embedDialog(data).open(); }, diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index bf0ae1548..f4cd3cb90 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -175,7 +175,8 @@ pandora.changeListStatus = function(id, status, callback) { }; pandora.clickLink = function(e) { - if (e.target.hostname == document.location.hostname) { + if (e.target.hostname == document.location.hostname + && !Ox.starts(e.target.pathname, '/static')) { pandora.URL.push(e.target.pathname); } else { window.open('/url=' + encodeURIComponent(e.target.href), '_blank');