Skip to content

Commit

Permalink
Create sharing entry point with constants
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
  • Loading branch information
skjnldsv committed Nov 8, 2019
1 parent 3e3b74a commit 72a6fd0
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 30 deletions.
4 changes: 2 additions & 2 deletions apps/files_sharing/js/dist/additionalScripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/additionalScripts.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing.js.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js.map

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions apps/files_sharing/js/dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/files_sharing/js/dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions apps/files_sharing/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
use OCP\Files\Config\IMountProviderCollection;
use OCP\IContainer;
use OCP\IServerContainer;
use OCP\Util;

class Application extends App {

Expand Down Expand Up @@ -187,6 +188,11 @@ function() use ($c) {
$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) {
Expand Down
36 changes: 36 additions & 0 deletions apps/files_sharing/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
*
* @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
}
})
12 changes: 0 additions & 12 deletions apps/files_sharing/src/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
5 changes: 3 additions & 2 deletions apps/files_sharing/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/'),
Expand Down

0 comments on commit 72a6fd0

Please sign in to comment.