add first annotation
This commit is contained in:
parent
1f5b146ae6
commit
e9f351e3aa
2 changed files with 9 additions and 18 deletions
|
@ -49,7 +49,8 @@ def addAnnotation(request):
|
||||||
}
|
}
|
||||||
return {'status': {'code': int, 'text': string},
|
return {'status': {'code': int, 'text': string},
|
||||||
'data': {
|
'data': {
|
||||||
'annotation': {}s
|
id: 123,
|
||||||
|
...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
@ -72,8 +73,7 @@ def addAnnotation(request):
|
||||||
start=float(data['in']), end=float(data['out']),
|
start=float(data['in']), end=float(data['out']),
|
||||||
value=data['value'])
|
value=data['value'])
|
||||||
annotation.save()
|
annotation.save()
|
||||||
response = json_response()
|
response = json_response(annotation.json())
|
||||||
response['data']['annotation'] = annotation.json()
|
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
||||||
response = {'status': {'code': 501, 'text': 'not implemented'}}
|
response = {'status': {'code': 501, 'text': 'not implemented'}}
|
||||||
|
@ -119,6 +119,8 @@ def editAnnotation(request):
|
||||||
}
|
}
|
||||||
return {'status': {'code': int, 'text': string},
|
return {'status': {'code': int, 'text': string},
|
||||||
'data': {
|
'data': {
|
||||||
|
id:
|
||||||
|
...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
@ -130,10 +132,8 @@ def editAnnotation(request):
|
||||||
a.start = data['in']
|
a.start = data['in']
|
||||||
a.end = data['out']
|
a.end = data['out']
|
||||||
a.save()
|
a.save()
|
||||||
|
response['data'] = a.json()
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='permission denied')
|
response = json_response(status=403, text='permission denied')
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
||||||
response = json_response(status=501, text='not implemented')
|
|
||||||
return render_to_json_response(response)
|
|
||||||
actions.register(editAnnotation, cache=False)
|
actions.register(editAnnotation, cache=False)
|
||||||
|
|
|
@ -1825,16 +1825,7 @@
|
||||||
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.' + format;
|
video.url = video.baseUrl + '/' + video.height + 'p.' + format;
|
||||||
$.each(app.config.layers, function(i, layer) {
|
$.each(app.config.layers, function(i, layer) {
|
||||||
layers[i] = $.extend({}, layer);
|
layers[i] = $.extend({}, layer, {items: result.data.item.layers[layer.id]});
|
||||||
if (result.data.item.layers[layer.id])
|
|
||||||
layers[i]['items'] = result.data.item.layers[layer.id];
|
|
||||||
else
|
|
||||||
layers[i]['items'] = [{
|
|
||||||
'in': 5,
|
|
||||||
'out': 10,
|
|
||||||
'value': 'This annotation is just a test...'
|
|
||||||
}];
|
|
||||||
|
|
||||||
});
|
});
|
||||||
app.$ui.contentPanel.replace(1, app.$ui.editor = new Ox.VideoEditor({
|
app.$ui.contentPanel.replace(1, app.$ui.editor = new Ox.VideoEditor({
|
||||||
annotationsSize: app.user.ui.annotationsSize,
|
annotationsSize: app.user.ui.annotationsSize,
|
||||||
|
@ -1872,9 +1863,9 @@
|
||||||
addAnnotation: function(event, data) {
|
addAnnotation: function(event, data) {
|
||||||
Ox.print('addAnnotation', data);
|
Ox.print('addAnnotation', data);
|
||||||
data.item = app.user.ui.item;
|
data.item = app.user.ui.item;
|
||||||
data.value = 'Click to change text';
|
data.value = 'Click to edit';
|
||||||
pandora.api.addAnnotation(data, function(result) {
|
pandora.api.addAnnotation(data, function(result) {
|
||||||
app.$ui.editor.addAnnotation(data.layer, result.data.annotation);
|
app.$ui.editor.addAnnotation(data.layer, result.data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
removeAnnotations: function(event, data) {
|
removeAnnotations: function(event, data) {
|
||||||
|
|
Loading…
Reference in a new issue