server/apps/files_external/js/gdrive.js

27 lines
796 B
JavaScript
Raw Normal View History

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