2016-02-08 18:55:09 +03:00
|
|
|
$(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') {
|
2016-04-01 01:20:00 +03:00
|
|
|
var backendEl = $tr.find('.backend');
|
2016-02-08 18:55:09 +03:00
|
|
|
var el = $(document.createElement('a'))
|
|
|
|
.attr('href', generateUrl($tr))
|
|
|
|
.attr('target', '_blank')
|
2016-04-01 01:20:00 +03:00
|
|
|
.attr('title', t('files_external', 'Dropbox App Configuration'))
|
|
|
|
.addClass('icon-settings svg')
|
2016-02-08 18:55:09 +03:00
|
|
|
;
|
|
|
|
el.on('click', function(event) {
|
|
|
|
var a = $(event.target);
|
2016-04-01 01:20:00 +03:00
|
|
|
a.attr('href', generateUrl($(this).closest('tr')));
|
2016-02-08 18:55:09 +03:00
|
|
|
});
|
2016-04-01 01:20:00 +03:00
|
|
|
el.tooltip({placement: 'top'});
|
|
|
|
backendEl.append(el);
|
2016-02-08 18:55:09 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|