From 4841e2c0a87a9b819876ec8af83c09868ad552ae Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 22 Apr 2012 09:57:49 +0000 Subject: [PATCH] implement 'cantPlay' config options --- pandora/config.0xdb.jsonc | 5 +++++ static/js/pandora/editor.js | 5 +++++ static/js/pandora/player.js | 8 ++++++++ static/js/pandora/timeline.js | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/pandora/config.0xdb.jsonc b/pandora/config.0xdb.jsonc index 417464ecf..cab51f1a3 100644 --- a/pandora/config.0xdb.jsonc +++ b/pandora/config.0xdb.jsonc @@ -12,6 +12,11 @@ "annotations": { "showUsers": false }, + "cantPlay": { + "icon": "NoCopyright", + "link": "/rights", + "text": "This part of this video is not available in
your part of your country. Sorry for that." + }, /* Capabilities are per user level. They can either be general: diff --git a/static/js/pandora/editor.js b/static/js/pandora/editor.js index 8ebf03038..fba77bed6 100644 --- a/static/js/pandora/editor.js +++ b/static/js/pandora/editor.js @@ -14,6 +14,8 @@ pandora.ui.editor = function(data) { annotationsSize: pandora.user.ui.annotationsSize, annotationsSort: pandora.user.ui.annotationsSort, censored: data.censored, + censoredIcon: pandora.site.cantPlay.icon, + censoredTooltip: pandora.site.cantPlay.text, clickLink: pandora.clickLink, cuts: data.cuts || [], duration: data.duration, @@ -106,6 +108,9 @@ pandora.ui.editor = function(data) { annotationssort: function(data) { pandora.UI.set({annotationsSort: data.sort}); }, + censored: function() { + pandora.URL.push(pandora.site.cantPlay.link); + }, define: function(data) { var dialog = data.type + 'sDialog'; pandora.$ui[dialog] && pandora.$ui[dialog].remove(); diff --git a/static/js/pandora/player.js b/static/js/pandora/player.js index 1166511d3..0a9b019c1 100644 --- a/static/js/pandora/player.js +++ b/static/js/pandora/player.js @@ -14,6 +14,8 @@ pandora.ui.player = function(data) { annotationsSize: pandora.user.ui.annotationsSize, annotationsSort: pandora.user.ui.annotationsSort, censored: data.censored, + censoredIcon: pandora.site.cantPlay.icon, + censoredTooltip: pandora.site.cantPlay.text, clickLink: pandora.clickLink, cuts: data.cuts || [], duration: data.duration, @@ -61,6 +63,12 @@ pandora.ui.player = function(data) { annotationssort: function(data) { pandora.UI.set({annotationsSort: data.sort}); }, + censored: function() { + pandora.$ui.player.options('fullscreen') && pandora.$ui.player.options({ + fullscreen: false + }); + pandora.URL.push(pandora.site.cantPlay.link); + }, downloadvideo: function(data) { document.location.href = '/' + pandora.user.ui.item + '/torrent/'; }, diff --git a/static/js/pandora/timeline.js b/static/js/pandora/timeline.js index 3006d3f23..383fba8d5 100644 --- a/static/js/pandora/timeline.js +++ b/static/js/pandora/timeline.js @@ -14,6 +14,8 @@ pandora.ui.timeline = function(data) { annotationsSize: ui.annotationsSize, annotationsSort: ui.annotationsSort, censored: data.censored, + censoredIcon: pandora.site.cantPlay.icon, + censoredTooltip: pandora.site.cantPlay.text, clickLink: pandora.clickLink, cuts: data.cuts || [], duration: data.duration, @@ -59,6 +61,9 @@ pandora.ui.timeline = function(data) { annotationssort: function(data) { pandora.UI.set({annotationsSort: data.sort}); }, + censored: function() { + pandora.URL.push(pandora.site.cantPlay.link); + }, follow: function(data) { pandora.UI.set('followPlayer', data.follow); },