forked from 0x2620/pandora
enable timeline types
This commit is contained in:
parent
494adb5959
commit
1f6abbe32f
4 changed files with 487 additions and 471 deletions
|
@ -4,249 +4,252 @@
|
||||||
|
|
||||||
pandora.ui.editor = function(data) {
|
pandora.ui.editor = function(data) {
|
||||||
|
|
||||||
// fixme: var ui = pandora.user.ui;
|
var ui = pandora.user.ui,
|
||||||
|
|
||||||
return Ox.VideoEditor({
|
that = Ox.VideoEditor({
|
||||||
annotationsCalendarSize: pandora.user.ui.annotationsCalendarSize,
|
annotationsCalendarSize: ui.annotationsCalendarSize,
|
||||||
annotationsFont: pandora.user.ui.annotationsFont,
|
annotationsFont: ui.annotationsFont,
|
||||||
annotationsMapSize: pandora.user.ui.annotationsMapSize,
|
annotationsMapSize: ui.annotationsMapSize,
|
||||||
annotationsRange: pandora.user.ui.annotationsRange,
|
annotationsRange: ui.annotationsRange,
|
||||||
annotationsSize: pandora.user.ui.annotationsSize,
|
annotationsSize: ui.annotationsSize,
|
||||||
annotationsSort: pandora.user.ui.annotationsSort,
|
annotationsSort: ui.annotationsSort,
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: pandora.site.cantPlay.text,
|
censoredTooltip: pandora.site.cantPlay.text,
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
cuts: data.cuts || [],
|
cuts: data.cuts || [],
|
||||||
duration: data.duration,
|
duration: data.duration,
|
||||||
enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel,
|
enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel,
|
||||||
enableImport: pandora.site.capabilities.canImportAnnotations[pandora.user.level],
|
enableImport: pandora.site.capabilities.canImportAnnotations[pandora.user.level],
|
||||||
enableSetPosterFrame: !pandora.site.media.importFrames && data.editable,
|
enableSetPosterFrame: !pandora.site.media.importFrames && data.editable,
|
||||||
enableSubtitles: pandora.user.ui.videoSubtitles,
|
enableSubtitles: ui.videoSubtitles,
|
||||||
find: pandora.user.ui.itemFind,
|
find: ui.itemFind,
|
||||||
getFrameURL: function(position) {
|
getFrameURL: function(position) {
|
||||||
return '/' + pandora.user.ui.item + '/' + pandora.user.ui.videoResolution + 'p' + position + '.jpg';
|
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg';
|
||||||
},
|
},
|
||||||
getLargeTimelineURL: function(type, i) {
|
getLargeTimelineURL: function(type, i) {
|
||||||
return '/' + pandora.user.ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||||
},
|
},
|
||||||
getSmallTimelineURL: function(type, i) {
|
getSmallTimelineURL: function(type, i) {
|
||||||
return '/' + pandora.user.ui.item + '/timeline' + type + '16p' + i + '.jpg';
|
return '/' + ui.item + '/timeline' + type + '16p' + i + '.jpg';
|
||||||
},
|
},
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
id: 'editor',
|
id: 'editor',
|
||||||
'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'],
|
'in': ui.videoPoints[ui.item]['in'],
|
||||||
layers: data.annotations.map(function(layer) {
|
layers: data.annotations.map(function(layer) {
|
||||||
return Ox.extend({
|
return Ox.extend({
|
||||||
editable: layer.canAddAnnotations[pandora.user.level]
|
editable: layer.canAddAnnotations[pandora.user.level]
|
||||||
}, layer);
|
}, layer);
|
||||||
}),
|
}),
|
||||||
muted: pandora.user.ui.videoMuted,
|
muted: ui.videoMuted,
|
||||||
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
out: ui.videoPoints[ui.item].out,
|
||||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
position: ui.videoPoints[ui.item].position,
|
||||||
posterFrame: data.posterFrame,
|
posterFrame: data.posterFrame,
|
||||||
resolution: pandora.user.ui.videoResolution,
|
resolution: ui.videoResolution,
|
||||||
selected: pandora.user.ui.videoPoints[pandora.user.ui.item].annotation
|
selected: ui.videoPoints[ui.item].annotation
|
||||||
? pandora.user.ui.item + '/' + pandora.user.ui.videoPoints[pandora.user.ui.item].annotation
|
? ui.item + '/' + ui.videoPoints[ui.item].annotation
|
||||||
: '',
|
: '',
|
||||||
showAnnotations: pandora.user.ui.showAnnotations,
|
showAnnotations: ui.showAnnotations,
|
||||||
showAnnotationsCalendar: pandora.user.ui.showAnnotationsCalendar,
|
showAnnotationsCalendar: ui.showAnnotationsCalendar,
|
||||||
showAnnotationsMap: pandora.user.ui.showAnnotationsMap,
|
showAnnotationsMap: ui.showAnnotationsMap,
|
||||||
showLargeTimeline: true,
|
showLargeTimeline: true,
|
||||||
showLayers: Ox.clone(pandora.user.ui.showLayers),
|
showLayers: Ox.clone(ui.showLayers),
|
||||||
showUsers: pandora.site.annotations.showUsers,
|
showUsers: pandora.site.annotations.showUsers,
|
||||||
subtitles: data.subtitles,
|
subtitles: data.subtitles,
|
||||||
timeline: pandora.user.ui.videoTimeline,
|
timeline: ui.videoTimeline,
|
||||||
timelines: pandora.site.timelines,
|
timelines: pandora.site.timelines,
|
||||||
tooltips: true,
|
tooltips: true,
|
||||||
video: data.video,
|
video: data.video,
|
||||||
videoRatio: data.videoRatio,
|
videoRatio: data.videoRatio,
|
||||||
videoSize: pandora.user.ui.videoSize,
|
videoSize: ui.videoSize,
|
||||||
volume: pandora.user.ui.videoVolume,
|
volume: ui.videoVolume,
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
addannotation: function(data) {
|
addannotation: function(data) {
|
||||||
Ox.Log('', 'addAnnotation', data);
|
Ox.Log('', 'addAnnotation', data);
|
||||||
// async to not capture keyboard input
|
// async to not capture keyboard input
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var d = new Date(),
|
var d = new Date(),
|
||||||
created = Ox.formatDate(d, '%Y-%m-%dT%H:%M:%SZ'),
|
created = Ox.formatDate(d, '%Y-%m-%dT%H:%M:%SZ'),
|
||||||
date = Ox.formatDate(d, '%B %e, %Y'),
|
date = Ox.formatDate(d, '%B %e, %Y'),
|
||||||
type = Ox.getObjectById(pandora.site.layers, data.layer).type;
|
type = Ox.getObjectById(pandora.site.layers, data.layer).type;
|
||||||
pandora.$ui.editor.addAnnotation(data.layer, Ox.extend(
|
that.addAnnotation(data.layer, Ox.extend(
|
||||||
{
|
{
|
||||||
created: created,
|
created: created,
|
||||||
date: date,
|
date: date,
|
||||||
duration: data.out - data['in'],
|
duration: data.out - data['in'],
|
||||||
editable: true,
|
editable: true,
|
||||||
id: '_' + Ox.uid(),
|
id: '_' + Ox.uid(),
|
||||||
|
'in': data['in'],
|
||||||
|
modified: created,
|
||||||
|
out: data.out,
|
||||||
|
user: pandora.user.username,
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
type == 'place' ? {
|
||||||
|
place: {lat: null, lng: null}
|
||||||
|
} : type == 'event' ? {
|
||||||
|
event: {start: '', end: ''}
|
||||||
|
} : {}
|
||||||
|
));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
annotationsfont: function(data) {
|
||||||
|
pandora.UI.set({annotationsFont: data.font});
|
||||||
|
},
|
||||||
|
annotationsrange: function(data) {
|
||||||
|
pandora.UI.set({annotationsRange: data.range});
|
||||||
|
},
|
||||||
|
annotationssize: function(data) {
|
||||||
|
pandora.UI.set({annotationsSize: data.size});
|
||||||
|
},
|
||||||
|
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();
|
||||||
|
pandora.$ui[dialog] = pandora.ui[dialog](data).open();
|
||||||
|
},
|
||||||
|
downloadvideo: function(data) {
|
||||||
|
document.location.href = '/' + ui.item + '/torrent/';
|
||||||
|
},
|
||||||
|
downloadselection: function(data) {
|
||||||
|
document.location.href = '/' + ui.item
|
||||||
|
+ '/' + Ox.max(pandora.site.video.resolutions)
|
||||||
|
+ 'p.webm?t=' + data['in'] + ',' + data.out;
|
||||||
|
},
|
||||||
|
editannotation: function(data) {
|
||||||
|
Ox.Log('', 'editAnnotation', data);
|
||||||
|
function callback(result) {
|
||||||
|
Ox.Log('', 'editAnnotation result', result);
|
||||||
|
result.data.date = Ox.formatDate(
|
||||||
|
result.data.modified.slice(0, 10), '%B %e, %Y'
|
||||||
|
);
|
||||||
|
that.updateAnnotation(data.id, result.data);
|
||||||
|
};
|
||||||
|
if (data.id[0] == '_') {
|
||||||
|
pandora.api.addAnnotation({
|
||||||
'in': data['in'],
|
'in': data['in'],
|
||||||
modified: created,
|
item: ui.item,
|
||||||
|
layer: data.layer,
|
||||||
out: data.out,
|
out: data.out,
|
||||||
user: pandora.user.username,
|
value: data.value
|
||||||
value: ''
|
}, callback);
|
||||||
|
} else {
|
||||||
|
pandora.api.editAnnotation({
|
||||||
|
id: data.id,
|
||||||
|
'in': data['in'],
|
||||||
|
out: data.out,
|
||||||
|
value: data.value
|
||||||
|
}, callback);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
embedselection: function(data) {
|
||||||
|
pandora.$ui.embedDialog && pandora.$ui.embedDialog.remove();
|
||||||
|
pandora.$ui.embedDialog = pandora.ui.embedDialog(data).open();
|
||||||
|
},
|
||||||
|
find: function(data) {
|
||||||
|
pandora.UI.set('itemFind', data.find);
|
||||||
|
},
|
||||||
|
findannotations: function(data) {
|
||||||
|
pandora.UI.set({
|
||||||
|
item: '',
|
||||||
|
find: {
|
||||||
|
conditions: [{key: data.key, value: data.value, operator: '='}],
|
||||||
|
operator: '&'
|
||||||
},
|
},
|
||||||
type == 'place' ? {
|
listView: 'clip'
|
||||||
place: {lat: null, lng: null}
|
});
|
||||||
} : type == 'event' ? {
|
},
|
||||||
event: {start: '', end: ''}
|
importannotations: function(data) {
|
||||||
} : {}
|
pandora.ui.importAnnotations().open();
|
||||||
));
|
},
|
||||||
});
|
info: function(data) {
|
||||||
},
|
pandora.ui.annotationDialog(
|
||||||
annotationsfont: function(data) {
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
pandora.UI.set({annotationsFont: data.font});
|
).open();
|
||||||
},
|
},
|
||||||
annotationsrange: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set({annotationsRange: data.range});
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
},
|
},
|
||||||
annotationssize: function(data) {
|
points: function(data) {
|
||||||
pandora.UI.set({annotationsSize: data.size});
|
pandora.UI.set('videoPoints.' + ui.item, {
|
||||||
},
|
annotation: ui.videoPoints[ui.item].annotation,
|
||||||
annotationssort: function(data) {
|
'in': data['in'],
|
||||||
pandora.UI.set({annotationsSort: data.sort});
|
out: data.out,
|
||||||
},
|
position: data.position
|
||||||
censored: function() {
|
});
|
||||||
pandora.URL.push(pandora.site.cantPlay.link);
|
},
|
||||||
},
|
position: function(data) {
|
||||||
define: function(data) {
|
pandora.UI.set(
|
||||||
var dialog = data.type + 'sDialog';
|
'videoPoints.' + ui.item + '.position',
|
||||||
pandora.$ui[dialog] && pandora.$ui[dialog].remove();
|
data.position
|
||||||
pandora.$ui[dialog] = pandora.ui[dialog](data).open();
|
|
||||||
},
|
|
||||||
downloadvideo: function(data) {
|
|
||||||
document.location.href = '/' + pandora.user.ui.item + '/torrent/';
|
|
||||||
},
|
|
||||||
downloadselection: function(data) {
|
|
||||||
document.location.href = '/' + pandora.user.ui.item
|
|
||||||
+ '/' + Ox.max(pandora.site.video.resolutions)
|
|
||||||
+ 'p.webm?t=' + data['in'] + ',' + data.out;
|
|
||||||
},
|
|
||||||
editannotation: function(data) {
|
|
||||||
Ox.Log('', 'editAnnotation', data);
|
|
||||||
function callback(result) {
|
|
||||||
Ox.Log('', 'editAnnotation result', result);
|
|
||||||
result.data.date = Ox.formatDate(
|
|
||||||
result.data.modified.slice(0, 10), '%B %e, %Y'
|
|
||||||
);
|
);
|
||||||
pandora.$ui.editor.updateAnnotation(data.id, result.data);
|
},
|
||||||
};
|
posterframe: function(data) {
|
||||||
if (data.id[0] == '_') {
|
pandora.api.setPosterFrame({
|
||||||
pandora.api.addAnnotation({
|
id: ui.item,
|
||||||
'in': data['in'],
|
position: data.position
|
||||||
item: pandora.user.ui.item,
|
});
|
||||||
layer: data.layer,
|
},
|
||||||
out: data.out,
|
removeannotation: function(data) {
|
||||||
value: data.value
|
pandora.UI.set('videoPoints.' + ui.item + '.annotation', null);
|
||||||
}, callback);
|
pandora.api.removeAnnotation({
|
||||||
} else {
|
id: data.id
|
||||||
pandora.api.editAnnotation({
|
}, function(result) {
|
||||||
id: data.id,
|
//fixme: check for errors
|
||||||
'in': data['in'],
|
//that.removeAnnotation(data.layer, data.id);
|
||||||
out: data.out,
|
});
|
||||||
value: data.value
|
},
|
||||||
}, callback);
|
resize: function(data) {
|
||||||
|
that.options({height: data.size});
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
select: function(data) {
|
||||||
|
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]);
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
togglelayer: function(data) {
|
||||||
|
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
||||||
|
},
|
||||||
|
pandora_showannotations: function(data) {
|
||||||
|
that.options({showAnnotations: data.value});
|
||||||
|
},
|
||||||
|
pandora_videotimeline: function(data) {
|
||||||
|
that.options({timeline: data.value});
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
embedselection: function(data) {
|
|
||||||
pandora.$ui.embedDialog && pandora.$ui.embedDialog.remove();
|
return that;
|
||||||
pandora.$ui.embedDialog = pandora.ui.embedDialog(data).open();
|
|
||||||
},
|
|
||||||
find: function(data) {
|
|
||||||
pandora.UI.set('itemFind', data.find);
|
|
||||||
},
|
|
||||||
findannotations: function(data) {
|
|
||||||
pandora.UI.set({
|
|
||||||
item: '',
|
|
||||||
find: {
|
|
||||||
conditions: [{key: data.key, value: data.value, operator: '='}],
|
|
||||||
operator: '&'
|
|
||||||
},
|
|
||||||
listView: 'clip'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
importannotations: function(data) {
|
|
||||||
pandora.ui.importAnnotations().open();
|
|
||||||
},
|
|
||||||
info: function(data) {
|
|
||||||
pandora.ui.annotationDialog(
|
|
||||||
Ox.getObjectById(pandora.site.layers, data.layer).title
|
|
||||||
).open();
|
|
||||||
},
|
|
||||||
muted: function(data) {
|
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
|
||||||
},
|
|
||||||
points: function(data) {
|
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item, {
|
|
||||||
annotation: pandora.user.ui.videoPoints[pandora.user.ui.item].annotation,
|
|
||||||
'in': data['in'],
|
|
||||||
out: data.out,
|
|
||||||
position: data.position
|
|
||||||
});
|
|
||||||
},
|
|
||||||
position: function(data) {
|
|
||||||
pandora.UI.set(
|
|
||||||
'videoPoints.' + pandora.user.ui.item + '.position',
|
|
||||||
data.position
|
|
||||||
);
|
|
||||||
},
|
|
||||||
posterframe: function(data) {
|
|
||||||
pandora.api.setPosterFrame({
|
|
||||||
id: pandora.user.ui.item,
|
|
||||||
position: data.position
|
|
||||||
});
|
|
||||||
},
|
|
||||||
removeannotation: function(data) {
|
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', null);
|
|
||||||
pandora.api.removeAnnotation({
|
|
||||||
id: data.id
|
|
||||||
}, function(result) {
|
|
||||||
//fixme: check for errors
|
|
||||||
//pandora.$ui.editor.removeAnnotation(data.layer, data.id);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
resize: function(data) {
|
|
||||||
pandora.$ui.editor.options({
|
|
||||||
height: data.size
|
|
||||||
});
|
|
||||||
},
|
|
||||||
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);
|
|
||||||
},
|
|
||||||
select: function(data) {
|
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]);
|
|
||||||
},
|
|
||||||
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);
|
|
||||||
},
|
|
||||||
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);
|
|
||||||
},
|
|
||||||
togglelayer: function(data) {
|
|
||||||
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
|
||||||
},
|
|
||||||
pandora_showannotations: function(data) {
|
|
||||||
pandora.$ui.editor.options({showAnnotations: data.value});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ pandora.ui.mainMenu = function() {
|
||||||
) },
|
) },
|
||||||
{ id: 'timelines', title: 'Timelines', items: [
|
{ id: 'timelines', title: 'Timelines', items: [
|
||||||
{ group: 'viewtimelines', min: 1, max: 1, items: pandora.site.timelines.map(function(mode) {
|
{ group: 'viewtimelines', min: 1, max: 1, items: pandora.site.timelines.map(function(mode) {
|
||||||
return {id: mode.id, title: mode.title, checked: ui.videoTimeline == mode.id, disabled: true};
|
return {id: mode.id, title: mode.title, checked: ui.videoTimeline == mode.id};
|
||||||
}) }
|
}) }
|
||||||
]},
|
]},
|
||||||
{ id: 'columns', title: 'Columns', items: [
|
{ id: 'columns', title: 'Columns', items: [
|
||||||
|
@ -504,6 +504,9 @@ pandora.ui.mainMenu = function() {
|
||||||
},
|
},
|
||||||
pandora_showtimeline: function(data) {
|
pandora_showtimeline: function(data) {
|
||||||
that.setItemTitle('showtimeline', (data.value ? 'Hide' : 'Show') + ' Timeline');
|
that.setItemTitle('showtimeline', (data.value ? 'Hide' : 'Show') + ' Timeline');
|
||||||
|
},
|
||||||
|
pandora_videotimeline: function(data) {
|
||||||
|
that.checkItem('viewMenu_timelines_' + data.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,135 +4,140 @@
|
||||||
|
|
||||||
pandora.ui.player = function(data) {
|
pandora.ui.player = function(data) {
|
||||||
|
|
||||||
// fixme: var ui = pandora.user.ui;
|
var ui = pandora.user.ui,
|
||||||
|
|
||||||
return Ox.VideoPanel({
|
that = Ox.VideoPanel({
|
||||||
annotationsCalendarSize: pandora.user.ui.annotationsCalendarSize,
|
annotationsCalendarSize: ui.annotationsCalendarSize,
|
||||||
annotationsFont: pandora.user.ui.annotationsFont,
|
annotationsFont: ui.annotationsFont,
|
||||||
annotationsMapSize: pandora.user.ui.annotationsMapSize,
|
annotationsMapSize: ui.annotationsMapSize,
|
||||||
annotationsRange: pandora.user.ui.annotationsRange,
|
annotationsRange: ui.annotationsRange,
|
||||||
annotationsSize: pandora.user.ui.annotationsSize,
|
annotationsSize: ui.annotationsSize,
|
||||||
annotationsSort: pandora.user.ui.annotationsSort,
|
annotationsSort: ui.annotationsSort,
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: pandora.site.cantPlay.text,
|
censoredTooltip: pandora.site.cantPlay.text,
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
cuts: data.cuts || [],
|
cuts: data.cuts || [],
|
||||||
duration: data.duration,
|
duration: data.duration,
|
||||||
enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel,
|
enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= data.rightslevel,
|
||||||
enableSubtitles: pandora.user.ui.videoSubtitles,
|
enableSubtitles: ui.videoSubtitles,
|
||||||
find: pandora.user.ui.itemFind,
|
find: ui.itemFind,
|
||||||
getLargeTimelineURL: function(type, i) {
|
getLargeTimelineURL: function(type, i) {
|
||||||
return '/' + pandora.user.ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||||
},
|
},
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'],
|
'in': ui.videoPoints[ui.item]['in'],
|
||||||
layers: data.annotations,
|
layers: data.annotations,
|
||||||
muted: pandora.user.ui.videoMuted,
|
muted: ui.videoMuted,
|
||||||
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
out: ui.videoPoints[ui.item].out,
|
||||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
position: ui.videoPoints[ui.item].position,
|
||||||
resolution: pandora.user.ui.videoResolution,
|
resolution: ui.videoResolution,
|
||||||
scaleToFill: pandora.user.ui.videoScale == 'fill',
|
scaleToFill: ui.videoScale == 'fill',
|
||||||
selected: pandora.user.ui.videoPoints[pandora.user.ui.item].annotation
|
selected: ui.videoPoints[ui.item].annotation
|
||||||
? pandora.user.ui.item + '/' + pandora.user.ui.videoPoints[pandora.user.ui.item].annotation
|
? ui.item + '/' + ui.videoPoints[ui.item].annotation
|
||||||
: '',
|
: '',
|
||||||
showAnnotations: pandora.user.ui.showAnnotations,
|
showAnnotations: ui.showAnnotations,
|
||||||
showAnnotationsCalendar: pandora.user.ui.showAnnotationsCalendar,
|
showAnnotationsCalendar: ui.showAnnotationsCalendar,
|
||||||
showAnnotationsMap: pandora.user.ui.showAnnotationsMap,
|
showAnnotationsMap: ui.showAnnotationsMap,
|
||||||
showLayers: Ox.clone(pandora.user.ui.showLayers),
|
showLayers: Ox.clone(ui.showLayers),
|
||||||
showUsers: pandora.site.annotations.showUsers,
|
showUsers: pandora.site.annotations.showUsers,
|
||||||
showTimeline: pandora.user.ui.showTimeline,
|
showTimeline: ui.showTimeline,
|
||||||
smallTimelineURL: '/' + pandora.user.ui.item + '/timeline16p.jpg',
|
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
||||||
subtitles: data.subtitles,
|
subtitles: data.subtitles,
|
||||||
timeline: pandora.user.ui.videoTimeline,
|
timeline: ui.videoTimeline,
|
||||||
tooltips: true,
|
tooltips: true,
|
||||||
video: data.video,
|
video: data.video,
|
||||||
volume: pandora.user.ui.videoVolume,
|
volume: ui.videoVolume,
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
}).bindEvent({
|
}).bindEvent({
|
||||||
annotationsfont: function(data) {
|
annotationsfont: function(data) {
|
||||||
pandora.UI.set({annotationsFont: data.font});
|
pandora.UI.set({annotationsFont: data.font});
|
||||||
},
|
},
|
||||||
annotationsrange: function(data) {
|
annotationsrange: function(data) {
|
||||||
pandora.UI.set({annotationsRange: data.range});
|
pandora.UI.set({annotationsRange: data.range});
|
||||||
},
|
},
|
||||||
annotationssize: function(data) {
|
annotationssize: function(data) {
|
||||||
pandora.UI.set({annotationsSize: data.size});
|
pandora.UI.set({annotationsSize: data.size});
|
||||||
},
|
},
|
||||||
annotationssort: function(data) {
|
annotationssort: function(data) {
|
||||||
pandora.UI.set({annotationsSort: data.sort});
|
pandora.UI.set({annotationsSort: data.sort});
|
||||||
},
|
},
|
||||||
censored: function() {
|
censored: function() {
|
||||||
pandora.$ui.player.options('fullscreen') && pandora.$ui.player.options({
|
that.options('fullscreen') && that.options({
|
||||||
fullscreen: false
|
fullscreen: false
|
||||||
});
|
});
|
||||||
pandora.URL.push(pandora.site.cantPlay.link);
|
pandora.URL.push(pandora.site.cantPlay.link);
|
||||||
},
|
},
|
||||||
downloadvideo: function(data) {
|
downloadvideo: function(data) {
|
||||||
document.location.href = '/' + pandora.user.ui.item + '/torrent/';
|
document.location.href = '/' + ui.item + '/torrent/';
|
||||||
},
|
},
|
||||||
find: function(data) {
|
find: function(data) {
|
||||||
pandora.UI.set('itemFind', data.find);
|
pandora.UI.set('itemFind', data.find);
|
||||||
},
|
},
|
||||||
info: function(data) {
|
info: function(data) {
|
||||||
pandora.ui.annotationDialog(
|
pandora.ui.annotationDialog(
|
||||||
Ox.getObjectById(pandora.site.layers, data.layer).title
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
).open();
|
).open();
|
||||||
},
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
},
|
},
|
||||||
position: function(data) {
|
position: function(data) {
|
||||||
pandora.UI.set(
|
pandora.UI.set(
|
||||||
'videoPoints.' + pandora.user.ui.item + '.position',
|
'videoPoints.' + ui.item + '.position',
|
||||||
data.position
|
data.position
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
resizeannotations: function(data) {
|
resizeannotations: function(data) {
|
||||||
pandora.UI.set('annotationsSize', data.annotationsSize);
|
pandora.UI.set('annotationsSize', data.annotationsSize);
|
||||||
},
|
},
|
||||||
resizecalendar: function(data) {
|
resizecalendar: function(data) {
|
||||||
pandora.UI.set('annotationsCalendarSize', data.size);
|
pandora.UI.set('annotationsCalendarSize', data.size);
|
||||||
},
|
},
|
||||||
resizemap: function(data) {
|
resizemap: function(data) {
|
||||||
pandora.UI.set('annotationsMapSize', data.size);
|
pandora.UI.set('annotationsMapSize', data.size);
|
||||||
},
|
},
|
||||||
resolution: function(data) {
|
resolution: function(data) {
|
||||||
pandora.UI.set('videoResolution', data.resolution);
|
pandora.UI.set('videoResolution', data.resolution);
|
||||||
},
|
},
|
||||||
scale: function(data) {
|
scale: function(data) {
|
||||||
pandora.UI.set('videoScale', data.scale);
|
pandora.UI.set('videoScale', data.scale);
|
||||||
},
|
},
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]);
|
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1]);
|
||||||
},
|
},
|
||||||
subtitles: function(data) {
|
subtitles: function(data) {
|
||||||
pandora.UI.set('videoSubtitles', data.subtitles);
|
pandora.UI.set('videoSubtitles', data.subtitles);
|
||||||
},
|
},
|
||||||
toggleannotations: function(data) {
|
toggleannotations: function(data) {
|
||||||
pandora.UI.set('showAnnotations', data.showAnnotations);
|
pandora.UI.set('showAnnotations', data.showAnnotations);
|
||||||
},
|
},
|
||||||
togglelayer: function(data) {
|
togglelayer: function(data) {
|
||||||
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
||||||
},
|
},
|
||||||
togglemap: function(data) {
|
togglemap: function(data) {
|
||||||
pandora.UI.set('showAnnotationsMap', !data.collapsed);
|
pandora.UI.set('showAnnotationsMap', !data.collapsed);
|
||||||
},
|
},
|
||||||
togglesize: function(data) {
|
togglesize: function(data) {
|
||||||
pandora.UI.set({videoSize: data.size});
|
pandora.UI.set({videoSize: data.size});
|
||||||
},
|
},
|
||||||
toggletimeline: function(data) {
|
toggletimeline: function(data) {
|
||||||
pandora.UI.set('showTimeline', data.showTimeline);
|
pandora.UI.set('showTimeline', data.showTimeline);
|
||||||
},
|
},
|
||||||
volume: function(data) {
|
volume: function(data) {
|
||||||
pandora.UI.set('videoVolume', data.volume);
|
pandora.UI.set('videoVolume', data.volume);
|
||||||
},
|
},
|
||||||
pandora_showannotations: function(data) {
|
pandora_showannotations: function(data) {
|
||||||
pandora.$ui.player.options({showAnnotations: data.value});
|
that.options({showAnnotations: data.value});
|
||||||
},
|
},
|
||||||
pandora_showtimeline: function(data) {
|
pandora_showtimeline: function(data) {
|
||||||
pandora.$ui.player.options({showTimeline: data.value});
|
that.options({showTimeline: data.value});
|
||||||
}
|
},
|
||||||
});
|
pandora_videotimeline: function(data) {
|
||||||
|
that.options({timeline: data.value});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,109 +4,114 @@
|
||||||
|
|
||||||
pandora.ui.timeline = function(data) {
|
pandora.ui.timeline = function(data) {
|
||||||
|
|
||||||
var ui = pandora.user.ui;
|
var ui = pandora.user.ui,
|
||||||
|
|
||||||
return Ox.VideoTimelinePanel({
|
that = Ox.VideoTimelinePanel({
|
||||||
annotationsCalendarSize: ui.annotationsCalendarSize,
|
annotationsCalendarSize: ui.annotationsCalendarSize,
|
||||||
annotationsFont: ui.annotationsFont,
|
annotationsFont: ui.annotationsFont,
|
||||||
annotationsMapSize: ui.annotationsMapSize,
|
annotationsMapSize: ui.annotationsMapSize,
|
||||||
annotationsRange: ui.annotationsRange,
|
annotationsRange: ui.annotationsRange,
|
||||||
annotationsSize: ui.annotationsSize,
|
annotationsSize: ui.annotationsSize,
|
||||||
annotationsSort: ui.annotationsSort,
|
annotationsSort: ui.annotationsSort,
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: pandora.site.cantPlay.text,
|
censoredTooltip: pandora.site.cantPlay.text,
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
cuts: data.cuts || [],
|
cuts: data.cuts || [],
|
||||||
duration: data.duration,
|
duration: data.duration,
|
||||||
followPlayer: ui.followPlayer,
|
followPlayer: ui.followPlayer,
|
||||||
getFrameURL: function(position) {
|
getFrameURL: function(position) {
|
||||||
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg';
|
return '/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg';
|
||||||
},
|
},
|
||||||
getLargeTimelineURL: function(type, i) {
|
getLargeTimelineURL: function(type, i) {
|
||||||
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
return '/' + ui.item + '/timeline' + type + '64p' + i + '.jpg';
|
||||||
},
|
},
|
||||||
height: pandora.$ui.contentPanel.size(1),
|
height: pandora.$ui.contentPanel.size(1),
|
||||||
layers: data.annotations,
|
layers: data.annotations,
|
||||||
muted: ui.videoMuted,
|
muted: ui.videoMuted,
|
||||||
position: ui.videoPoints[ui.item].position,
|
position: ui.videoPoints[ui.item].position,
|
||||||
resolution: pandora.site.video.resolutions[0],
|
resolution: pandora.site.video.resolutions[0],
|
||||||
selected: ui.videoPoints[ui.item].annotation
|
selected: ui.videoPoints[ui.item].annotation
|
||||||
? ui.item + '/' + ui.videoPoints[ui.item].annotation
|
? ui.item + '/' + ui.videoPoints[ui.item].annotation
|
||||||
: '',
|
: '',
|
||||||
showAnnotations: ui.showAnnotations,
|
showAnnotations: ui.showAnnotations,
|
||||||
showAnnotationsCalendar: ui.showAnnotationsCalendar,
|
showAnnotationsCalendar: ui.showAnnotationsCalendar,
|
||||||
showAnnotationsMap: ui.showAnnotationsMap,
|
showAnnotationsMap: ui.showAnnotationsMap,
|
||||||
showLayers: Ox.clone(ui.showLayers),
|
showLayers: Ox.clone(ui.showLayers),
|
||||||
showUsers: pandora.site.annotations.showUsers,
|
showUsers: pandora.site.annotations.showUsers,
|
||||||
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
smallTimelineURL: '/' + ui.item + '/timeline16p.jpg',
|
||||||
timeline: ui.videoTimeline,
|
timeline: ui.videoTimeline,
|
||||||
timelines: pandora.site.timelines,
|
timelines: pandora.site.timelines,
|
||||||
video: data.video,
|
video: data.video,
|
||||||
videoRatio: data.videoRatio,
|
videoRatio: data.videoRatio,
|
||||||
volume: ui.videoVolume,
|
volume: ui.videoVolume,
|
||||||
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
annotationsfont: function(data) {
|
annotationsfont: function(data) {
|
||||||
pandora.UI.set({annotationsFont: data.font});
|
pandora.UI.set({annotationsFont: data.font});
|
||||||
},
|
},
|
||||||
annotationsrange: function(data) {
|
annotationsrange: function(data) {
|
||||||
pandora.UI.set({annotationsRange: data.range});
|
pandora.UI.set({annotationsRange: data.range});
|
||||||
},
|
},
|
||||||
annotationssize: function(data) {
|
annotationssize: function(data) {
|
||||||
pandora.UI.set({annotationsSize: data.size});
|
pandora.UI.set({annotationsSize: data.size});
|
||||||
},
|
},
|
||||||
annotationssort: function(data) {
|
annotationssort: function(data) {
|
||||||
pandora.UI.set({annotationsSort: data.sort});
|
pandora.UI.set({annotationsSort: data.sort});
|
||||||
},
|
},
|
||||||
censored: function() {
|
censored: function() {
|
||||||
pandora.URL.push(pandora.site.cantPlay.link);
|
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);
|
||||||
},
|
},
|
||||||
info: function(data) {
|
info: function(data) {
|
||||||
pandora.ui.annotationDialog(
|
pandora.ui.annotationDialog(
|
||||||
Ox.getObjectById(pandora.site.layers, data.layer).title
|
Ox.getObjectById(pandora.site.layers, data.layer).title
|
||||||
).open();
|
).open();
|
||||||
},
|
},
|
||||||
muted: function(data) {
|
muted: function(data) {
|
||||||
pandora.UI.set('videoMuted', data.muted);
|
pandora.UI.set('videoMuted', data.muted);
|
||||||
},
|
},
|
||||||
position: function(data) {
|
position: function(data) {
|
||||||
pandora.UI.set(
|
pandora.UI.set(
|
||||||
'videoPoints.' + pandora.user.ui.item + '.position',
|
'videoPoints.' + pandora.user.ui.item + '.position',
|
||||||
data.position
|
data.position
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
resizeannotations: function(data) {
|
resizeannotations: function(data) {
|
||||||
pandora.UI.set('annotationsSize', data.annotationsSize);
|
pandora.UI.set('annotationsSize', data.annotationsSize);
|
||||||
},
|
},
|
||||||
resizecalendar: function(data) {
|
resizecalendar: function(data) {
|
||||||
pandora.UI.set('annotationsCalendarSize', data.size);
|
pandora.UI.set('annotationsCalendarSize', data.size);
|
||||||
},
|
},
|
||||||
resizemap: function(data) {
|
resizemap: function(data) {
|
||||||
pandora.UI.set('annotationsMapSize', data.size);
|
pandora.UI.set('annotationsMapSize', data.size);
|
||||||
},
|
},
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]);
|
pandora.UI.set('videoPoints.' + pandora.user.ui.item + '.annotation', data.id.split('/')[1]);
|
||||||
},
|
},
|
||||||
timeline: function(data) {
|
timeline: function(data) {
|
||||||
pandora.UI.set('videoTimeline', data.timeline);
|
pandora.UI.set('videoTimeline', data.timeline);
|
||||||
},
|
},
|
||||||
toggleannotations: function(data) {
|
toggleannotations: function(data) {
|
||||||
pandora.UI.set('showAnnotations', data.showAnnotations);
|
pandora.UI.set('showAnnotations', data.showAnnotations);
|
||||||
},
|
},
|
||||||
togglelayer: function(data) {
|
togglelayer: function(data) {
|
||||||
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
pandora.UI.set('showLayers.' + data.layer, !data.collapsed);
|
||||||
},
|
},
|
||||||
togglemap: function(data) {
|
togglemap: function(data) {
|
||||||
pandora.UI.set('showAnnotationsMap', !data.collapsed);
|
pandora.UI.set('showAnnotationsMap', !data.collapsed);
|
||||||
},
|
},
|
||||||
pandora_showannotations: function(data) {
|
pandora_showannotations: function(data) {
|
||||||
pandora.$ui.timeline.options({showAnnotations: data.value});
|
that.options({showAnnotations: data.value});
|
||||||
}
|
},
|
||||||
});
|
pandora_videotimeline: function(data) {
|
||||||
|
that.options({timeline: data.value});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue