diff options
Diffstat (limited to 'public/js/index.js')
-rw-r--r-- | public/js/index.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js index 7e692bee..0193b6bc 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1064,6 +1064,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) { + $('<script>') + .attr('type', 'text/javascript') + .attr('src', 'https://www.dropbox.com/static/api/2/dropins.js') + .attr('id', 'dropboxjs') + .attr('data-app-key', DROPBOX_APP_KEY) + .appendTo('body'); +} else { + ui.toolbar.import.dropbox.hide(); + ui.toolbar.export.dropbox.hide(); +} + +// check if google api key and client id are set and load scripts +if (GOOGLE_API_KEY && GOOGLE_CLIENT_ID) { + $('<script>') + .attr('type', 'text/javascript') + .attr('src', 'https://www.google.com/jsapi') + .appendTo('body'); + + $('<script>') + .attr('type', 'text/javascript') + .attr('src', 'https://apis.google.com/js/client:plusone.js?onload=onGoogleClientLoaded') + .appendTo('body'); +} else { + ui.toolbar.import.googleDrive.hide(); + ui.toolbar.export.googleDrive.hide(); +} + //button actions //share ui.toolbar.publish.attr("href", noteurl + "/publish"); |