forked from 0x2620/pandora
store clipboard clips as strings
This commit is contained in:
parent
94996ddb86
commit
42a397d84a
4 changed files with 21 additions and 24 deletions
|
@ -117,12 +117,7 @@ pandora.ui.clipList = function(videoRatio) {
|
||||||
var items = data.ids.map(function(id) {
|
var items = data.ids.map(function(id) {
|
||||||
var item = !ui.item ? id.split('/')[0] : ui.item,
|
var item = !ui.item ? id.split('/')[0] : ui.item,
|
||||||
annotation = that.value(id, 'annotations')[0].id;
|
annotation = that.value(id, 'annotations')[0].id;
|
||||||
return {
|
return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out');
|
||||||
annotation: annotation,
|
|
||||||
'in': that.value(id, 'in'),
|
|
||||||
item: item,
|
|
||||||
out: that.value(id, 'out')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
Ox.Clipboard.copy(items, 'clip');
|
Ox.Clipboard.copy(items, 'clip');
|
||||||
},
|
},
|
||||||
|
@ -130,12 +125,7 @@ pandora.ui.clipList = function(videoRatio) {
|
||||||
var items = data.ids.map(function(id) {
|
var items = data.ids.map(function(id) {
|
||||||
var item = !ui.item ? id.split('/')[0] : ui.item,
|
var item = !ui.item ? id.split('/')[0] : ui.item,
|
||||||
annotation = that.value(id, 'annotations')[0].id;
|
annotation = that.value(id, 'annotations')[0].id;
|
||||||
return {
|
return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out');
|
||||||
annotation: annotation,
|
|
||||||
'in': that.value(id, 'in'),
|
|
||||||
item: item,
|
|
||||||
out: that.value(id, 'out')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
Ox.Clipboard.add(items, 'clip');
|
Ox.Clipboard.add(items, 'clip');
|
||||||
},
|
},
|
||||||
|
|
|
@ -110,12 +110,14 @@ pandora.ui.editPanel = function() {
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
copy: function(data) {
|
copy: function(data) {
|
||||||
Ox.Clipboard.copy(data.ids.map(function(id) {
|
Ox.Clipboard.copy(data.ids.map(function(id) {
|
||||||
return Ox.getObjectById(edit.clips, id);
|
var clip = Ox.getObjectById(edit.clips, id);
|
||||||
|
return clip.annotation || clip.item + '/' + clip['in'] + '-' + clip.out;
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
copyadd: function(data) {
|
copyadd: function(data) {
|
||||||
Ox.Clipboard.add(data.ids.map(function(id) {
|
Ox.Clipboard.add(data.ids.map(function(id) {
|
||||||
return Ox.getObjectById(edit.clips, id);
|
var clip = Ox.getObjectById(edit.clips, id);
|
||||||
|
return clip.annotation || clip.item + '/' + clip['in'] + '-' + clip.out;
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
edit: function(data) {
|
edit: function(data) {
|
||||||
|
@ -167,12 +169,17 @@ pandora.ui.editPanel = function() {
|
||||||
if (Ox.Clipboard.type() == 'clip') {
|
if (Ox.Clipboard.type() == 'clip') {
|
||||||
pandora.api.addClips({
|
pandora.api.addClips({
|
||||||
clips: Ox.Clipboard.paste().map(function(clip) {
|
clips: Ox.Clipboard.paste().map(function(clip) {
|
||||||
return {
|
var split = clip.split('/'),
|
||||||
annotation: clip.annotation,
|
item = split[0],
|
||||||
'in': clip['in'],
|
points = split[1].split('-');
|
||||||
item: clip.item,
|
return Ox.extend({
|
||||||
out: clip.out
|
item: item
|
||||||
};
|
}, points.length == 1 ? {
|
||||||
|
annotation: points[0]
|
||||||
|
} : {
|
||||||
|
'in': parseFloat(points[0]),
|
||||||
|
out: parseFloat(points[1])
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
edit: ui.edit
|
edit: ui.edit
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
|
|
|
@ -110,12 +110,12 @@ pandora.ui.editor = function(data) {
|
||||||
},
|
},
|
||||||
copy: function(data) {
|
copy: function(data) {
|
||||||
Ox.Clipboard.copy(data.map(function(clip) {
|
Ox.Clipboard.copy(data.map(function(clip) {
|
||||||
return Ox.extend(clip, {item: ui.item});
|
return clip.annotation || ui.item + '/' + clip['in'] + '-' + clip.out
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
copyadd: function(data) {
|
copyadd: function(data) {
|
||||||
Ox.Clipboard.add(data.map(function(clip) {
|
Ox.Clipboard.add(data.map(function(clip) {
|
||||||
return Ox.extend(clip, {item: ui.item});
|
return clip.annotation || ui.item + '/' + clip['in'] + '-' + clip.out
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
define: function(data) {
|
define: function(data) {
|
||||||
|
|
|
@ -73,12 +73,12 @@ pandora.ui.player = function(data) {
|
||||||
},
|
},
|
||||||
copy: function(data) {
|
copy: function(data) {
|
||||||
Ox.Clipboard.copy(data.map(function(clip) {
|
Ox.Clipboard.copy(data.map(function(clip) {
|
||||||
return Ox.extend(clip, {item: ui.item});
|
return clip.annotation || ui.item + '/' + clip['in'] + '-' + clip.out;
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
copyadd: function(data) {
|
copyadd: function(data) {
|
||||||
Ox.Clipboard.add(data.map(function(clip) {
|
Ox.Clipboard.add(data.map(function(clip) {
|
||||||
return Ox.extend(clip, {item: ui.item});
|
return clip.annotation || ui.item + '/' + clip['in'] + '-' + clip.out;
|
||||||
}), 'clip');
|
}), 'clip');
|
||||||
},
|
},
|
||||||
downloadvideo: function(data) {
|
downloadvideo: function(data) {
|
||||||
|
|
Loading…
Reference in a new issue