fix annotation export for books without author

This commit is contained in:
j 2019-02-14 18:07:08 +05:30
parent 255de5664d
commit 6f8acb90d9

View file

@ -45,7 +45,10 @@ oml.ui.exportAnnotationsDialog = function(data) {
function getAnnotationsText() {
var annotations = oml.$ui.viewer.getAnnotations()
var text = 'Annotations for ' + data.title + ' (' + data.author.join(', ') + ')\n\n\n\n'
var text = 'Annotations for ' + data.title + (
data.author ?' (' + data.author.join(', ') + ')'
: ''
) + '\n\n\n\n'
text += annotations.map(function(annotation) {
var page = annotation.pageLabel || annotation.page
var text = 'Quote' + (page ? ' Page ' + page : '' )+ ':\n\n' + annotation.text