diff --git a/apps/files_sharing/js/dist/additionalScripts.js b/apps/files_sharing/js/dist/additionalScripts.js index fbffbf8343983a593f5cfebfe975dd633bd2ddd5..6c8e60d09c110fc99fcd71a461e7fa0603520924 100644 Binary files a/apps/files_sharing/js/dist/additionalScripts.js and b/apps/files_sharing/js/dist/additionalScripts.js differ diff --git a/apps/files_sharing/js/dist/additionalScripts.js.map b/apps/files_sharing/js/dist/additionalScripts.js.map index 0aa21c13eed36561244367e414a616aa13b1a0b4..45d207f470a2d88aba9eb933a44a9109325e0917 100644 Binary files a/apps/files_sharing/js/dist/additionalScripts.js.map and b/apps/files_sharing/js/dist/additionalScripts.js.map differ diff --git a/apps/files_sharing/js/dist/files_sharing.js b/apps/files_sharing/js/dist/files_sharing.js index fbc11b2181132260add7fc069f80f7461fe648b2..b8c19e4a8407063acfa8e76378c67456522931fc 100644 Binary files a/apps/files_sharing/js/dist/files_sharing.js and b/apps/files_sharing/js/dist/files_sharing.js differ diff --git a/apps/files_sharing/js/dist/files_sharing.js.map b/apps/files_sharing/js/dist/files_sharing.js.map index 07e1802b39374f6f7e86eebeb8e88bbf6e9a013c..4c96b89123b6e15c0bc4ff8e6fb4105a71222c10 100644 Binary files a/apps/files_sharing/js/dist/files_sharing.js.map and b/apps/files_sharing/js/dist/files_sharing.js.map differ diff --git a/apps/files_sharing/js/dist/main.js b/apps/files_sharing/js/dist/main.js new file mode 100644 index 0000000000000000000000000000000000000000..eaff364433db280c4dcf62cc638861bb0ca42071 Binary files /dev/null and b/apps/files_sharing/js/dist/main.js differ diff --git a/apps/files_sharing/js/dist/main.js.map b/apps/files_sharing/js/dist/main.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f381cb011f2458688572cf451f35b0372c8226b2 Binary files /dev/null and b/apps/files_sharing/js/dist/main.js.map differ diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 1e1a2ca1c8b9f36c6d0f0980eb67194b9d75e7f0..3cb3d87cfb254b319922fe14091ad9b6f1e71914 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -51,8 +51,10 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudIdManager; use OCP\IContainer; use OCP\Files\Config\IMountProviderCollection; +use OCP\IContainer; use OCP\IGroup; use OCP\IServerContainer; +use OCP\Util; use Symfony\Component\EventDispatcher\GenericEvent; class Application extends App { @@ -189,6 +191,11 @@ class Application extends App { $this->registerMountProviders($mountProviderCollection); $this->registerEventsScripts($dispatcher); $this->setupSharingMenus(); + + /** + * Always add main sharing script + */ + Util::addScript(self::APP_ID, 'dist/main'); } protected function registerMountProviders(IMountProviderCollection $mountProviderCollection) { diff --git a/apps/files_sharing/src/index.js b/apps/files_sharing/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cc2e1c6e69842b3733e17ab58cc44020c2a1c71e --- /dev/null +++ b/apps/files_sharing/src/index.js @@ -0,0 +1,36 @@ +/** + * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com> + * + * @author John Molakvoæ <skjnldsv@protonmail.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +// register default shares types +Object.assign(OC, { + Share: { + SHARE_TYPE_USER: 0, + SHARE_TYPE_GROUP: 1, + SHARE_TYPE_LINK: 3, + SHARE_TYPE_EMAIL: 4, + SHARE_TYPE_REMOTE: 6, + SHARE_TYPE_CIRCLE: 7, + SHARE_TYPE_GUEST: 8, + SHARE_TYPE_REMOTE_GROUP: 9, + SHARE_TYPE_ROOM: 10 + } +}) diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js index a59cfda4b12c920cef8e32a9417bd92ef78aeb21..07c367fddab7953baacfd7ebaaf1bf0ce4762fb4 100644 --- a/apps/files_sharing/src/share.js +++ b/apps/files_sharing/src/share.js @@ -21,18 +21,6 @@ OCA.Sharing = {} } - OC.Share = _.extend(OC.Share || {}, { - SHARE_TYPE_USER: 0, - SHARE_TYPE_GROUP: 1, - SHARE_TYPE_LINK: 3, - SHARE_TYPE_EMAIL: 4, - SHARE_TYPE_REMOTE: 6, - SHARE_TYPE_CIRCLE: 7, - SHARE_TYPE_GUEST: 8, - SHARE_TYPE_REMOTE_GROUP: 9, - SHARE_TYPE_ROOM: 10 - }) - /** * @namespace */ diff --git a/apps/files_sharing/webpack.js b/apps/files_sharing/webpack.js index 43a34559d415ec6774d6e45035d2097b5222f125..70759a684df16bef9d67ca8b05350052a1a09675 100644 --- a/apps/files_sharing/webpack.js +++ b/apps/files_sharing/webpack.js @@ -3,9 +3,10 @@ const path = require('path'); module.exports = { entry: { 'additionalScripts': path.join(__dirname, 'src', 'additionalScripts.js'), - 'files_sharing': path.join(__dirname, 'src', 'files_sharing.js'), - 'files_sharing_tab': path.join(__dirname, 'src', 'files_sharing_tab.js'), 'collaboration': path.join(__dirname, 'src', 'collaborationresourceshandler.js'), + 'files_sharing_tab': path.join(__dirname, 'src', 'files_sharing_tab.js'), + 'files_sharing': path.join(__dirname, 'src', 'files_sharing.js'), + 'main': path.join(__dirname, 'src', 'index.js'), }, output: { path: path.resolve(__dirname, './js/dist/'),