summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js/app.js')
-rw-r--r--apps/files_sharing/js/app.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js
index 800873cd638..1fc13d00382 100644
--- a/apps/files_sharing/js/app.js
+++ b/apps/files_sharing/js/app.js
@@ -55,6 +55,25 @@ OCA.Sharing.App = {
return this._outFileList;
},
+ initSharingLinks: function($el) {
+ if (this._linkFileList) {
+ return this._linkFileList;
+ }
+ this._linkFileList = new OCA.Sharing.FileList(
+ $el,
+ {
+ scrollContainer: $('#app-content'),
+ linksOnly: true,
+ fileActions: this._createFileActions()
+ }
+ );
+
+ this._extendFileList(this._linkFileList);
+ this._linkFileList.appName = t('files_sharing', 'Shared by link');
+ this._linkFileList.$el.find('#emptycontent').text(t('files_sharing', 'You haven\'t shared any files by link yet.'));
+ return this._linkFileList;
+ },
+
removeSharingIn: function() {
if (this._inFileList) {
this._inFileList.$fileList.empty();
@@ -67,6 +86,12 @@ OCA.Sharing.App = {
}
},
+ removeSharingLinks: function() {
+ if (this._linkFileList) {
+ this._linkFileList.$fileList.empty();
+ }
+ },
+
_createFileActions: function() {
// inherit file actions from the files app
var fileActions = new OCA.Files.FileActions();
@@ -104,5 +129,11 @@ $(document).ready(function() {
$('#app-content-sharingout').on('hide', function() {
OCA.Sharing.App.removeSharingOut();
});
+ $('#app-content-sharinglinks').on('show', function(e) {
+ OCA.Sharing.App.initSharingLinks($(e.target));
+ });
+ $('#app-content-sharinglinks').on('hide', function() {
+ OCA.Sharing.App.removeSharingLinks();
+ });
});