make annotation map/calendar size/state sticky

This commit is contained in:
rolux 2012-01-14 17:10:15 +05:30
parent 107b11893e
commit 9b556c2765

View file

@ -269,6 +269,20 @@ pandora.ui.item = function() {
volume: pandora.user.ui.videoVolume, volume: pandora.user.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) {
Ox.Log('', 'addAnnotation', data);
pandora.api.addAnnotation({
'in': data['in'],
item: pandora.user.ui.item,
layer: data.layer,
out: data.out,
value: data.value,
}, function(result) {
result.data.editable = true;
result.data.duration = result.data.out - result.data['in'];
pandora.$ui.editor.addAnnotation(data.layer, result.data);
});
},
annotationsfont: function(data) { annotationsfont: function(data) {
pandora.UI.set({annotationsFont: data.font}); pandora.UI.set({annotationsFont: data.font});
}, },
@ -281,6 +295,20 @@ pandora.ui.item = function() {
annotationssort: function(data) { annotationssort: function(data) {
pandora.UI.set({annotationsSort: data.sort}); pandora.UI.set({annotationsSort: data.sort});
}, },
editannotation: function(data) {
Ox.Log('', 'editAnnotation', data);
//fixme: check that edit was successfull
pandora.api.editAnnotation({
id: data.id,
'in': data['in'],
out: data.out,
value: data.value,
}, function(result) {
Ox.Log('', 'editAnnotation result', result);
result.data.duration = result.data.out - result.data['in'];
pandora.$ui.editor.updateAnnotation(data.layer, result.data);
});
},
find: function(data) { find: function(data) {
var textKey = Ox.getObjectById(pandora.site.layers, 'subtitles') var textKey = Ox.getObjectById(pandora.site.layers, 'subtitles')
? 'subtitles' ? 'subtitles'
@ -307,11 +335,25 @@ pandora.ui.item = function() {
data.position data.position
); );
}, },
removeannotation: function(data) {
pandora.api.removeAnnotation({
id: data.id
}, function(result) {
//fixme: check for errors
//pandora.$ui.editor.removeAnnotation(data.layer, data.id);
});
},
resize: function(data) { resize: function(data) {
pandora.$ui.editor.options({ pandora.$ui.editor.options({
height: data.size height: data.size
}); });
}, },
resizecalendar: function(data) {
pandora.UI.set('annotationsCalendarSize', data.size);
},
resizemap: function(data) {
pandora.UI.set('annotationsMapSize', data.size);
},
resolution: function(data) { resolution: function(data) {
pandora.UI.set('videoResolution', data.resolution); pandora.UI.set('videoResolution', data.resolution);
}, },
@ -321,45 +363,15 @@ pandora.ui.item = function() {
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set('videoSubtitles', data.subtitles); pandora.UI.set('videoSubtitles', data.subtitles);
}, },
togglecalendar: function(data) {
pandora.UI.set('showAnnotationsCalendar', !data.collapsed);
},
togglemap: function(data) {
pandora.UI.set('showAnnotationsMap', !data.collapsed);
},
togglesize: function(data) { togglesize: function(data) {
pandora.UI.set({videoSize: data.size}); pandora.UI.set({videoSize: data.size});
}, },
addannotation: function(data) {
Ox.Log('', 'addAnnotation', data);
pandora.api.addAnnotation({
'in': data['in'],
item: pandora.user.ui.item,
layer: data.layer,
out: data.out,
value: data.value,
}, function(result) {
result.data.editable = true;
result.data.duration = result.data.out - result.data['in'];
pandora.$ui.editor.addAnnotation(data.layer, result.data);
});
},
editannotation: function(data) {
Ox.Log('', 'editAnnotation', data);
//fixme: check that edit was successfull
pandora.api.editAnnotation({
id: data.id,
'in': data['in'],
out: data.out,
value: data.value,
}, function(result) {
Ox.Log('', 'editAnnotation result', result);
result.data.duration = result.data.out - result.data['in'];
pandora.$ui.editor.updateAnnotation(data.layer, result.data);
});
},
removeannotation: function(data) {
pandora.api.removeAnnotation({
id: data.id
}, function(result) {
//fixme: check for errors
//pandora.$ui.editor.removeAnnotation(data.layer, data.id);
});
},
toggleannotations: function(data) { toggleannotations: function(data) {
pandora.UI.set('showAnnotations', data.showAnnotations); pandora.UI.set('showAnnotations', data.showAnnotations);
}, },