diff --git a/locales/de.js b/locales/de.js index 4a632d6..a18b46f 100644 --- a/locales/de.js +++ b/locales/de.js @@ -303,6 +303,7 @@ "sharing": "sharing", "list": "Liste", "download_space": "Space Herunterladen", + "download_as_pdf": "Space als PDF herunterladen", "duplicate_destination_folder": "Zielordner für Duplikat", "type": "Typ", "promote": "Befördern", diff --git a/locales/en.js b/locales/en.js index df5e158..c6ce026 100644 --- a/locales/en.js +++ b/locales/en.js @@ -308,6 +308,7 @@ "list": "Export List", "link": "Link", "download_space": "Download Space", + "download_as_pdf": "Download Space as PDF", "type": "Type", "download": "Download", "Previous Zone": "Previous Zone", @@ -321,4 +322,4 @@ "mute_present": "Unfollow", "follow_present_help": "If someone else is presenting this Space, the other members automatically follow the presentation. Switch following on or off with this button.", "export": "export" -} +} \ No newline at end of file diff --git a/locales/es.js b/locales/es.js index b51ebf6..b942f58 100644 --- a/locales/es.js +++ b/locales/es.js @@ -308,6 +308,7 @@ "list": "Lista para Exportar", "link": "Enlace", "download_space": "Espacio de Descarga", + "download_as_pdf": "Descargar espacio en PDF", "type": "Tipo", "download": "Descarga", "Previous Zone": "Zona Previa", diff --git a/locales/fr.js b/locales/fr.js index c738b6b..894d3a8 100644 --- a/locales/fr.js +++ b/locales/fr.js @@ -301,6 +301,7 @@ "goto_folder": "Aller au dossier %s", "stay_here": "Reste ici", "download_space": "télécharger un espace", + "download_as_pdf": "télécharger un espace comme PDF", "type": "Type", "Previous Zone": "Zone précédent", "Next Zone": "Zone suivante", diff --git a/locales/oc.js b/locales/oc.js index a0f7460..6642d69 100644 --- a/locales/oc.js +++ b/locales/oc.js @@ -308,6 +308,7 @@ "list": "lista", "link": "Ligam", "download_space": "Telecargar espaci", + "download_space_as_pdf": "Telecargar espaci PDF", "type": "Tipe", "download": "Telecargar", "Previous Zone": "Zòna precedenta", diff --git a/public/javascripts/spacedeck_spaces.js b/public/javascripts/spacedeck_spaces.js index f802efa..6f96a66 100644 --- a/public/javascripts/spacedeck_spaces.js +++ b/public/javascripts/spacedeck_spaces.js @@ -614,10 +614,11 @@ var SpacedeckSpaces = { }, download_space_as_pdf: function(space) { + this.close_dropdown(); this.global_spinner = true; get_resource("/spaces/" + space._id + "/pdf", function(o) { this.global_spinner = false; - location.href = o.url; + window.open(o.url, "_blank"); }.bind(this), function(xhr) { this.global_spinner = false; alert("PDF export problem (" + xhr.status + ")."); diff --git a/routes/api/space_exports.js b/routes/api/space_exports.js index aed5d6c..656bafb 100644 --- a/routes/api/space_exports.js +++ b/routes/api/space_exports.js @@ -114,7 +114,12 @@ router.get('/pdf', function(req, res, next) { res.status(201).json({ url: url }); - fs.unlink(local_path); + fs.unlink(local_path, function(){ + if (err) console.log('unlink', err); + else { + console.log('unlink', local_path); + } + }); }); }, (err) => { res.status(500).json({ diff --git a/views/partials/folders.html b/views/partials/folders.html index 1069775..85337f4 100644 --- a/views/partials/folders.html +++ b/views/partials/folders.html @@ -156,6 +156,7 @@