handle copy and points events

This commit is contained in:
rolux 2013-07-14 16:38:15 +00:00
parent b6955d743e
commit c547b6e877
2 changed files with 22 additions and 4 deletions

View file

@ -108,13 +108,13 @@ pandora.ui.editor = function(data) {
censored: function() { censored: function() {
pandora.URL.push(pandora.site.cantPlay.link); pandora.URL.push(pandora.site.cantPlay.link);
}, },
copy: function(clips) { copy: function(data) {
Ox.Clipboard.copy(clips.map(function(clip) { Ox.Clipboard.copy(data.map(function(clip) {
return Ox.extend(clip, {item: ui.item}); return Ox.extend(clip, {item: ui.item});
}), 'clip'); }), 'clip');
}, },
copyadd: function(clip) { copyadd: function(data) {
Ox.Clipboard.add(clips.map(function(clip) { Ox.Clipboard.add(data.map(function(clip) {
return Ox.extend(clip, {item: ui.item}); return Ox.extend(clip, {item: ui.item});
}), 'clip'); }), 'clip');
}, },

View file

@ -70,6 +70,16 @@ pandora.ui.player = function(data) {
}); });
pandora.URL.push(pandora.site.cantPlay.link); pandora.URL.push(pandora.site.cantPlay.link);
}, },
copy: function(data) {
Ox.Clipboard.copy(data.map(function(clip) {
return Ox.extend(clip, {item: ui.item});
}), 'clip');
},
copyadd: function(data) {
Ox.Clipboard.add(data.map(function(clip) {
return Ox.extend(clip, {item: ui.item});
}), 'clip');
},
downloadvideo: function(data) { downloadvideo: function(data) {
document.location.href = '/' + ui.item + '/torrent/'; document.location.href = '/' + ui.item + '/torrent/';
}, },
@ -90,6 +100,14 @@ pandora.ui.player = function(data) {
data.position data.position
); );
}, },
points: function(data) {
pandora.UI.set('videoPoints.' + ui.item, {
annotation: ui.videoPoints[ui.item].annotation,
'in': data['in'],
out: data.out,
position: data.position
});
},
position: function(data) { position: function(data) {
pandora.UI.set( pandora.UI.set(
'videoPoints.' + ui.item + '.position', 'videoPoints.' + ui.item + '.position',