summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/app.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-30 17:42:35 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-30 10:06:29 +0200
commit6ebc43650554f41eee2ae715b99a178b9c75c532 (patch)
tree8b1f0a76ec2b3281bbc6608d69f609ff79aff3ef /apps/files_sharing/js/app.js
parentdbbb6c5945f9c4d73695fa210be88d35ff35f026 (diff)
downloadnextcloud-server-6ebc43650554f41eee2ae715b99a178b9c75c532.tar.gz
nextcloud-server-6ebc43650554f41eee2ae715b99a178b9c75c532.zip
Added sharing overview page (WIP)
- added sharing overview entries in the sidebar - use OCS Share API to get the list of files
Diffstat (limited to 'apps/files_sharing/js/app.js')
-rw-r--r--apps/files_sharing/js/app.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
new file mode 100644
index 00000000000..887575193d0
--- /dev/null
+++ b/apps/files_sharing/js/app.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+OCA.Sharing = {};
+OCA.Sharing.App = {
+
+ _inFileList: null,
+ _outFileList: null,
+
+ initSharingIn: function($el) {
+ if (this._inFileList) {
+ return;
+ }
+
+ this._inFileList = new OCA.Sharing.FileList(
+ $el,
+ {
+ scrollContainer: $('#app-content'),
+ sharedWithUser: true
+ }
+ );
+
+ var fileActions = _.extend({}, OCA.Files.FileActions);
+ fileActions.registerDefaultActions(this._inFileList);
+ this._inFileList.setFileActions(fileActions);
+ },
+
+ initSharingOut: function($el) {
+ if (this._outFileList) {
+ return;
+ }
+ this._outFileList = new OCA.Sharing.FileList(
+ $el,
+ {
+ scrollContainer: $('#app-content'),
+ sharedWithUser: false
+ }
+ );
+
+ var fileActions = _.extend({}, OCA.Files.FileActions);
+ fileActions.registerDefaultActions(this._outFileList);
+ this._outFileList.setFileActions(fileActions);
+ }
+};
+
+$(document).ready(function() {
+ $('#app-content-sharingin').one('show', function(e) {
+ OCA.Sharing.App.initSharingIn($(e.target));
+ });
+ $('#app-content-sharingout').one('show', function(e) {
+ OCA.Sharing.App.initSharingOut($(e.target));
+ });
+});
+