use Blob url for annotation export
This commit is contained in:
parent
f47febb09c
commit
a4b492136b
1 changed files with 9 additions and 5 deletions
|
@ -120,14 +120,18 @@ pandora.ui.exportAnnotationsDialog = function(options) {
|
||||||
out: annotation.out,
|
out: annotation.out,
|
||||||
text: text
|
text: text
|
||||||
};
|
};
|
||||||
});
|
}),
|
||||||
$link.attr({
|
blob = new Blob([Ox.encodeUTF8(
|
||||||
download: options.title + ' - '
|
|
||||||
+ Ox.getObjectById(layers, layer).title + '.' + format,
|
|
||||||
href: 'data:text/plain;base64,' + btoa(Ox.encodeUTF8(
|
|
||||||
format == 'json'
|
format == 'json'
|
||||||
? JSON.stringify(items, null, ' ')
|
? JSON.stringify(items, null, ' ')
|
||||||
: Ox.formatSRT(items)
|
: Ox.formatSRT(items)
|
||||||
|
)], {type: 'text/plain'}),
|
||||||
|
url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
$link.attr({
|
||||||
|
download: options.title + ' - '
|
||||||
|
+ Ox.getObjectById(layers, layer).title + '.' + format,
|
||||||
|
href: url,
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue