From 23de9db7a7b4b884c0e6b060a0c06dfa599e0ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 22 May 2019 11:51:35 +0200 Subject: [PATCH] Bump files_sharing bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../js/dist/additionalScripts.js | 1255 +--------------- .../js/dist/additionalScripts.js.map | 2 +- apps/files_sharing/js/dist/collaboration.js | 118 +- .../js/dist/collaboration.js.map | 2 +- apps/files_sharing/js/dist/files_sharing.3.js | 1306 ++++++++++++----- .../js/dist/files_sharing.3.js.map | 2 +- apps/files_sharing/js/dist/files_sharing.4.js | 4 +- .../js/dist/files_sharing.4.js.map | 2 +- apps/files_sharing/js/dist/files_sharing.js | 898 +----------- .../js/dist/files_sharing.js.map | 2 +- 10 files changed, 948 insertions(+), 2643 deletions(-) diff --git a/apps/files_sharing/js/dist/additionalScripts.js b/apps/files_sharing/js/dist/additionalScripts.js index 914332813c..984b3324ef 100644 --- a/apps/files_sharing/js/dist/additionalScripts.js +++ b/apps/files_sharing/js/dist/additionalScripts.js @@ -1,608 +1,4 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0, resolves = []; -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ modules[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(parentJsonpFunction) parentJsonpFunction(data); -/******/ -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ }; -/******/ -/******/ -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "additionalScripts": 0 -/******/ }; -/******/ -/******/ -/******/ -/******/ // script path function -/******/ function jsonpScriptSrc(chunkId) { -/******/ return __webpack_require__.p + "files_sharing." + chunkId + ".js" -/******/ } -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // This file contains only the entry chunk. -/******/ // The chunk loading function for additional chunks -/******/ __webpack_require__.e = function requireEnsure(chunkId) { -/******/ var promises = []; -/******/ -/******/ -/******/ // JSONP chunk loading for javascript -/******/ -/******/ var installedChunkData = installedChunks[chunkId]; -/******/ if(installedChunkData !== 0) { // 0 means "already installed". -/******/ -/******/ // a Promise means "currently loading". -/******/ if(installedChunkData) { -/******/ promises.push(installedChunkData[2]); -/******/ } else { -/******/ // setup Promise in chunk cache -/******/ var promise = new Promise(function(resolve, reject) { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); -/******/ promises.push(installedChunkData[2] = promise); -/******/ -/******/ // start chunk loading -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = jsonpScriptSrc(chunkId); -/******/ -/******/ onScriptComplete = function (event) { -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var chunk = installedChunks[chunkId]; -/******/ if(chunk !== 0) { -/******/ if(chunk) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'); -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ chunk[1](error); -/******/ } -/******/ installedChunks[chunkId] = undefined; -/******/ } -/******/ }; -/******/ var timeout = setTimeout(function(){ -/******/ onScriptComplete({ type: 'timeout', target: script }); -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); -/******/ } -/******/ } -/******/ return Promise.all(promises); -/******/ }; -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/js/"; -/******/ -/******/ // on error function for async loading -/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; -/******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); -/******/ var parentJsonpFunction = oldJsonpFunction; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./apps/files_sharing/src/additionalScripts.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./apps/files_sharing/src/additionalScripts.js": -/*!*****************************************************!*\ - !*** ./apps/files_sharing/src/additionalScripts.js ***! - \*****************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _share__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./share */ "./apps/files_sharing/src/share.js"); -/* harmony import */ var _share__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_share__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _sharetabview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sharetabview */ "./apps/files_sharing/src/sharetabview.js"); -/* harmony import */ var _sharetabview__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sharetabview__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _sharebreadcrumbview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sharebreadcrumbview */ "./apps/files_sharing/src/sharebreadcrumbview.js"); -/* harmony import */ var _sharebreadcrumbview__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_sharebreadcrumbview__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _style_sharetabview_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style/sharetabview.scss */ "./apps/files_sharing/src/style/sharetabview.scss"); -/* harmony import */ var _style_sharetabview_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_sharetabview_scss__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _style_sharebreadcrumb_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style/sharebreadcrumb.scss */ "./apps/files_sharing/src/style/sharebreadcrumb.scss"); -/* harmony import */ var _style_sharebreadcrumb_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_sharebreadcrumb_scss__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _collaborationresourceshandler_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./collaborationresourceshandler.js */ "./apps/files_sharing/src/collaborationresourceshandler.js"); -/* harmony import */ var _collaborationresourceshandler_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_collaborationresourceshandler_js__WEBPACK_IMPORTED_MODULE_5__); -__webpack_require__.p = OC.linkTo('files_sharing', 'js/dist/'); -__webpack_require__.nc = btoa(OC.requestToken); - - - - - - -window.OCA.Sharing = OCA.Sharing; - -/***/ }), - -/***/ "./apps/files_sharing/src/collaborationresourceshandler.js": -/*!*****************************************************************!*\ - !*** ./apps/files_sharing/src/collaborationresourceshandler.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__.p = OC.linkTo('files_sharing', 'js/dist/'); -__webpack_require__.nc = btoa(OC.requestToken); -window.OCP.Collaboration.registerType('file', { - action: function action() { - return new Promise(function (resolve, reject) { - OC.dialogs.filepicker(t('files_sharing', 'Link to a file'), function (f) { - var client = OC.Files.getClient(); - client.getFileInfo(f).then(function (status, fileInfo) { - resolve(fileInfo.id); - }, function () { - reject(); - }); - }, false); - }); - }, - typeString: t('files_sharing', 'Link to a file'), - typeIconClass: 'icon-files-dark' -}); - -/***/ }), - -/***/ "./apps/files_sharing/src/share.js": -/*!*****************************************!*\ - !*** ./apps/files_sharing/src/share.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/* - * Copyright (c) 2014 - * - * This file is licensed under the Affero General Public License version 3 - * or later. - * - * See the COPYING-README file. - * - */ -(function () { - _.extend(OC.Files.Client, { - PROPERTY_SHARE_TYPES: '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types', - PROPERTY_OWNER_ID: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-id', - PROPERTY_OWNER_DISPLAY_NAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name' - }); - - if (!OCA.Sharing) { - OCA.Sharing = {}; - } - /** - * @namespace - */ - - - OCA.Sharing.Util = { - /** - * Initialize the sharing plugin. - * - * Registers the "Share" file action and adds additional - * DOM attributes for the sharing file info. - * - * @param {OCA.Files.FileList} fileList file list to be extended - */ - attach: function attach(fileList) { - // core sharing is disabled/not loaded - if (!OC.Share) { - return; - } - - if (fileList.id === 'trashbin' || fileList.id === 'files.public') { - return; - } - - var fileActions = fileList.fileActions; - var oldCreateRow = fileList._createRow; - - fileList._createRow = function (fileData) { - var tr = oldCreateRow.apply(this, arguments); - var sharePermissions = OCA.Sharing.Util.getSharePermissions(fileData); - - if (fileData.permissions === 0) { - // no permission, disabling sidebar - delete fileActions.actions.all.Comment; - delete fileActions.actions.all.Details; - delete fileActions.actions.all.Goto; - } - - tr.attr('data-share-permissions', sharePermissions); - - if (fileData.shareOwner) { - tr.attr('data-share-owner', fileData.shareOwner); - tr.attr('data-share-owner-id', fileData.shareOwnerId); // user should always be able to rename a mount point - - if (fileData.mountType === 'shared-root') { - tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE); - } - } - - if (fileData.recipientData && !_.isEmpty(fileData.recipientData)) { - tr.attr('data-share-recipient-data', JSON.stringify(fileData.recipientData)); - } - - if (fileData.shareTypes) { - tr.attr('data-share-types', fileData.shareTypes.join(',')); - } - - return tr; - }; - - var oldElementToFile = fileList.elementToFile; - - fileList.elementToFile = function ($el) { - var fileInfo = oldElementToFile.apply(this, arguments); - fileInfo.sharePermissions = $el.attr('data-share-permissions') || undefined; - fileInfo.shareOwner = $el.attr('data-share-owner') || undefined; - fileInfo.shareOwnerId = $el.attr('data-share-owner-id') || undefined; - - if ($el.attr('data-share-types')) { - fileInfo.shareTypes = $el.attr('data-share-types').split(','); - } - - if ($el.attr('data-expiration')) { - var expirationTimestamp = parseInt($el.attr('data-expiration')); - fileInfo.shares = []; - fileInfo.shares.push({ - expiration: expirationTimestamp - }); - } - - return fileInfo; - }; - - var oldGetWebdavProperties = fileList._getWebdavProperties; - - fileList._getWebdavProperties = function () { - var props = oldGetWebdavProperties.apply(this, arguments); - props.push(OC.Files.Client.PROPERTY_OWNER_ID); - props.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME); - props.push(OC.Files.Client.PROPERTY_SHARE_TYPES); - return props; - }; - - fileList.filesClient.addFileInfoParser(function (response) { - var data = {}; - var props = response.propStat[0].properties; - var permissionsProp = props[OC.Files.Client.PROPERTY_PERMISSIONS]; - - if (permissionsProp && permissionsProp.indexOf('S') >= 0) { - data.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME]; - data.shareOwnerId = props[OC.Files.Client.PROPERTY_OWNER_ID]; - } - - var shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES]; - - if (shareTypesProp) { - data.shareTypes = _.chain(shareTypesProp).filter(function (xmlvalue) { - return xmlvalue.namespaceURI === OC.Files.Client.NS_OWNCLOUD && xmlvalue.nodeName.split(':')[1] === 'share-type'; - }).map(function (xmlvalue) { - return parseInt(xmlvalue.textContent || xmlvalue.text, 10); - }).value(); - } - - return data; - }); // use delegate to catch the case with multiple file lists - - fileList.$el.on('fileActionsReady', function (ev) { - var $files = ev.$files; - - _.each($files, function (file) { - var $tr = $(file); - var shareTypes = $tr.attr('data-share-types') || ''; - var shareOwner = $tr.attr('data-share-owner'); - - if (shareTypes || shareOwner) { - var hasLink = false; - var hasShares = false; - - _.each(shareTypes.split(',') || [], function (shareType) { - shareType = parseInt(shareType, 10); - - if (shareType === OC.Share.SHARE_TYPE_LINK) { - hasLink = true; - } else if (shareType === OC.Share.SHARE_TYPE_EMAIL) { - hasLink = true; - } else if (shareType === OC.Share.SHARE_TYPE_USER) { - hasShares = true; - } else if (shareType === OC.Share.SHARE_TYPE_GROUP) { - hasShares = true; - } else if (shareType === OC.Share.SHARE_TYPE_REMOTE) { - hasShares = true; - } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { - hasShares = true; - } else if (shareType === OC.Share.SHARE_TYPE_ROOM) { - hasShares = true; - } - }); - - OCA.Sharing.Util._updateFileActionIcon($tr, hasShares, hasLink); - } - }); - }); - fileList.$el.on('changeDirectory', function () { - OCA.Sharing.sharesLoaded = false; - }); - fileActions.registerAction({ - name: 'Share', - displayName: function displayName(context) { - if (context && context.$file) { - var shareType = parseInt(context.$file.data('share-types'), 10); - var shareOwner = context.$file.data('share-owner-id'); - - if (shareType >= 0 || shareOwner) { - return t('core', 'Shared'); - } - } - - return t('core', 'Share'); - }, - altText: t('core', 'Share'), - mime: 'all', - order: -150, - permissions: OC.PERMISSION_ALL, - iconClass: function iconClass(fileName, context) { - var shareType = parseInt(context.$file.data('share-types'), 10); - - if (shareType === OC.Share.SHARE_TYPE_EMAIL || shareType === OC.Share.SHARE_TYPE_LINK) { - return 'icon-public'; - } - - return 'icon-shared'; - }, - icon: function icon(fileName, context) { - var shareOwner = context.$file.data('share-owner-id'); - - if (shareOwner) { - return OC.generateUrl("/avatar/".concat(shareOwner, "/32")); - } - }, - type: OCA.Files.FileActions.TYPE_INLINE, - actionHandler: function actionHandler(fileName, context) { - // do not open sidebar if permission is set and equal to 0 - var permissions = parseInt(context.$file.data('share-permissions'), 10); - - if (isNaN(permissions) || permissions > 0) { - fileList.showDetailsView(fileName, 'shareTabView'); - } - }, - render: function render(actionSpec, isDefault, context) { - var permissions = parseInt(context.$file.data('permissions'), 10); // if no share permissions but share owner exists, still show the link - - if ((permissions & OC.PERMISSION_SHARE) !== 0 || context.$file.attr('data-share-owner')) { - return fileActions._defaultRenderAction.call(fileActions, actionSpec, isDefault, context); - } // don't render anything - - - return null; - } - }); - var shareTab = new OCA.Sharing.ShareTabView('shareTabView', { - order: -20 - }); // detect changes and change the matching list entry - - shareTab.on('sharesChanged', function (shareModel) { - var fileInfoModel = shareModel.fileInfoModel; - var $tr = fileList.findFileEl(fileInfoModel.get('name')); // We count email shares as link share - - var hasLinkShares = shareModel.hasLinkShares(); - shareModel.get('shares').forEach(function (share) { - if (share.share_type === OC.Share.SHARE_TYPE_EMAIL) { - hasLinkShares = true; - } - }); - - OCA.Sharing.Util._updateFileListDataAttributes(fileList, $tr, shareModel); - - if (!OCA.Sharing.Util._updateFileActionIcon($tr, shareModel.hasUserShares(), hasLinkShares)) { - // remove icon, if applicable - OC.Share.markFileAsShared($tr, false, false); - } // FIXME: this is too convoluted. We need to get rid of the above updates - // and only ever update the model and let the events take care of rerendering - - - fileInfoModel.set({ - shareTypes: shareModel.getShareTypes(), - // in case markFileAsShared decided to change the icon, - // we need to modify the model - // (FIXME: yes, this is hacky) - icon: $tr.attr('data-icon') - }); - }); - fileList.registerTabView(shareTab); - var breadCrumbSharingDetailView = new OCA.Sharing.ShareBreadCrumbView({ - shareTab: shareTab - }); - fileList.registerBreadCrumbDetailView(breadCrumbSharingDetailView); - }, - - /** - * Update file list data attributes - */ - _updateFileListDataAttributes: function _updateFileListDataAttributes(fileList, $tr, shareModel) { - // files app current cannot show recipients on load, so we don't update the - // icon when changed for consistency - if (fileList.id === 'files') { - return; - } - - var recipients = _.pluck(shareModel.get('shares'), 'share_with_displayname'); // note: we only update the data attribute because updateIcon() - - - if (recipients.length) { - var recipientData = _.mapObject(shareModel.get('shares'), function (share) { - return { - shareWith: share.share_with, - shareWithDisplayName: share.share_with_displayname - }; - }); - - $tr.attr('data-share-recipient-data', JSON.stringify(recipientData)); - } else { - $tr.removeAttr('data-share-recipient-data'); - } - }, - - /** - * Update the file action share icon for the given file - * - * @param $tr file element of the file to update - * @param {boolean} hasUserShares true if a user share exists - * @param {boolean} hasLinkShares true if a link share exists - * - * @return {boolean} true if the icon was set, false otherwise - */ - _updateFileActionIcon: function _updateFileActionIcon($tr, hasUserShares, hasLinkShares) { - // if the statuses are loaded already, use them for the icon - // (needed when scrolling to the next page) - if (hasUserShares || hasLinkShares || $tr.attr('data-share-recipient-data') || $tr.attr('data-share-owner')) { - OC.Share.markFileAsShared($tr, true, hasLinkShares); - return true; - } - - return false; - }, - - /** - * @param {Array} fileData - * @returns {String} - */ - getSharePermissions: function getSharePermissions(fileData) { - return fileData.sharePermissions; - } - }; -})(); - -OC.Plugins.register('OCA.Files.FileList', OCA.Sharing.Util); - -/***/ }), - -/***/ "./apps/files_sharing/src/sharebreadcrumbview.js": -/*!*******************************************************!*\ - !*** ./apps/files_sharing/src/sharebreadcrumbview.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/* global Handlebars, OC */ - +!function(e){function n(n){for(var t,r,a=n[0],o=n[1],s=0,l=[];st.parts.length&&(i.parts.length=t.parts.length)}else{var o=[];for(r=0;r=0&&(n.shareOwner=t[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME],n.shareOwnerId=t[OC.Files.Client.PROPERTY_OWNER_ID]);var r=t[OC.Files.Client.PROPERTY_SHARE_TYPES];return r&&(n.shareTypes=_.chain(r).filter(function(e){return e.namespaceURI===OC.Files.Client.NS_OWNCLOUD&&"share-type"===e.nodeName.split(":")[1]}).map(function(e){return parseInt(e.textContent||e.text,10)}).value()),n}),e.$el.on("fileActionsReady",function(e){var n=e.$files;_.each(n,function(e){var n=$(e),t=n.attr("data-share-types")||"",i=n.attr("data-share-owner");if(t||i){var r=!1,a=!1;_.each(t.split(",")||[],function(e){(e=parseInt(e,10))===OC.Share.SHARE_TYPE_LINK?r=!0:e===OC.Share.SHARE_TYPE_EMAIL?r=!0:e===OC.Share.SHARE_TYPE_USER?a=!0:e===OC.Share.SHARE_TYPE_GROUP?a=!0:e===OC.Share.SHARE_TYPE_REMOTE?a=!0:e===OC.Share.SHARE_TYPE_CIRCLE?a=!0:e===OC.Share.SHARE_TYPE_ROOM&&(a=!0)}),OCA.Sharing.Util._updateFileActionIcon(n,a,r)}})}),e.$el.on("changeDirectory",function(){OCA.Sharing.sharesLoaded=!1}),n.registerAction({name:"Share",displayName:function(e){if(e&&e.$file){var n=parseInt(e.$file.data("share-types"),10),i=e.$file.data("share-owner-id");if(n>=0||i)return t("core","Shared")}return t("core","Share")},altText:t("core","Share"),mime:"all",order:-150,permissions:OC.PERMISSION_ALL,iconClass:function(e,n){var t=parseInt(n.$file.data("share-types"),10);return t===OC.Share.SHARE_TYPE_EMAIL||t===OC.Share.SHARE_TYPE_LINK?"icon-public":"icon-shared"},icon:function(e,n){var t=n.$file.data("share-owner-id");if(t)return OC.generateUrl("/avatar/".concat(t,"/32"))},type:OCA.Files.FileActions.TYPE_INLINE,actionHandler:function(n,t){var i=parseInt(t.$file.data("share-permissions"),10);(isNaN(i)||i>0)&&e.showDetailsView(n,"shareTabView")},render:function(e,t,i){return 0!=(parseInt(i.$file.data("permissions"),10)&OC.PERMISSION_SHARE)||i.$file.attr("data-share-owner")?n._defaultRenderAction.call(n,e,t,i):null}});var o=new OCA.Sharing.ShareTabView("shareTabView",{order:-20});o.on("sharesChanged",function(n){var t=n.fileInfoModel,i=e.findFileEl(t.get("name")),r=n.hasLinkShares();n.get("shares").forEach(function(e){e.share_type===OC.Share.SHARE_TYPE_EMAIL&&(r=!0)}),OCA.Sharing.Util._updateFileListDataAttributes(e,i,n),OCA.Sharing.Util._updateFileActionIcon(i,n.hasUserShares(),r)||OC.Share.markFileAsShared(i,!1,!1),t.set({shareTypes:n.getShareTypes(),icon:i.attr("data-icon")})}),e.registerTabView(o);var s=new OCA.Sharing.ShareBreadCrumbView({shareTab:o});e.registerBreadCrumbDetailView(s)}},_updateFileListDataAttributes:function(e,n,t){if("files"!==e.id)if(_.pluck(t.get("shares"),"share_with_displayname").length){var i=_.mapObject(t.get("shares"),function(e){return{shareWith:e.share_with,shareWithDisplayName:e.share_with_displayname}});n.attr("data-share-recipient-data",JSON.stringify(i))}else n.removeAttr("data-share-recipient-data")},_updateFileActionIcon:function(e,n,t){return!!(n||t||e.attr("data-share-recipient-data")||e.attr("data-share-owner"))&&(OC.Share.markFileAsShared(e,!0,t),!0)},getSharePermissions:function(e){return e.sharePermissions}},OC.Plugins.register("OCA.Files.FileList",OCA.Sharing.Util)},function(e,n,i){var r;r=OCA.Files.DetailTabView.extend({id:"shareTabView",className:"tab shareTabView",initialize:function(e,n){OCA.Files.DetailTabView.prototype.initialize.call(this,e,n),OC.Plugins.attach("OCA.Sharing.ShareTabView",this)},template:function(e){return'
'},getLabel:function(){return t("files_sharing","Sharing")},getIcon:function(){return"icon-shared"},render:function(){var e=this,n=this;if(this._dialog&&(this._dialog.model.off(),this._dialog.remove(),this._dialog=null),this.model){this.$el.html(this.template()),_.isUndefined(this.model.get("sharePermissions"))&&this.model.set("sharePermissions",OCA.Sharing.Util.getSharePermissions(this.model.attributes));var t={itemType:this.model.isDirectory()?"folder":"file",itemSource:this.model.get("id"),possiblePermissions:this.model.get("sharePermissions")},r=new OC.Share.ShareConfigModel,a=new OC.Share.ShareItemModel(t,{configModel:r,fileInfoModel:this.model});this._dialog=new OC.Share.ShareDialogView({configModel:r,model:a}),this.$el.find(".dialogContainer").append(this._dialog.$el),this._dialog.render(),this._dialog.model.fetch(),this._dialog.model.on("change",function(){n.trigger("sharesChanged",a)}),Promise.all([i.e(3),i.e(4)]).then(i.bind(null,14)).then(function(n){var t=new n.Vue({el:"#collaborationResources",render:function(e){return e(n.View)},data:{model:e.model.toJSON()}});e.model.on("change",function(){t.data=e.model.toJSON()})})}else this.$el.empty();this.trigger("rendered")}}),OCA.Sharing.ShareTabView=r},function(e,n){ /** * @copyright 2016 Christoph Wurst * @@ -624,652 +20,5 @@ OC.Plugins.register('OCA.Files.FileList', OCA.Sharing.Util); * along with this program. If not, see . * */ -(function () { - 'use strict'; - - var BreadCrumbView = OC.Backbone.View.extend({ - tagName: 'span', - events: { - click: '_onClick' - }, - _dirInfo: undefined, - - /** @type OCA.Sharing.ShareTabView */ - _shareTab: undefined, - initialize: function initialize(options) { - this._shareTab = options.shareTab; - }, - render: function render(data) { - this._dirInfo = data.dirInfo || null; - - if (this._dirInfo !== null && (this._dirInfo.path !== '/' || this._dirInfo.name !== '')) { - var isShared = data.dirInfo && data.dirInfo.shareTypes && data.dirInfo.shareTypes.length > 0; - this.$el.removeClass('shared icon-public icon-shared'); - - if (isShared) { - this.$el.addClass('shared'); - - if (data.dirInfo.shareTypes.indexOf(OC.Share.SHARE_TYPE_LINK) !== -1) { - this.$el.addClass('icon-public'); - } else { - this.$el.addClass('icon-shared'); - } - } else { - this.$el.addClass('icon-shared'); - } - - this.$el.show(); - this.delegateEvents(); - } else { - this.$el.removeClass('shared icon-public icon-shared'); - this.$el.hide(); - } - - return this; - }, - _onClick: function _onClick(e) { - e.preventDefault(); - var fileInfoModel = new OCA.Files.FileInfoModel(this._dirInfo); - var self = this; - fileInfoModel.on('change', function () { - self.render({ - dirInfo: self._dirInfo - }); - }); - - this._shareTab.on('sharesChanged', function (shareModel) { - var shareTypes = []; - var shares = shareModel.getSharesWithCurrentItem(); - - for (var i = 0; i < shares.length; i++) { - if (shareTypes.indexOf(shares[i].share_type) === -1) { - shareTypes.push(shares[i].share_type); - } - } - - if (shareModel.hasLinkShares()) { - shareTypes.push(OC.Share.SHARE_TYPE_LINK); - } // Since the dirInfo isn't updated we need to do this dark hackery - - - self._dirInfo.shareTypes = shareTypes; - self.render({ - dirInfo: self._dirInfo - }); - }); - - OCA.Files.App.fileList.showDetailsView(fileInfoModel, 'shareTabView'); - } - }); - OCA.Sharing.ShareBreadCrumbView = BreadCrumbView; -})(); - -/***/ }), - -/***/ "./apps/files_sharing/src/sharetabview.js": -/*!************************************************!*\ - !*** ./apps/files_sharing/src/sharetabview.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * Copyright (c) 2015 - * - * This file is licensed under the Affero General Public License version 3 - * or later. - * - * See the COPYING-README file. - * - */ - -/* @global Handlebars */ -(function () { - var TEMPLATE = '
' + '
' + '
' + '
'; - /** - * @memberof OCA.Sharing - */ - - var ShareTabView = OCA.Files.DetailTabView.extend( - /** @lends OCA.Sharing.ShareTabView.prototype */ - { - id: 'shareTabView', - className: 'tab shareTabView', - initialize: function initialize(name, options) { - OCA.Files.DetailTabView.prototype.initialize.call(this, name, options); - OC.Plugins.attach('OCA.Sharing.ShareTabView', this); - }, - template: function template(params) { - return TEMPLATE; - }, - getLabel: function getLabel() { - return t('files_sharing', 'Sharing'); - }, - getIcon: function getIcon() { - return 'icon-shared'; - }, - - /** - * Renders this details view - */ - render: function render() { - var _this = this; - - var self = this; - - if (this._dialog) { - // remove/destroy older instance - this._dialog.model.off(); - - this._dialog.remove(); - - this._dialog = null; - } - - if (this.model) { - this.$el.html(this.template()); - - if (_.isUndefined(this.model.get('sharePermissions'))) { - this.model.set('sharePermissions', OCA.Sharing.Util.getSharePermissions(this.model.attributes)); - } // TODO: the model should read these directly off the passed fileInfoModel - - - var attributes = { - itemType: this.model.isDirectory() ? 'folder' : 'file', - itemSource: this.model.get('id'), - possiblePermissions: this.model.get('sharePermissions') - }; - var configModel = new OC.Share.ShareConfigModel(); - var shareModel = new OC.Share.ShareItemModel(attributes, { - configModel: configModel, - fileInfoModel: this.model - }); - this._dialog = new OC.Share.ShareDialogView({ - configModel: configModel, - model: shareModel - }); - this.$el.find('.dialogContainer').append(this._dialog.$el); - - this._dialog.render(); - - this._dialog.model.fetch(); - - this._dialog.model.on('change', function () { - self.trigger('sharesChanged', shareModel); - }); - - Promise.all(/*! import() */[__webpack_require__.e(0), __webpack_require__.e(1)]).then(__webpack_require__.bind(null, /*! ./collaborationresources */ "./apps/files_sharing/src/collaborationresources.js")).then(function (Resources) { - var vm = new Resources.Vue({ - el: '#collaborationResources', - render: function render(h) { - return h(Resources.View); - }, - data: { - model: _this.model.toJSON() - } - }); - - _this.model.on('change', function () { - vm.data = _this.model.toJSON(); - }); - }); - } else { - this.$el.empty(); // TODO: render placeholder text? - } - - this.trigger('rendered'); - } - }); - OCA.Sharing.ShareTabView = ShareTabView; -})(); - -/***/ }), - -/***/ "./apps/files_sharing/src/style/sharebreadcrumb.scss": -/*!***********************************************************!*\ - !*** ./apps/files_sharing/src/style/sharebreadcrumb.scss ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// style-loader: Adds some css to the DOM by adding a