export subtree to tar file

This commit is contained in:
azivner
2018-02-25 10:55:21 -05:00
parent 12c06ae97e
commit 60bba46d80
7 changed files with 83 additions and 50 deletions

View File

@@ -304,16 +304,7 @@ const noteEditor = (function() {
}
}
$attachmentDownload.click(() => {
if (isElectron()) {
const remote = require('electron').remote;
remote.getCurrentWebContents().downloadURL(getAttachmentUrl());
}
else {
window.location.href = getAttachmentUrl();
}
});
$attachmentDownload.click(() => download(getAttachmentUrl()));
$attachmentOpen.click(() => {
if (isElectron()) {
@@ -328,13 +319,8 @@ const noteEditor = (function() {
function getAttachmentUrl() {
// electron needs absolute URL so we extract current host, port, protocol
const url = new URL(window.location.href);
const host = url.protocol + "//" + url.hostname + ":" + url.port;
const downloadUrl = "/api/attachments/download/" + getCurrentNoteId()
return getHost() + "/api/attachments/download/" + getCurrentNoteId()
+ "?protectedSessionId=" + encodeURIComponent(protected_session.getProtectedSessionId());
return host + downloadUrl;
}
$(document).ready(() => {