Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
.nav-icon-favorites {
background-image: url('../img/star.svg?v=1');
}
.nav-icon-sharing,
.nav-icon-sharingin,
.nav-icon-sharingout {
background-image: url('../img/share.svg?v=1');
Expand Down
11 changes: 11 additions & 0 deletions apps/files_sharing/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ function() {

$config = \OC::$server->getConfig();
if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
\OCA\Files\App::getNavigationManager()->add(function () {
$l = \OC::$server->getL10N('files_sharing');
return [
'id' => 'sharing',
'appname' => 'files_sharing',
'script' => 'list.php',
'order' => 14,
'name' => $l->t('Shared'),
];
});

\OCA\Files\App::getNavigationManager()->add(function () {
$l = \OC::$server->getL10N('files_sharing');
return [
Expand Down
40 changes: 40 additions & 0 deletions apps/files_sharing/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,34 @@ if (!OCA.Sharing) {
*/
OCA.Sharing.App = {

_sharingFileList: null,
_inFileList: null,
_outFileList: null,
_linkFileList: null,

initSharing: function($el) {
if (this._sharingFileList) {
return this._sharingFileList;
}

this._sharingFileList = new OCA.Sharing.FileList(
$el,
{
id: 'shares.all',
scrollContainer: $('#app-content'),
sharedWithUser: true,
fileActions: this._createFileActions(),
config: OCA.Files.App.getFilesConfig()
}
);

this._extendFileList(this._sharingFileList);
this._sharingFileList.appName = t('files_sharing', 'Shared');
this._sharingFileList.$el.find('#emptycontent').html('<div class="icon-shared"></div>' +
'<h2>' + t('files_sharing', 'Nothing shared yet') + '</h2>' +
'<p>' + t('files_sharing', 'Shared files and folders will show up here') + '</p>');
return this._sharingFileList;
},

initSharingIn: function($el) {
if (this._inFileList) {
Expand Down Expand Up @@ -92,6 +118,12 @@ OCA.Sharing.App = {
return this._linkFileList;
},

removeSharing: function() {
if (this._sharingFileList) {
this._sharingFileList.$fileList.empty();
}
},

removeSharingIn: function() {
if (this._inFileList) {
this._inFileList.$fileList.empty();
Expand All @@ -116,9 +148,11 @@ OCA.Sharing.App = {
destroy: function() {
OCA.Files.fileActions.off('setDefault.app-sharing', this._onActionsUpdated);
OCA.Files.fileActions.off('registerAction.app-sharing', this._onActionsUpdated);
this.removeSharing();
this.removeSharingIn();
this.removeSharingOut();
this.removeSharingLinks();
this._sharingFileList = null;
this._inFileList = null;
this._outFileList = null;
this._linkFileList = null;
Expand Down Expand Up @@ -175,6 +209,12 @@ OCA.Sharing.App = {
};

$(document).ready(function() {
$('#app-content-sharing').on('show', function(e) {
OCA.Sharing.App.initSharing($(e.target));
});
$('#app-content-sharing').on('hide', function() {
OCA.Sharing.App.removeSharing();
});
$('#app-content-sharingin').on('show', function(e) {
OCA.Sharing.App.initSharingIn($(e.target));
});
Expand Down