diff --git a/app/pdf.js b/app/pdf.js index bd3074da..0c29bb30 100644 --- a/app/pdf.js +++ b/app/pdf.js @@ -39,7 +39,7 @@ var authorizedPageSizes = [ 'Letter' ]; -module.exports = function(req, res, next) { +exports.export = function(req, res, next) { function onError(err) { next(err); } diff --git a/public/res/classes/Provider.js b/public/res/classes/Provider.js index 70d260cc..793e01ca 100644 --- a/public/res/classes/Provider.js +++ b/public/res/classes/Provider.js @@ -6,7 +6,7 @@ define([ 'fileMgr', 'editor', 'diff_match_patch_uncompressed', - 'jsondiffpatch', + 'jsondiffpatch' ], function(_, utils, settings, eventMgr, fileMgr, editor, diff_match_patch, jsondiffpatch) { function Provider(providerId, providerName) { diff --git a/public/res/constants.js b/public/res/constants.js index 7495927e..bb8a1a66 100644 --- a/public/res/constants.js +++ b/public/res/constants.js @@ -23,10 +23,10 @@ define([], function() { constants.IMPORT_IMG_MAX_CONTENT_SIZE = 10000000; constants.TEMPORARY_FILE_INDEX = "file.tempIndex"; constants.WELCOME_DOCUMENT_TITLE = "Welcome document"; - constants.DOWNLOAD_PROXY_URL = "https://stackedit-download-proxy.herokuapp.com/"; - constants.PICASA_PROXY_URL = "https://stackedit-picasa-proxy.herokuapp.com/"; - constants.SSH_PROXY_URL = "https://stackedit-ssh-proxy.herokuapp.com/"; - constants.HTMLTOPDF_URL = "/pdf"; + constants.DOWNLOAD_IMPORT_URL = "/downloadImport"; + constants.PICASA_IMPORT_IMG_URL = "/picasaImportImg"; + constants.SSH_PUBLISH_URL = '/sshPublish'; + constants.PDF_EXPORT_URL = "/pdfExport"; // Site dependent constants.BASE_URL = "http://localhost/"; diff --git a/public/res/publisher.js b/public/res/publisher.js index 8298539f..94a20ea0 100644 --- a/public/res/publisher.js +++ b/public/res/publisher.js @@ -364,7 +364,10 @@ define([ return task.chain(); } var xhr = new XMLHttpRequest(); - xhr.open('POST', constants.HTMLTOPDF_URL + '?token=' + encodeURIComponent(token) + '&options=' + encodeURIComponent(settings.pdfOptions), true); + xhr.open('POST', constants.PDF_EXPORT_URL + '?' + $.param({ + token: token, + options: settings.pdfOptions + }), true); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.responseType = 'blob'; xhr.onreadystatechange = function() { @@ -373,7 +376,7 @@ define([ pdf = this.response; } else { - eventMgr.onError("Error when trying to generate PDF: " + this.status); + eventMgr.onError("Error when trying to generate PDF: " + this.statusText); } task.chain(); } diff --git a/public/res/storage.js b/public/res/storage.js index f0f8fd3c..b4c5b3b9 100644 --- a/public/res/storage.js +++ b/public/res/storage.js @@ -246,9 +246,10 @@ define([ localStorage.removeItem("welcomeTour"); if(_.has(localStorage, 'settings')) { settings = JSON.parse(localStorage.settings); - // Remove PDF settings as it's a new web service + // New web services delete settings.pdfTemplate; delete settings.pdfPageSize; + delete settings.sshProxy; localStorage.settings = JSON.stringify(settings); } version = "v20";