diff --git a/README.md b/README.md index 2fef963..beece7d 100644 --- a/README.md +++ b/README.md @@ -123,8 +123,7 @@ 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`/ `config.json` (enable) | for export and import | +| google drive, dropbox | `public/js/common.js` | for export and import | Operational Transformation diff --git a/lib/config.js b/lib/config.js index 64d2056..b85a966 100644 --- a/lib/config.js +++ b/lib/config.js @@ -61,7 +61,6 @@ 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 = ''; @@ -112,6 +111,5 @@ module.exports = { twitter: twitter, github: github, dropbox: dropbox, - imgur: imgur, - googleDrive: googleDrive, + imgur: imgur }; diff --git a/lib/response.js b/lib/response.js index 9d75561..994c65f 100644 --- a/lib/response.js +++ b/lib/response.js @@ -72,8 +72,7 @@ function responseError(res, code, detail, msg) { code: code, detail: detail, msg: msg, - useCDN: config.usecdn, - googleDrive: config.googleDrive, + useCDN: config.usecdn }); res.write(content); res.end(); @@ -95,8 +94,7 @@ function showIndex(req, res, next) { facebook: config.facebook, twitter: config.twitter, github: config.github, - dropbox: config.dropbox, - googleDrive: config.googleDrive, + dropbox: config.dropbox }); res.write(content); res.end(); @@ -126,8 +124,7 @@ function responseHackMD(res, note) { facebook: config.facebook, twitter: config.twitter, github: config.github, - dropbox: config.dropbox, - googleDrive: config.googleDrive, + dropbox: config.dropbox }); var buf = html; res.writeHead(200, { diff --git a/public/js/common.js b/public/js/common.js index c623cd2..33b3068 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -4,8 +4,10 @@ var urlpath = ''; // sub url path, like: www.example.com/ //settings var debug = false; -var GOOGLE_API_KEY = 'change this'; -var GOOGLE_CLIENT_ID = 'change this'; +var GOOGLE_API_KEY = ''; +var GOOGLE_CLIENT_ID = ''; + +var DROPBOX_APP_KEY = ''; var port = window.location.port; var serverurl = window.location.protocol + '//' + (domain ? domain : window.location.hostname) + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : ''); diff --git a/public/js/index.js b/public/js/index.js index 3f0ed59..6bb50c6 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1048,6 +1048,35 @@ function showMessageModal(title, header, href, text, success) { modal.modal('show'); } +// check if dropbox app key is set and load scripts +if (DROPBOX_APP_KEY) { + $(' -<% if(dropbox) { %> - -<% } %> -<% if(googleDrive) { %> - -<% } %> @@ -84,7 +78,4 @@ - -<% if(googleDrive) { %> - -<% } %> + \ No newline at end of file diff --git a/public/views/header.ejs b/public/views/header.ejs index 1092a2d..f45d631 100644 --- a/public/views/header.ejs +++ b/public/views/header.ejs @@ -33,31 +33,21 @@
  • Slide Mode
  • - <% if((googleDrive == "true") || (typeof dropbox !== 'undefined' && dropbox) || (typeof github !== 'undefined' && github)) { %> - <% if(typeof dropbox !== 'undefined' && dropbox) { %>
  • Dropbox
  • - <% } %> - <% if(googleDrive == "true") { %>
  • Google Drive
  • - <% } %> <% if(typeof github !== 'undefined' && github) { %>
  • Gist
  • <% } %>
  • - <% } %> - <% if(typeof dropbox !== 'undefined' && dropbox) { %>
  • Dropbox
  • - <% } %> - <% if(googleDrive == "true") { %>
  • Google Drive
  • - <% } %>
  • Gist
  • Clipboard @@ -128,31 +118,21 @@
  • Slide Mode
  • - <% if((googleDrive == "true") || (typeof dropbox !== 'undefined' && dropbox) || (typeof github !== 'undefined' && github)) { %> - <% if(typeof dropbox !== 'undefined' && dropbox) { %>
  • Dropbox
  • - <% } %> - <% if(googleDrive == "true") { %>
  • Google Drive
  • - <% } %> <% if(typeof github !== 'undefined' && github) { %>
  • Gist
  • <% } %>
  • - <% } %> - <% if(typeof dropbox !== 'undefined' && dropbox) { %>
  • Dropbox
  • - <% } %> - <% if(googleDrive == "true") { %>
  • Google Drive
  • - <% } %>
  • Gist
  • Clipboard