summaryrefslogtreecommitdiffstats
path: root/apps/files_external/js/gdrive.js
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2016-02-08 15:55:09 +0000
committerRobin McCorkell <robin@mccorkell.me.uk>2016-05-03 11:30:02 +0100
commit43abe2b64855d5acbde4ce4c58a4f543371bb001 (patch)
treef1ed1713ad114ff870ea4f0f1388ec66c5af98f6 /apps/files_external/js/gdrive.js
parentde98a6e54cd2d732e0b7c1297e8da43e53bb97c7 (diff)
downloadnextcloud-server-43abe2b64855d5acbde4ce4c58a4f543371bb001.tar.gz
nextcloud-server-43abe2b64855d5acbde4ce4c58a4f543371bb001.zip
Add links to load GDrive/Dropbox configuration pages
Diffstat (limited to 'apps/files_external/js/gdrive.js')
-rw-r--r--apps/files_external/js/gdrive.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_external/js/gdrive.js b/apps/files_external/js/gdrive.js
new file mode 100644
index 00000000000..e660aa8cb26
--- /dev/null
+++ b/apps/files_external/js/gdrive.js
@@ -0,0 +1,24 @@
+$(document).ready(function() {
+
+ function generateUrl($tr) {
+ // no mapping between client ID and Google 'project', so we always load the same URL
+ return 'https://console.developers.google.com/';
+ }
+
+ OCA.External.Settings.mountConfig.whenSelectBackend(function($tr, backend, onCompletion) {
+ if (backend === 'googledrive') {
+ var config = $tr.find('.configuration');
+ var el = $(document.createElement('a'))
+ .attr('href', generateUrl($tr))
+ .attr('target', '_blank')
+ .text(t('files_external', 'Google Drive Configuration') + ' ↗')
+ ;
+ el.on('click', function(event) {
+ var a = $(event.target);
+ a.attr('href', generateUrl($(this).parent()));
+ });
+ config.append(el);
+ }
+ });
+
+});