gdrive.js 796 B

1234567891011121314151617181920212223242526
  1. $(document).ready(function() {
  2. function generateUrl($tr) {
  3. // no mapping between client ID and Google 'project', so we always load the same URL
  4. return 'https://console.developers.google.com/';
  5. }
  6. OCA.External.Settings.mountConfig.whenSelectBackend(function($tr, backend, onCompletion) {
  7. if (backend === 'googledrive') {
  8. var backendEl = $tr.find('.backend');
  9. var el = $(document.createElement('a'))
  10. .attr('href', generateUrl($tr))
  11. .attr('target', '_blank')
  12. .attr('title', t('files_external', 'Google Drive App Configuration'))
  13. .addClass('icon-settings svg')
  14. ;
  15. el.on('click', function(event) {
  16. var a = $(event.target);
  17. a.attr('href', generateUrl($(this).closest('tr')));
  18. });
  19. el.tooltip({placement: 'top'});
  20. backendEl.append(el);
  21. }
  22. });
  23. });