aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/collaborationresourceshandler.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/collaborationresourceshandler.js')
-rw-r--r--apps/files_sharing/src/collaborationresourceshandler.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_sharing/src/collaborationresourceshandler.js b/apps/files_sharing/src/collaborationresourceshandler.js
new file mode 100644
index 00000000000..0ad7220d78e
--- /dev/null
+++ b/apps/files_sharing/src/collaborationresourceshandler.js
@@ -0,0 +1,20 @@
+__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/');
+__webpack_nonce__ = btoa(OC.requestToken);
+
+window.OCP.Collaboration.registerType('file', {
+ action: () => {
+ return new Promise((resolve, reject) => {
+ OC.dialogs.filepicker('Link to a file', function (f) {
+ const client = OC.Files.getClient();
+ client.getFileInfo(f).then((status, fileInfo) => {
+ resolve(fileInfo.id);
+ }, () => {
+ reject();
+ });
+ }, false);
+ });
+ },
+ /** used in "Link to a {typeString}" */
+ typeString: t('files_sharing', 'file'),
+ typeIconClass: 'icon-files-dark'
+});