Compare commits
2 commits
eee9e19841
...
cb55ebaf4c
| Author | SHA1 | Date | |
|---|---|---|---|
| cb55ebaf4c | |||
| 93afb4e465 |
2 changed files with 15 additions and 3 deletions
|
|
@ -117,7 +117,8 @@ class MetaClip(object):
|
|||
#annotations = self.annotations.filter(layer__in=settings.CONFIG['clipLayers'])
|
||||
annotations = self.annotations.all()
|
||||
if qs:
|
||||
annotations = annotations.filter(qs)
|
||||
for q in qs:
|
||||
annotations = annotations.filter(q)
|
||||
entity_cache = {}
|
||||
j['annotations'] = [
|
||||
a.json(keys=['value', 'id', 'layer'], entity_cache=entity_cache) for a in annotations
|
||||
|
|
|
|||
|
|
@ -105,6 +105,17 @@ pandora.ui.exportAnnotationsDialog = function(options) {
|
|||
updateLink();
|
||||
}
|
||||
|
||||
function textBlob(data) {
|
||||
data = Ox.encodeUTF8(data);
|
||||
var byteNumbers = new Array(data.length);
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
byteNumbers[i] = data.charCodeAt(i);
|
||||
}
|
||||
var byteArray = new Uint8Array(byteNumbers);
|
||||
var blob = new Blob([byteArray], {type: 'text/plain; charset=utf-8'});
|
||||
return blob;
|
||||
}
|
||||
|
||||
function updateLink() {
|
||||
var layer = $layerSelect.value(),
|
||||
format = $formatSelect.value(),
|
||||
|
|
@ -121,11 +132,11 @@ pandora.ui.exportAnnotationsDialog = function(options) {
|
|||
text: text
|
||||
};
|
||||
}),
|
||||
blob = new Blob([Ox.encodeUTF8(
|
||||
blob = textBlob(
|
||||
format == 'json'
|
||||
? JSON.stringify(items, null, ' ')
|
||||
: Ox.formatSRT(items)
|
||||
)], {type: 'text/plain; charset=utf-8'}),
|
||||
),
|
||||
url = window.URL.createObjectURL(blob);
|
||||
|
||||
$link.attr({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue