updating to new editor

This commit is contained in:
rlx 2011-02-03 21:39:42 +00:00
parent ac15e72f32
commit 66acfaadfa

View file

@ -1720,24 +1720,8 @@
} else if (app.user.ui.itemView == 'player') { } else if (app.user.ui.itemView == 'player') {
that = new Ox.Element('div'); that = new Ox.Element('div');
} else if (app.user.ui.itemView == 'timeline') { } else if (app.user.ui.itemView == 'timeline') {
that = new Ox.SplitPanel({ that = new Ox.Element('div');
elements: [
{
element: new Ox.Element('div'),
},
{
collapsed: !app.user.ui.showAnnotations,
collapsible: true,
element: new Ox.Element('div'),
resizable: true,
resize: [256, 384],
size: app.user.ui.annotationsSize
} }
]
})
}
getItem();
function getItem() {
pandora.api.getItem(app.user.ui.item, function(result) { pandora.api.getItem(app.user.ui.item, function(result) {
if (app.user.ui.itemView == 'info') { if (app.user.ui.itemView == 'info') {
//Ox.print('result.data.item', result.data.item) //Ox.print('result.data.item', result.data.item)
@ -1795,7 +1779,8 @@
video.height = video.profiles[0] video.height = video.profiles[0]
video.width = parseInt(video.height * video.aspectRatio / 2) * 2; video.width = parseInt(video.height * video.aspectRatio / 2) * 2;
video.url = video.baseUrl + '/' + video.height + 'p.' + ($.support.video.webm ? 'webm' : 'mp4'); video.url = video.baseUrl + '/' + video.height + 'p.' + ($.support.video.webm ? 'webm' : 'mp4');
that.replace(0, app.$ui.editor = new Ox.VideoEditor({ app.$ui.contentPanel.replace(1, app.$ui.editor = new Ox.VideoEditor({
annotationsSize: app.user.ui.annotationsSize,
cuts: cuts, cuts: cuts,
duration: video.duration, duration: video.duration,
find: '', find: '',
@ -1805,29 +1790,31 @@
height: app.$ui.contentPanel.size(1), height: app.$ui.contentPanel.size(1),
id: 'editor', id: 'editor',
largeTimeline: true, largeTimeline: true,
layers: app.config.layers,
matches: [], matches: [],
points: [0, 0], points: [0, 0],
position: app.user.ui.videoPosition[app.user.ui.item] || 0, position: app.user.ui.videoPosition[app.user.ui.item] || 0,
posterFrame: parseInt(video.duration / 2), posterFrame: parseInt(video.duration / 2),
showAnnotations: app.user.ui.showAnnotations,
subtitles: subtitles, subtitles: subtitles,
videoHeight: video.height, videoHeight: video.height,
videoId: app.user.ui.item, videoId: app.user.ui.item,
videoWidth: video.width, videoWidth: video.width,
videoSize: app.user.ui.videoSize, videoSize: app.user.ui.videoSize,
videoURL: video.url, videoURL: video.url,
width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 - width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1
(app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1
}).bindEvent({ }).bindEvent({
/*
resize: function(event, data) { resize: function(event, data) {
app.$ui.editor.options({ app.$ui.editor.options({
width: data width: data
}); });
}, },
*/
togglesize: function(event, data) { togglesize: function(event, data) {
UI.set({videoSize: data.size}); UI.set({videoSize: data.size});
} }
})); }));
that.replace(1, app.$ui.annotations = ui.annotations());
that.bindEvent('resize', function(event, data) { that.bindEvent('resize', function(event, data) {
//Ox.print('resize item', data) //Ox.print('resize item', data)
app.$ui.editor.options({ app.$ui.editor.options({
@ -1851,23 +1838,6 @@
} }
app.$ui.total.html(result.data.item.title + ' (' + result.data.item.director.join(', ') + ')') app.$ui.total.html(result.data.item.title + ' (' + result.data.item.director.join(', ') + ')')
}); });
}
/*
that.display = function() {
app.$ui.contentPanel.replaceElements([
{
collapsible: true,
element: app.$ui.browser = ui.browser(),
resizable: false,
size: 112 + app.ui.scrollbarSize
},
{
element: new Ox.Element('div')
}
]);
getItem(); // fixme: can the asynchronicity be moved within the video editor?
}
*/
return that; return that;
}, },
leftPanel: function() { leftPanel: function() {
@ -2966,7 +2936,7 @@
width: data width: data
}); });
app.user.ui.itemView == 'timeline' && app.$ui.editor.options({ app.user.ui.itemView == 'timeline' && app.$ui.editor.options({
width: data - (app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1 width: data
}); });
} }
} }
@ -3137,10 +3107,10 @@
}) : $.map(app.config.itemViews, function(view) { }) : $.map(app.config.itemViews, function(view) {
return $.extend($.extend({}, view), { return $.extend($.extend({}, view), {
checked: app.user.ui.itemView == view.id, checked: app.user.ui.itemView == view.id,
title: view.title title: 'View: ' + view.title
}); });
}), }),
width: !app.user.ui.item ? 144 : 96 width: !app.user.ui.item ? 144 : 128
}) })
.css({ .css({
float: 'left', float: 'left',
@ -3412,8 +3382,7 @@
app.user.ui.itemView == 'timeline' && app.$ui.editor.options({ app.user.ui.itemView == 'timeline' && app.$ui.editor.options({
// fixme: duplicated // fixme: duplicated
height: app.$ui.contentPanel.size(1), height: app.$ui.contentPanel.size(1),
width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1 - width: app.$ui.document.width() - app.$ui.mainPanel.size(0) - 1
(app.user.ui.showAnnotations * app.user.ui.annotationsSize) - 1
}); });
} }
} }