nextcloud/apps/files_sharing/js/dist/files_sharing.js.map

1 line
51 KiB
Plaintext

{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/files_sharing/src/files_sharing.js","webpack:///./apps/files_sharing/js/app.js","webpack:///./apps/files_sharing/js/sharedfilelist.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","linkTo","OCA","Sharing","App","_inFileList","_outFileList","_overviewFileList","_pendingFileList","initSharingIn","$el","this","FileList","id","sharedWithUser","fileActions","_createFileActions","config","Files","getFilesConfig","shown","_extendFileList","appName","find","html","initSharingOut","initSharingLinks","_linkFileList","linksOnly","initSharingDeleted","_deletedFileList","defaultFileActionsDisabled","showDeleted","_restoreShareAction","initSharingPening","showPending","_acceptShareAction","initShareingOverview","isOverview","removeSharingIn","$fileList","empty","removeSharingOut","removeSharingLinks","removeSharingDeleted","removeSharingPending","removeSharingOverview","destroy","off","_onActionsUpdated","_globalActionsInitialized","FileActions","registerDefaultActions","merge","_","on","register","PERMISSION_READ","filename","context","setActiveView","silent","fileList","changeDirectory","joinPaths","$file","attr","setDefault","registerAction","displayName","altText","mime","permissions","PERMISSION_ALL","iconClass","type","TYPE_INLINE","actionHandler","fileName","shareId","data","$","post","linkToOCS","success","result","remove","fileInfoModel","attributes","fail","Notification","showTemporary","ajax","url","ev","each","list","action","defaultAction","fileSummary","window","addEventListener","e","target","options","initialize","extend","_sharedWithUser","_linksOnly","_showDeleted","_showPending","_clientSideSort","_allowSelection","_isOverview","apply","arguments","initialized","_renderRow","_createRow","fileData","$tr","before","children","pluck","shares","join","shareOwner","permission","parseInt","PERMISSION_DELETE","expirationTimestamp","expiration","moment","valueOf","formatted","text","modifiedColor","Math","round","Date","getTime","Util","formatDate","relativeModifiedDate","td","append","tooltip","placement","setSharedWithUser","state","updateEmptyContent","dir","getCurrentDirectory","toggleClass","isEmpty","addClass","getDirectoryPermissions","updateStorageStatistics","updateRow","fileInfo","reload","showMask","_reloadCall","abort","_setCurrentDir","promises","deletedShares","format","include_tags","beforeSend","xhr","setRequestHeader","pendingShares","shared_with_me","remoteShares","push","when","callBack","reloadCallback","then","additionalShares","hideMask","files","ocs","concat","_makeFilesFromShares","_makeFilesFromRemoteShares","setFiles","chain","map","share","file","owner","remote","replace","basename","mountpoint","mtime","mimetype","file_id","path","dirname","tags","Share","SHARE_TYPE_REMOTE","filter","share_type","SHARE_TYPE_LINK","file_source","icon","MimeType","getIconUrl","hasPreview","has_preview","item_type","share_with","stime","displayname_owner","shareOwnerId","uid_owner","file_target","extraData","targetDisplayName","share_with_displayname","targetShareWithId","reduce","memo","recipient","recipientId","recipients","recipientData","shareTypes","recipientsCount","values","mountType","keys","sort","_sortComparator"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,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AAEqL,KAAK3J,EAAKuJ,eAI/B1P,SAGW+P,KAAKjO,KAAKkO,oBA0C1B3O,IAAIC,QAAQS,SAAWA","file":"files_sharing.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 464);\n","/**\n * @copyright Copyright (c) 2016 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n * @author Julius Härtl <jus@bitgrid.net>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport '../js/app'\nimport '../js/sharedfilelist'\n\n// eslint-disable-next-line camelcase\n__webpack_nonce__ = btoa(OC.requestToken)\n\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/')\n","/**\n * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\nif (!OCA.Sharing) {\n\t/**\n\t * @namespace OCA.Sharing\n\t */\n\tOCA.Sharing = {}\n}\n\n/**\n * @namespace\n */\nOCA.Sharing.App = {\n\n\t_inFileList: null,\n\t_outFileList: null,\n\t_overviewFileList: null,\n\t_pendingFileList: null,\n\n\tinitSharingIn($el) {\n\t\tif (this._inFileList) {\n\t\t\treturn this._inFileList\n\t\t}\n\n\t\tthis._inFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.self',\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._inFileList)\n\t\tthis._inFileList.appName = t('files_sharing', 'Shared with you')\n\t\tthis._inFileList.$el.find('#emptycontent').html('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared with you yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders others share with you will show up here') + '</p>')\n\t\treturn this._inFileList\n\t},\n\n\tinitSharingOut($el) {\n\t\tif (this._outFileList) {\n\t\t\treturn this._outFileList\n\t\t}\n\t\tthis._outFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.others',\n\t\t\t\tsharedWithUser: false,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._outFileList)\n\t\tthis._outFileList.appName = t('files_sharing', 'Shared with others')\n\t\tthis._outFileList.$el.find('#emptycontent').html('<div class=\"icon-shared\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'Nothing shared yet') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share will show up here') + '</p>')\n\t\treturn this._outFileList\n\t},\n\n\tinitSharingLinks($el) {\n\t\tif (this._linkFileList) {\n\t\t\treturn this._linkFileList\n\t\t}\n\t\tthis._linkFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.link',\n\t\t\t\tlinksOnly: true,\n\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._linkFileList)\n\t\tthis._linkFileList.appName = t('files_sharing', 'Shared by link')\n\t\tthis._linkFileList.$el.find('#emptycontent').html('<div class=\"icon-public\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shared links') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Files and folders you share by link will show up here') + '</p>')\n\t\treturn this._linkFileList\n\t},\n\n\tinitSharingDeleted($el) {\n\t\tif (this._deletedFileList) {\n\t\t\treturn this._deletedFileList\n\t\t}\n\t\tthis._deletedFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.deleted',\n\t\t\t\tdefaultFileActionsDisabled: true,\n\t\t\t\tshowDeleted: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._restoreShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._deletedFileList)\n\t\tthis._deletedFileList.appName = t('files_sharing', 'Deleted shares')\n\t\tthis._deletedFileList.$el.find('#emptycontent').html('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No deleted shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you deleted will show up here') + '</p>')\n\t\treturn this._deletedFileList\n\t},\n\n\tinitSharingPening($el) {\n\t\tif (this._pendingFileList) {\n\t\t\treturn this._pendingFileList\n\t\t}\n\t\tthis._pendingFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.pending',\n\t\t\t\tshowPending: true,\n\t\t\t\tsharedWithUser: true,\n\t\t\t\tfileActions: this._acceptShareAction(),\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._pendingFileList)\n\t\tthis._pendingFileList.appName = t('files_sharing', 'Pending shares')\n\t\tthis._pendingFileList.$el.find('#emptycontent').html('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No pending shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares you have received but not confirmed will show up here') + '</p>')\n\t\treturn this._pendingFileList\n\t},\n\n\tinitShareingOverview($el) {\n\t\tif (this._overviewFileList) {\n\t\t\treturn this._overviewFileList\n\t\t}\n\t\tthis._overviewFileList = new OCA.Sharing.FileList(\n\t\t\t$el,\n\t\t\t{\n\t\t\t\tid: 'shares.overview',\n\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\tisOverview: true,\n\t\t\t\t// The file list is created when a \"show\" event is handled, so\n\t\t\t\t// it should be marked as \"shown\" like it would have been done\n\t\t\t\t// if handling the event with the file list already created.\n\t\t\t\tshown: true,\n\t\t\t}\n\t\t)\n\n\t\tthis._extendFileList(this._overviewFileList)\n\t\tthis._overviewFileList.appName = t('files_sharing', 'Shares')\n\t\tthis._overviewFileList.$el.find('#emptycontent').html('<div class=\"icon-share\"></div>'\n\t\t\t+ '<h2>' + t('files_sharing', 'No shares') + '</h2>'\n\t\t\t+ '<p>' + t('files_sharing', 'Shares will show up here') + '</p>')\n\t\treturn this._overviewFileList\n\t},\n\n\tremoveSharingIn() {\n\t\tif (this._inFileList) {\n\t\t\tthis._inFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOut() {\n\t\tif (this._outFileList) {\n\t\t\tthis._outFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingLinks() {\n\t\tif (this._linkFileList) {\n\t\t\tthis._linkFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingDeleted() {\n\t\tif (this._deletedFileList) {\n\t\t\tthis._deletedFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingPending() {\n\t\tif (this._pendingFileList) {\n\t\t\tthis._pendingFileList.$fileList.empty()\n\t\t}\n\t},\n\n\tremoveSharingOverview() {\n\t\tif (this._overviewFileList) {\n\t\t\tthis._overviewFileList.$fileList.empty()\n\t\t}\n\t},\n\n\t/**\n\t * Destroy the app\n\t */\n\tdestroy() {\n\t\tOCA.Files.fileActions.off('setDefault.app-sharing', this._onActionsUpdated)\n\t\tOCA.Files.fileActions.off('registerAction.app-sharing', this._onActionsUpdated)\n\t\tthis.removeSharingIn()\n\t\tthis.removeSharingOut()\n\t\tthis.removeSharingLinks()\n\t\tthis._inFileList = null\n\t\tthis._outFileList = null\n\t\tthis._linkFileList = null\n\t\tthis._overviewFileList = null\n\t\tdelete this._globalActionsInitialized\n\t},\n\n\t_createFileActions() {\n\t\t// inherit file actions from the files app\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\t// note: not merging the legacy actions because legacy apps are not\n\t\t// compatible with the sharing overview and need to be adapted first\n\t\tfileActions.registerDefaultActions()\n\t\tfileActions.merge(OCA.Files.fileActions)\n\n\t\tif (!this._globalActionsInitialized) {\n\t\t\t// in case actions are registered later\n\t\t\tthis._onActionsUpdated = _.bind(this._onActionsUpdated, this)\n\t\t\tOCA.Files.fileActions.on('setDefault.app-sharing', this._onActionsUpdated)\n\t\t\tOCA.Files.fileActions.on('registerAction.app-sharing', this._onActionsUpdated)\n\t\t\tthis._globalActionsInitialized = true\n\t\t}\n\n\t\t// when the user clicks on a folder, redirect to the corresponding\n\t\t// folder in the files app instead of opening it directly\n\t\tfileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename, context) {\n\t\t\tOCA.Files.App.setActiveView('files', { silent: true })\n\t\t\tOCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true)\n\t\t})\n\t\tfileActions.setDefault('dir', 'Open')\n\t\treturn fileActions\n\t},\n\n\t_restoreShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Restore',\n\t\t\tdisplayName: t('files_sharing', 'Restore'),\n\t\t\taltText: t('files_sharing', 'Restore share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-history',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to restore the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_acceptShareAction() {\n\t\tconst fileActions = new OCA.Files.FileActions()\n\t\tfileActions.registerAction({\n\t\t\tname: 'Accept share',\n\t\t\tdisplayName: t('files_sharing', 'Accept share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-checkmark',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\t$.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId)\n\t\t\t\t\t.success(function(result) {\n\t\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t\t}).fail(function() {\n\t\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to accept the share.'))\n\t\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\tfileActions.registerAction({\n\t\t\tname: 'Reject share',\n\t\t\tdisplayName: t('files_sharing', 'Reject share'),\n\t\t\tmime: 'all',\n\t\t\tpermissions: OC.PERMISSION_ALL,\n\t\t\ticonClass: 'icon-close',\n\t\t\ttype: OCA.Files.FileActions.TYPE_INLINE,\n\t\t\tactionHandler(fileName, context) {\n\t\t\t\tconst shareId = context.$file.data('shareId')\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t}).success(function(result) {\n\t\t\t\t\tcontext.fileList.remove(context.fileInfoModel.attributes.name)\n\t\t\t\t}).fail(function() {\n\t\t\t\t\tOC.Notification.showTemporary(t('files_sharing', 'Something happened. Unable to reject the share.'))\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\t\treturn fileActions\n\t},\n\n\t_onActionsUpdated(ev) {\n\t\t_.each([this._inFileList, this._outFileList, this._linkFileList], function(list) {\n\t\t\tif (!list) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (ev.action) {\n\t\t\t\tlist.fileActions.registerAction(ev.action)\n\t\t\t} else if (ev.defaultAction) {\n\t\t\t\tlist.fileActions.setDefault(\n\t\t\t\t\tev.defaultAction.mime,\n\t\t\t\t\tev.defaultAction.name\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t},\n\n\t_extendFileList(fileList) {\n\t\t// remove size column from summary\n\t\tfileList.fileSummary.$el.find('.filesize').remove()\n\t},\n}\n\nwindow.addEventListener('DOMContentLoaded', function() {\n\t$('#app-content-sharingin').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingIn($(e.target))\n\t})\n\t$('#app-content-sharingin').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingIn()\n\t})\n\t$('#app-content-sharingout').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingOut($(e.target))\n\t})\n\t$('#app-content-sharingout').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOut()\n\t})\n\t$('#app-content-sharinglinks').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingLinks($(e.target))\n\t})\n\t$('#app-content-sharinglinks').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingLinks()\n\t})\n\t$('#app-content-deletedshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingDeleted($(e.target))\n\t})\n\t$('#app-content-deletedshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingDeleted()\n\t})\n\t$('#app-content-pendingshares').on('show', function(e) {\n\t\tOCA.Sharing.App.initSharingPening($(e.target))\n\t})\n\t$('#app-content-pendingshares').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingPending()\n\t})\n\t$('#app-content-shareoverview').on('show', function(e) {\n\t\tOCA.Sharing.App.initShareingOverview($(e.target))\n\t})\n\t$('#app-content-shareoverview').on('hide', function() {\n\t\tOCA.Sharing.App.removeSharingOverview()\n\t})\n})\n","/* eslint-disable */\n/*\n * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n(function() {\n\n\t/**\n\t * @class OCA.Sharing.FileList\n\t * @augments OCA.Files.FileList\n\t *\n\t * @classdesc Sharing file list.\n\t * Contains both \"shared with others\" and \"shared with you\" modes.\n\t *\n\t * @param $el container element with existing markup for the #controls\n\t * and a table\n\t * @param [options] map of options, see other parameters\n\t * @param {boolean} [options.sharedWithUser] true to return files shared with\n\t * the current user, false to return files that the user shared with others.\n\t * Defaults to false.\n\t * @param {boolean} [options.linksOnly] true to return only link shares\n\t */\n\tvar FileList = function($el, options) {\n\t\tthis.initialize($el, options)\n\t}\n\tFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,\n\t\t/** @lends OCA.Sharing.FileList.prototype */ {\n\t\t\tappName: 'Shares',\n\n\t\t\t/**\n\t\t * Whether the list shows the files shared with the user (true) or\n\t\t * the files that the user shared with others (false).\n\t\t */\n\t\t\t_sharedWithUser: false,\n\t\t\t_linksOnly: false,\n\t\t\t_showDeleted: false,\n\t\t\t_showPending: false,\n\t\t\t_clientSideSort: true,\n\t\t\t_allowSelection: false,\n\t\t\t_isOverview: false,\n\n\t\t\t/**\n\t\t * @private\n\t\t */\n\t\t\tinitialize: function($el, options) {\n\t\t\t\tOCA.Files.FileList.prototype.initialize.apply(this, arguments)\n\t\t\t\tif (this.initialized) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// TODO: consolidate both options\n\t\t\t\tif (options && options.sharedWithUser) {\n\t\t\t\t\tthis._sharedWithUser = true\n\t\t\t\t}\n\t\t\t\tif (options && options.linksOnly) {\n\t\t\t\t\tthis._linksOnly = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showDeleted) {\n\t\t\t\t\tthis._showDeleted = true\n\t\t\t\t}\n\t\t\t\tif (options && options.showPending) {\n\t\t\t\t\tthis._showPending = true\n\t\t\t\t}\n\t\t\t\tif (options && options.isOverview) {\n\t\t\t\t\tthis._isOverview = true\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_renderRow: function() {\n\t\t\t// HACK: needed to call the overridden _renderRow\n\t\t\t// this is because at the time this class is created\n\t\t\t// the overriding hasn't been done yet...\n\t\t\t\treturn OCA.Files.FileList.prototype._renderRow.apply(this, arguments)\n\t\t\t},\n\n\t\t\t_createRow: function(fileData) {\n\t\t\t// TODO: hook earlier and render the whole row here\n\t\t\t\tvar $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments)\n\t\t\t\t$tr.find('.filesize').remove()\n\t\t\t\t$tr.find('td.date').before($tr.children('td:first'))\n\t\t\t\t$tr.find('td.filename input:checkbox').remove()\n\t\t\t\t$tr.attr('data-share-id', _.pluck(fileData.shares, 'id').join(','))\n\t\t\t\tif (this._sharedWithUser) {\n\t\t\t\t\t$tr.attr('data-share-owner', fileData.shareOwner)\n\t\t\t\t\t$tr.attr('data-mounttype', 'shared-root')\n\t\t\t\t\tvar permission = parseInt($tr.attr('data-permissions')) | OC.PERMISSION_DELETE\n\t\t\t\t\t$tr.attr('data-permissions', permission)\n\t\t\t\t}\n\t\t\t\tif (this._showDeleted || this._showPending) {\n\t\t\t\t\tvar permission = fileData.permissions\n\t\t\t\t\t$tr.attr('data-share-permissions', permission)\n\t\t\t\t}\n\n\t\t\t\t// add row with expiration date for link only shares - influenced by _createRow of filelist\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tvar expirationTimestamp = 0\n\t\t\t\t\tif (fileData.shares && fileData.shares[0].expiration !== null) {\n\t\t\t\t\t\texpirationTimestamp = moment(fileData.shares[0].expiration).valueOf()\n\t\t\t\t\t}\n\t\t\t\t\t$tr.attr('data-expiration', expirationTimestamp)\n\n\t\t\t\t\t// date column (1000 milliseconds to seconds, 60 seconds, 60 minutes, 24 hours)\n\t\t\t\t\t// difference in days multiplied by 5 - brightest shade for expiry dates in more than 32 days (160/5)\n\t\t\t\t\tvar modifiedColor = Math.round((expirationTimestamp - (new Date()).getTime()) / 1000 / 60 / 60 / 24 * 5)\n\t\t\t\t\t// ensure that the brightest color is still readable\n\t\t\t\t\tif (modifiedColor >= 160) {\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\n\t\t\t\t\tvar formatted\n\t\t\t\t\tvar text\n\t\t\t\t\tif (expirationTimestamp > 0) {\n\t\t\t\t\t\tformatted = OC.Util.formatDate(expirationTimestamp)\n\t\t\t\t\t\ttext = OC.Util.relativeModifiedDate(expirationTimestamp)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformatted = t('files_sharing', 'No expiration date set')\n\t\t\t\t\t\ttext = ''\n\t\t\t\t\t\tmodifiedColor = 160\n\t\t\t\t\t}\n\t\t\t\t\ttd = $('<td></td>').attr({ 'class': 'date' })\n\t\t\t\t\ttd.append($('<span></span>').attr({\n\t\t\t\t\t\t'class': 'modified',\n\t\t\t\t\t\t'title': formatted,\n\t\t\t\t\t\t'style': 'color:rgb(' + modifiedColor + ',' + modifiedColor + ',' + modifiedColor + ')'\n\t\t\t\t\t}).text(text)\n\t\t\t\t\t\t.tooltip({ placement: 'top' })\n\t\t\t\t\t)\n\n\t\t\t\t\t$tr.append(td)\n\t\t\t\t}\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\t/**\n\t\t * Set whether the list should contain outgoing shares\n\t\t * or incoming shares.\n\t\t *\n\t\t * @param state true for incoming shares, false otherwise\n\t\t */\n\t\t\tsetSharedWithUser: function(state) {\n\t\t\t\tthis._sharedWithUser = !!state\n\t\t\t},\n\n\t\t\tupdateEmptyContent: function() {\n\t\t\t\tvar dir = this.getCurrentDirectory()\n\t\t\t\tif (dir === '/') {\n\t\t\t\t// root has special permissions\n\t\t\t\t\tthis.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty)\n\t\t\t\t\tthis.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty)\n\n\t\t\t\t\t// hide expiration date header for non link only shares\n\t\t\t\t\tif (!this._linksOnly) {\n\t\t\t\t\t\tthis.$el.find('th.column-expiration').addClass('hidden')\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tOCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments)\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetDirectoryPermissions: function() {\n\t\t\t\treturn OC.PERMISSION_READ | OC.PERMISSION_DELETE\n\t\t\t},\n\n\t\t\tupdateStorageStatistics: function() {\n\t\t\t// no op because it doesn't have\n\t\t\t// storage info like free space / used space\n\t\t\t},\n\n\t\t\tupdateRow: function($tr, fileInfo, options) {\n\t\t\t// no-op, suppress re-rendering\n\t\t\t\treturn $tr\n\t\t\t},\n\n\t\t\treload: function() {\n\t\t\t\tthis.showMask()\n\t\t\t\tif (this._reloadCall) {\n\t\t\t\t\tthis._reloadCall.abort()\n\t\t\t\t}\n\n\t\t\t\t// there is only root\n\t\t\t\tthis._setCurrentDir('/', false)\n\n\t\t\t\tvar promises = []\n\n\t\t\t\tvar deletedShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1', 2) + 'deletedshares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pendingShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + 'pending',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json'\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar shares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tshared_with_me: this._sharedWithUser !== false,\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar remoteShares = {\n\t\t\t\t\turl: OC.linkToOCS('apps/files_sharing/api/v1') + 'remote_shares',\n\t\t\t\t\t/* jshint camelcase: false */\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tformat: 'json',\n\t\t\t\t\t\tinclude_tags: true\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tbeforeSend: function(xhr) {\n\t\t\t\t\t\txhr.setRequestHeader('OCS-APIREQUEST', 'true')\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add the proper ajax requests to the list and run them\n\t\t\t\t// and make sure we have 2 promises\n\t\t\t\tif (this._showDeleted) {\n\t\t\t\t\tpromises.push($.ajax(deletedShares))\n\t\t\t\t} else if (this._showPending) {\n\t\t\t\t\tpromises.push($.ajax(pendingShares))\n\t\t\t\t} else {\n\t\t\t\t\tpromises.push($.ajax(shares))\n\n\t\t\t\t\tif (this._sharedWithUser !== false || this._isOverview) {\n\t\t\t\t\t\tpromises.push($.ajax(remoteShares))\n\t\t\t\t\t}\n\t\t\t\t\tif (this._isOverview) {\n\t\t\t\t\t\tshares.data.shared_with_me = !shares.data.shared_with_me\n\t\t\t\t\t\tpromises.push($.ajax(shares))\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._reloadCall = $.when.apply($, promises)\n\t\t\t\tvar callBack = this.reloadCallback.bind(this)\n\t\t\t\treturn this._reloadCall.then(callBack, callBack)\n\t\t\t},\n\n\t\t\treloadCallback: function(shares, remoteShares, additionalShares) {\n\t\t\t\tdelete this._reloadCall\n\t\t\t\tthis.hideMask()\n\n\t\t\t\tthis.$el.find('#headerSharedWith').text(\n\t\t\t\t\tt('files_sharing', this._sharedWithUser ? 'Shared by' : 'Shared with')\n\t\t\t\t)\n\n\t\t\t\tvar files = []\n\n\t\t\t\t// make sure to use the same format\n\t\t\t\tif (shares[0] && shares[0].ocs) {\n\t\t\t\t\tshares = shares[0]\n\t\t\t\t}\n\t\t\t\tif (remoteShares && remoteShares[0] && remoteShares[0].ocs) {\n\t\t\t\t\tremoteShares = remoteShares[0]\n\t\t\t\t}\n\t\t\t\tif (additionalShares && additionalShares[0] && additionalShares[0].ocs) {\n\t\t\t\t\tadditionalShares = additionalShares[0]\n\t\t\t\t}\n\n\t\t\t\tif (shares.ocs && shares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(shares.ocs.data, this._sharedWithUser))\n\t\t\t\t}\n\n\t\t\t\tif (remoteShares && remoteShares.ocs && remoteShares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromRemoteShares(remoteShares.ocs.data))\n\t\t\t\t}\n\n\t\t\t\tif (additionalShares && additionalShares.ocs && additionalShares.ocs.data) {\n\t\t\t\t\tfiles = files.concat(this._makeFilesFromShares(additionalShares.ocs.data, !this._sharedWithUser))\n\t\t\t\t}\n\n\t\t\t\tthis.setFiles(files)\n\t\t\t\treturn true\n\t\t\t},\n\n\t\t\t_makeFilesFromRemoteShares: function(data) {\n\t\t\t\tvar files = data\n\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tshareOwner: share.owner + '@' + share.remote.replace(/.*?:\\/\\//g, ''),\n\t\t\t\t\t\t\tname: OC.basename(share.mountpoint),\n\t\t\t\t\t\t\tmtime: share.mtime * 1000,\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\ttype: share.type,\n\t\t\t\t\t\t\tid: share.file_id,\n\t\t\t\t\t\t\tpath: OC.dirname(share.mountpoint),\n\t\t\t\t\t\t\tpermissions: share.permissions,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfile.shares = [{\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: OC.Share.SHARE_TYPE_REMOTE\n\t\t\t\t\t\t}]\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t\t.value()\n\t\t\t\treturn files\n\t\t\t},\n\n\t\t\t/**\n\t\t * Converts the OCS API share response data to a file info\n\t\t * list\n\t\t * @param {Array} data OCS API share array\n\t\t * @param {bool} sharedWithUser\n\t\t * @returns {Array.<OCA.Sharing.SharedFileInfo>} array of shared file info\n\t\t */\n\t\t\t_makeFilesFromShares: function(data, sharedWithUser) {\n\t\t\t/* jshint camelcase: false */\n\t\t\t\tvar files = data\n\n\t\t\t\tif (this._linksOnly) {\n\t\t\t\t\tfiles = _.filter(data, function(share) {\n\t\t\t\t\t\treturn share.share_type === OC.Share.SHARE_TYPE_LINK\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// OCS API uses non-camelcased names\n\t\t\t\tfiles = _.chain(files)\n\t\t\t\t// convert share data to file data\n\t\t\t\t\t.map(function(share) {\n\t\t\t\t\t// TODO: use OC.Files.FileInfo\n\t\t\t\t\t\tvar file = {\n\t\t\t\t\t\t\tid: share.file_source,\n\t\t\t\t\t\t\ticon: OC.MimeType.getIconUrl(share.mimetype),\n\t\t\t\t\t\t\tmimetype: share.mimetype,\n\t\t\t\t\t\t\thasPreview: share.has_preview,\n\t\t\t\t\t\t\ttags: share.tags || []\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (share.item_type === 'folder') {\n\t\t\t\t\t\t\tfile.type = 'dir'\n\t\t\t\t\t\t\tfile.mimetype = 'httpd/unix-directory'\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfile.type = 'file'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfile.share = {\n\t\t\t\t\t\t\tid: share.id,\n\t\t\t\t\t\t\ttype: share.share_type,\n\t\t\t\t\t\t\ttarget: share.share_with,\n\t\t\t\t\t\t\tstime: share.stime * 1000,\n\t\t\t\t\t\t\texpiration: share.expiration\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t\tfile.shareOwner = share.displayname_owner\n\t\t\t\t\t\t\tfile.shareOwnerId = share.uid_owner\n\t\t\t\t\t\t\tfile.name = OC.basename(share.file_target)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.file_target)\n\t\t\t\t\t\t\tfile.permissions = share.permissions\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.file_target\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (share.share_type !== OC.Share.SHARE_TYPE_LINK) {\n\t\t\t\t\t\t\t\tfile.share.targetDisplayName = share.share_with_displayname\n\t\t\t\t\t\t\t\tfile.share.targetShareWithId = share.share_with\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfile.name = OC.basename(share.path)\n\t\t\t\t\t\t\tfile.path = OC.dirname(share.path)\n\t\t\t\t\t\t\tfile.permissions = OC.PERMISSION_ALL\n\t\t\t\t\t\t\tif (file.path) {\n\t\t\t\t\t\t\t\tfile.extraData = share.path\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn file\n\t\t\t\t\t})\n\t\t\t\t// Group all files and have a \"shares\" array with\n\t\t\t\t// the share info for each file.\n\t\t\t\t//\n\t\t\t\t// This uses a hash memo to cumulate share information\n\t\t\t\t// inside the same file object (by file id).\n\t\t\t\t\t.reduce(function(memo, file) {\n\t\t\t\t\t\tvar data = memo[file.id]\n\t\t\t\t\t\tvar recipient = file.share.targetDisplayName\n\t\t\t\t\t\tvar recipientId = file.share.targetShareWithId\n\t\t\t\t\t\tif (!data) {\n\t\t\t\t\t\t\tdata = memo[file.id] = file\n\t\t\t\t\t\t\tdata.shares = [file.share]\n\t\t\t\t\t\t\t// using a hash to make them unique,\n\t\t\t\t\t\t\t// this is only a list to be displayed\n\t\t\t\t\t\t\tdata.recipients = {}\n\t\t\t\t\t\t\tdata.recipientData = {}\n\t\t\t\t\t\t\t// share types\n\t\t\t\t\t\t\tdata.shareTypes = {}\n\t\t\t\t\t\t\t// counter is cheaper than calling _.keys().length\n\t\t\t\t\t\t\tdata.recipientsCount = 0\n\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// always take the most recent stime\n\t\t\t\t\t\t\tif (file.share.stime > data.mtime) {\n\t\t\t\t\t\t\t\tdata.mtime = file.share.stime\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.shares.push(file.share)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (recipient) {\n\t\t\t\t\t\t// limit counterparts for output\n\t\t\t\t\t\t\tif (data.recipientsCount < 4) {\n\t\t\t\t\t\t\t// only store the first ones, they will be the only ones\n\t\t\t\t\t\t\t// displayed\n\t\t\t\t\t\t\t\tdata.recipients[recipient] = true\n\t\t\t\t\t\t\t\tdata.recipientData[data.recipientsCount] = {\n\t\t\t\t\t\t\t\t\t'shareWith': recipientId,\n\t\t\t\t\t\t\t\t\t'shareWithDisplayName': recipient\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata.recipientsCount++\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata.shareTypes[file.share.type] = true\n\n\t\t\t\t\t\tdelete file.share\n\t\t\t\t\t\treturn memo\n\t\t\t\t\t}, {})\n\t\t\t\t// Retrieve only the values of the returned hash\n\t\t\t\t\t.values()\n\t\t\t\t// Clean up\n\t\t\t\t\t.each(function(data) {\n\t\t\t\t\t// convert the recipients map to a flat\n\t\t\t\t\t// array of sorted names\n\t\t\t\t\t\tdata.mountType = 'shared'\n\t\t\t\t\t\tdelete data.recipientsCount\n\t\t\t\t\t\tif (sharedWithUser) {\n\t\t\t\t\t\t// only for outgoing shares\n\t\t\t\t\t\t\tdelete data.shareTypes\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdata.shareTypes = _.keys(data.shareTypes)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t// Finish the chain by getting the result\n\t\t\t\t\t.value()\n\n\t\t\t\t// Sort by expected sort comparator\n\t\t\t\treturn files.sort(this._sortComparator)\n\t\t\t}\n\t\t})\n\n\t/**\n\t * Share info attributes.\n\t *\n\t * @typedef {Object} OCA.Sharing.ShareInfo\n\t *\n\t * @property {int} id share ID\n\t * @property {int} type share type\n\t * @property {String} target share target, either user name or group name\n\t * @property {int} stime share timestamp in milliseconds\n\t * @property {String} [targetDisplayName] display name of the recipient\n\t * (only when shared with others)\n\t * @property {String} [targetShareWithId] id of the recipient\n\t *\n\t */\n\n\t/**\n\t * Recipient attributes\n\t *\n\t * @typedef {Object} OCA.Sharing.RecipientInfo\n\t * @property {String} shareWith the id of the recipient\n\t * @property {String} shareWithDisplayName the display name of the recipient\n\t */\n\n\t/**\n\t * Shared file info attributes.\n\t *\n\t * @typedef {OCA.Files.FileInfo} OCA.Sharing.SharedFileInfo\n\t *\n\t * @property {Array.<OCA.Sharing.ShareInfo>} shares array of shares for\n\t * this file\n\t * @property {int} mtime most recent share time (if multiple shares)\n\t * @property {String} shareOwner name of the share owner\n\t * @property {Array.<String>} recipients name of the first 4 recipients\n\t * (this is mostly for display purposes)\n\t * @property {Object.<OCA.Sharing.RecipientInfo>} recipientData (as object for easier\n\t * passing to HTML data attributes with jQuery)\n\t */\n\n\tOCA.Sharing.FileList = FileList\n})()\n"],"sourceRoot":""}