You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

collaborationresourceshandler.js 759B

123456789101112131415161718192021
  1. // eslint-disable-next-line camelcase
  2. __webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')
  3. // eslint-disable-next-line camelcase
  4. __webpack_nonce__ = btoa(OC.requestToken)
  5. window.OCP.Collaboration.registerType('file', {
  6. action: () => {
  7. return new Promise((resolve, reject) => {
  8. OC.dialogs.filepicker(t('files_sharing', 'Link to a file'), function(f) {
  9. const client = OC.Files.getClient()
  10. client.getFileInfo(f).then((status, fileInfo) => {
  11. resolve(fileInfo.id)
  12. }).fail(() => {
  13. reject(new Error('Cannot get fileinfo'))
  14. })
  15. }, false, null, false, OC.dialogs.FILEPICKER_TYPE_CHOOSE, '', { allowDirectoryChooser: true })
  16. })
  17. },
  18. typeString: t('files_sharing', 'Link to a file'),
  19. typeIconClass: 'icon-files-dark'
  20. })