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
|
|
@ -110,12 +110,14 @@ pandora.ui.editPanel = function() {
|
|||
.bindEvent({
|
||||
copy: function(data) {
|
||||
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');
|
||||
},
|
||||
copyadd: function(data) {
|
||||
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');
|
||||
},
|
||||
edit: function(data) {
|
||||
|
|
@ -167,12 +169,17 @@ pandora.ui.editPanel = function() {
|
|||
if (Ox.Clipboard.type() == 'clip') {
|
||||
pandora.api.addClips({
|
||||
clips: Ox.Clipboard.paste().map(function(clip) {
|
||||
return {
|
||||
annotation: clip.annotation,
|
||||
'in': clip['in'],
|
||||
item: clip.item,
|
||||
out: clip.out
|
||||
};
|
||||
var split = clip.split('/'),
|
||||
item = split[0],
|
||||
points = split[1].split('-');
|
||||
return Ox.extend({
|
||||
item: item
|
||||
}, points.length == 1 ? {
|
||||
annotation: points[0]
|
||||
} : {
|
||||
'in': parseFloat(points[0]),
|
||||
out: parseFloat(points[1])
|
||||
});
|
||||
}),
|
||||
edit: ui.edit
|
||||
}, function(result) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue