Skip to content

Commit

Permalink
Issue#20: Add a static title to the paper doc created
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshvrdhn03 committed Jun 24, 2018
1 parent a76ab2f commit 15b3c73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/paper.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function createPaper(token, text) {
};

var reqObj = {import_format: "html"};
xhr.send(reqObj);
xhr.send("Paper-extension");
}

function saveToPaper(token, paperId, text) {
Expand All @@ -101,16 +101,16 @@ function saveToPaper(token, paperId, text) {
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
var rev = result.Revision;

xhr.setRequestHeader("Authorization", "Bearer " + token);
xhr.setRequestHeader("Dropbox-API-Arg", "{\"doc_id\": \"" + paperId + "\",\"doc_update_policy\": \"prepend\",\"revision\": " + rev + ",\"import_format\": \"markdown\"}");
xhr.setRequestHeader("Content-Type", "application/octet-stream");

xhr.onreadystatechange = function() {
if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
new_rev = JSON.parse(this.response);
chrome.storage.sync.set({Revision : new_rev.revision});
}
}
}
xhr.send(text);
});
Expand Down

0 comments on commit 15b3c73

Please sign in to comment.