-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22214 from owncloud/ext-better-dropbox-gdrive
Direct links to Google Drive/Dropbox configuration pages from external storage config
- Loading branch information
Showing
15 changed files
with
111 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$(document).ready(function() { | ||
|
||
function generateUrl($tr) { | ||
var app_key = $tr.find('[data-parameter="app_key"]').val(); | ||
if (app_key) { | ||
return 'https://www.dropbox.com/developers/apps/info/' + app_key; | ||
} else { | ||
return 'https://www.dropbox.com/developers/apps'; | ||
} | ||
} | ||
|
||
OCA.External.Settings.mountConfig.whenSelectBackend(function($tr, backend, onCompletion) { | ||
if (backend === 'dropbox') { | ||
var backendEl = $tr.find('.backend'); | ||
var el = $(document.createElement('a')) | ||
.attr('href', generateUrl($tr)) | ||
.attr('target', '_blank') | ||
.attr('title', t('files_external', 'Dropbox 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); | ||
} | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters