diff --git a/README.md b/README.md index 9f5fbb1..2fef963 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,8 @@ Third-party integration api key settings | facebook, twitter, github, dropbox | `config.json` | for signin | | imgur | `config.json` | for image upload | | dropbox | `public/views/foot.ejs` | for chooser and saver | -| google drive | `public/js/common.js` | for export and import | +| google drive | `public/js/common.js`/ `config.json` (enable) | for export and import | + Operational Transformation --- diff --git a/lib/config.js b/lib/config.js index 6738d4a..64d2056 100644 --- a/lib/config.js +++ b/lib/config.js @@ -25,7 +25,7 @@ var db = config.db || { }; // ssl path -var sslkeypath = config.sslkeypath || '' +var sslkeypath = config.sslkeypath || ''; var sslcertpath = config.sslcertpath || ''; var sslcapath = config.sslcapath || ''; var dhparampath = config.dhparampath || ''; @@ -61,6 +61,7 @@ var twitter = config.twitter || false; var github = config.github || false; var dropbox = config.dropbox || false; var imgur = config.imgur || false; +var googleDrive = config.googleDrive || false; function getserverurl() { var url = ''; @@ -111,5 +112,6 @@ module.exports = { twitter: twitter, github: github, dropbox: dropbox, - imgur: imgur -}; \ No newline at end of file + imgur: imgur, + googleDrive: googleDrive, +}; diff --git a/lib/response.js b/lib/response.js index 7a75e23..043fdd8 100644 --- a/lib/response.js +++ b/lib/response.js @@ -48,7 +48,7 @@ var response = { showNote: showNote, showPublishNote: showPublishNote, showPublishSlide: showPublishSlide, - showIndex: showIndex, + showIndex: showIndex, noteActions: noteActions, publishNoteActions: publishNoteActions, githubActions: githubActions @@ -72,7 +72,7 @@ function responseError(res, code, detail, msg) { code: code, detail: detail, msg: msg, - useCDN: config.usecdn + useCDN: config.usecdn }); res.write(content); res.end(); @@ -95,6 +95,7 @@ function showIndex(req, res, next) { twitter: config.twitter, github: config.github, dropbox: config.dropbox, + googleDrive: config.googleDrive, }); res.write(content); res.end(); @@ -125,6 +126,7 @@ function responseHackMD(res, note) { twitter: config.twitter, github: config.github, dropbox: config.dropbox, + googleDrive: config.googleDrive, }); var buf = html; res.writeHead(200, { @@ -355,7 +357,7 @@ function publishNoteActions(req, res, next) { res.redirect(config.serverurl + '/' + (note.alias ? note.alias : LZString.compressToBase64(note.id))); break; default: - res.redirect(config.serverurl + '/s/' + note.shortid); + res.redirect(config.serverurl + '/s/' + note.shortid); break; } }); @@ -370,7 +372,7 @@ function githubActions(req, res, next) { githubActionGist(req, res, note); break; default: - res.redirect(config.serverurl + '/' + noteId); + res.redirect(config.serverurl + '/' + noteId); break; } }); @@ -470,4 +472,4 @@ var render = function (res, title, markdown) { })); }; -module.exports = response; \ No newline at end of file +module.exports = response; diff --git a/public/views/foot.ejs b/public/views/foot.ejs index 9cd4ba0..15eff6e 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -71,8 +71,12 @@ +<% if(dropbox) { %> +<% } %> +<% if(googleDrive) { %> +<% } %> @@ -81,4 +85,6 @@ - \ No newline at end of file +<% if(googleDrive) { %> + +<% } %> diff --git a/public/views/header.ejs b/public/views/header.ejs index 8172a47..aeadb04 100644 --- a/public/views/header.ejs +++ b/public/views/header.ejs @@ -1,7 +1,7 @@ -
\ No newline at end of file +