diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-03-14 14:42:42 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-19 13:06:55 +0100 |
commit | e8fe00003b326867de480d919fdfe78ced9e7857 (patch) | |
tree | 4b69f488a3b1529e473a3f1448d32cbbfa6db32c /apps/files_sharing/src | |
parent | 3022ef687a7bef87fc8eff7e29a68d8cf64542e9 (diff) | |
download | nextcloud-server-e8fe00003b326867de480d919fdfe78ced9e7857.tar.gz nextcloud-server-e8fe00003b326867de480d919fdfe78ced9e7857.zip |
Dispatch event to allow apps to load their script for collections
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/additionalScripts.js | 18 | ||||
-rw-r--r-- | apps/files_sharing/src/collaborationresourceshandler.js | 20 |
2 files changed, 21 insertions, 17 deletions
diff --git a/apps/files_sharing/src/additionalScripts.js b/apps/files_sharing/src/additionalScripts.js index 94c0f232ce3..b0525a64a12 100644 --- a/apps/files_sharing/src/additionalScripts.js +++ b/apps/files_sharing/src/additionalScripts.js @@ -8,22 +8,6 @@ import './sharebreadcrumbview' import './style/sharetabview.scss' import './style/sharebreadcrumb.scss' -window.OCP.Collaboration.registerType('files', { - 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' -}); +import './collaborationresourceshandler.js' window.OCA.Sharing = OCA.Sharing; diff --git a/apps/files_sharing/src/collaborationresourceshandler.js b/apps/files_sharing/src/collaborationresourceshandler.js new file mode 100644 index 00000000000..fe27bd7fca0 --- /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('files', { + 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' +}); |