implement 'cantPlay' config options

This commit is contained in:
rolux 2012-04-22 09:57:49 +00:00
parent 7660f171ee
commit 4841e2c0a8
4 changed files with 23 additions and 0 deletions

View file

@ -12,6 +12,11 @@
"annotations": { "annotations": {
"showUsers": false "showUsers": false
}, },
"cantPlay": {
"icon": "NoCopyright",
"link": "/rights",
"text": "This part of this video is not available in<br/>your part of your country. Sorry for that."
},
/* /*
Capabilities are per user level. Capabilities are per user level.
They can either be general: They can either be general:

View file

@ -14,6 +14,8 @@ pandora.ui.editor = function(data) {
annotationsSize: pandora.user.ui.annotationsSize, annotationsSize: pandora.user.ui.annotationsSize,
annotationsSort: pandora.user.ui.annotationsSort, annotationsSort: pandora.user.ui.annotationsSort,
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text,
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,
@ -106,6 +108,9 @@ pandora.ui.editor = function(data) {
annotationssort: function(data) { annotationssort: function(data) {
pandora.UI.set({annotationsSort: data.sort}); pandora.UI.set({annotationsSort: data.sort});
}, },
censored: function() {
pandora.URL.push(pandora.site.cantPlay.link);
},
define: function(data) { define: function(data) {
var dialog = data.type + 'sDialog'; var dialog = data.type + 'sDialog';
pandora.$ui[dialog] && pandora.$ui[dialog].remove(); pandora.$ui[dialog] && pandora.$ui[dialog].remove();

View file

@ -14,6 +14,8 @@ pandora.ui.player = function(data) {
annotationsSize: pandora.user.ui.annotationsSize, annotationsSize: pandora.user.ui.annotationsSize,
annotationsSort: pandora.user.ui.annotationsSort, annotationsSort: pandora.user.ui.annotationsSort,
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text,
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,
@ -61,6 +63,12 @@ pandora.ui.player = function(data) {
annotationssort: function(data) { annotationssort: function(data) {
pandora.UI.set({annotationsSort: data.sort}); 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) { downloadvideo: function(data) {
document.location.href = '/' + pandora.user.ui.item + '/torrent/'; document.location.href = '/' + pandora.user.ui.item + '/torrent/';
}, },

View file

@ -14,6 +14,8 @@ pandora.ui.timeline = function(data) {
annotationsSize: ui.annotationsSize, annotationsSize: ui.annotationsSize,
annotationsSort: ui.annotationsSort, annotationsSort: ui.annotationsSort,
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text,
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,
@ -59,6 +61,9 @@ pandora.ui.timeline = function(data) {
annotationssort: function(data) { annotationssort: function(data) {
pandora.UI.set({annotationsSort: data.sort}); pandora.UI.set({annotationsSort: data.sort});
}, },
censored: function() {
pandora.URL.push(pandora.site.cantPlay.link);
},
follow: function(data) { follow: function(data) {
pandora.UI.set('followPlayer', data.follow); pandora.UI.set('followPlayer', data.follow);
}, },