From a70ebf77620d6c5651e092cc4998c416161746cf Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Sun, 15 May 2016 10:54:24 +0800 Subject: Update to move dropbox app key setting to common.js and will auto load client-side related scripts --- public/js/common.js | 6 ++++-- public/js/index.js | 29 +++++++++++++++++++++++++++++ public/views/foot.ejs | 11 +---------- public/views/header.ejs | 20 -------------------- 4 files changed, 34 insertions(+), 32 deletions(-) (limited to 'public') diff --git a/public/js/common.js b/public/js/common.js index c623cd24..33b30689 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 3f0ed593..6bb50c68 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 1092a2d1..f45d6311 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 -- cgit v1.2.3