summaryrefslogtreecommitdiffstats
path: root/apps/files_external/js/gdrive.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/js/gdrive.js')
-rw-r--r--apps/files_external/js/gdrive.js26
1 files changed, 26 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..e02cedd6b45
--- /dev/null
+++ b/apps/files_external/js/gdrive.js
@@ -0,0 +1,26 @@
+$(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 backendEl = $tr.find('.backend');
+ var el = $(document.createElement('a'))
+ .attr('href', generateUrl($tr))
+ .attr('target', '_blank')
+ .attr('title', t('files_external', 'Google Drive App Configuration'))
+ .addClass('icon-settings svg')
+ ;
+ el.on('click', function(event) {
+ var a = $(event.target);
+ a.attr('href', generateUrl($(this).closest('tr')));
+ });
+ el.tooltip({placement: 'top'});
+ backendEl.append(el);
+ }
+ });
+
+});