aboutsummaryrefslogtreecommitdiffstats
path: root/dist/federatedfilesharing-external.js.map
blob: 41afe34fee26fffcb3101fe4d5e8ae0bde05f823 (plain)
1
{"version":3,"file":"federatedfilesharing-external.js?v=5aa0b13c1846da983827","mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AClDA;;;;;AEAA;AACA;AACA;AACA;AACA","sources":["webpack:///nextcloud/apps/federatedfilesharing/src/external.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/before-startup","webpack:///nextcloud/webpack/startup","webpack:///nextcloud/webpack/after-startup"],"sourcesContent":["/**\n * Copyright (c) 2014 Robin Appelman <icewind@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 */\nimport { loadState } from '@nextcloud/initial-state';\nimport { generateUrl } from '@nextcloud/router';\nwindow.OCA.Sharing = window.OCA.Sharing || {};\n\n/**\n * Shows \"add external share\" dialog.\n *\n * @param {object} share the share\n * @param {string} share.remote remote server URL\n * @param {string} share.owner owner name\n * @param {string} share.name name of the shared folder\n * @param {string} share.token authentication token\n * @param {boolean} passwordProtected true if the share is password protected\n * @param {Function} callback the callback\n */\nwindow.OCA.Sharing.showAddExternalDialog = function (share, passwordProtected, callback) {\n  const remote = share.remote;\n  const owner = share.ownerDisplayName || share.owner;\n  const name = share.name;\n\n  // Clean up the remote URL for display\n  const remoteClean = remote.replace(/^https?:\\/\\//, '') // remove http:// or https://\n  .replace(/\\/$/, ''); // remove trailing slash\n\n  if (!passwordProtected) {\n    window.OC.dialogs.confirm(t('files_sharing', 'Do you want to add the remote share {name} from {owner}@{remote}?', {\n      name,\n      owner,\n      remote: remoteClean\n    }), t('files_sharing', 'Remote share'), function (result) {\n      callback(result, share);\n    }, true).then(this._adjustDialog);\n  } else {\n    window.OC.dialogs.prompt(t('files_sharing', 'Do you want to add the remote share {name} from {owner}@{remote}?', {\n      name,\n      owner,\n      remote: remoteClean\n    }), t('files_sharing', 'Remote share'), function (result, password) {\n      share.password = password;\n      callback(result, share);\n    }, true, t('files_sharing', 'Remote share password'), true).then(this._adjustDialog);\n  }\n};\nwindow.OCA.Sharing._adjustDialog = function () {\n  const $dialog = $('.oc-dialog:visible');\n  const $buttons = $dialog.find('button');\n  // hack the buttons\n  $dialog.find('.ui-icon').remove();\n  $buttons.eq(1).text(t('core', 'Cancel'));\n  $buttons.eq(2).text(t('files_sharing', 'Add remote share'));\n};\nconst reloadFilesList = function () {\n  var _window;\n  if (!((_window = window) !== null && _window !== void 0 && (_window = _window.OCP) !== null && _window !== void 0 && (_window = _window.Files) !== null && _window !== void 0 && (_window = _window.Router) !== null && _window !== void 0 && _window.goToRoute)) {\n    // No router, just reload the page\n    window.location.reload();\n    return;\n  }\n\n  // Let's redirect to the root as any accepted share would be there\n  window.OCP.Files.Router.goToRoute(null, {\n    ...this.$route.params,\n    fileid: undefined\n  }, {\n    ...this.$route.query,\n    openfile: undefined\n  });\n};\n\n/**\n * Process incoming remote share that might have been passed\n * through the URL\n */\nconst processIncomingShareFromUrl = function () {\n  const params = window.OC.Util.History.parseUrlQuery();\n\n  // manually add server-to-server share\n  if (params.remote && params.token && params.name) {\n    const callbackAddShare = function (result, share) {\n      const password = share.password || '';\n      if (result) {\n        $.post(generateUrl('apps/federatedfilesharing/askForFederatedShare'), {\n          remote: share.remote,\n          token: share.token,\n          owner: share.owner,\n          ownerDisplayName: share.ownerDisplayName || share.owner,\n          name: share.name,\n          password\n        }).done(function (data) {\n          if (data.hasOwnProperty('legacyMount')) {\n            reloadFilesList();\n          } else {\n            window.OC.Notification.showTemporary(data.message);\n          }\n        }).fail(function (data) {\n          window.OC.Notification.showTemporary(JSON.parse(data.responseText).message);\n        });\n      }\n    };\n\n    // clear hash, it is unlikely that it contain any extra parameters\n    location.hash = '';\n    params.passwordProtected = parseInt(params.protected, 10) === 1;\n    window.OCA.Sharing.showAddExternalDialog(params, params.passwordProtected, callbackAddShare);\n  }\n};\n\n/**\n * Retrieve a list of remote shares that need to be approved\n */\nconst processSharesToConfirm = function () {\n  // check for new server-to-server shares which need to be approved\n  $.get(generateUrl('/apps/files_sharing/api/externalShares'), {}, function (shares) {\n    let index;\n    for (index = 0; index < shares.length; ++index) {\n      window.OCA.Sharing.showAddExternalDialog(shares[index], false, function (result, share) {\n        if (result) {\n          // Accept\n          $.post(generateUrl('/apps/files_sharing/api/externalShares'), {\n            id: share.id\n          }).then(function () {\n            reloadFilesList();\n          });\n        } else {\n          // Delete\n          $.ajax({\n            url: generateUrl('/apps/files_sharing/api/externalShares/' + share.id),\n            type: 'DELETE'\n          });\n        }\n      });\n    }\n  });\n};\nprocessIncomingShareFromUrl();\nif (loadState('federatedfilesharing', 'notificationsEnabled', true) !== true) {\n  // No notification app, display the modal\n  processSharesToConfirm();\n}\n$('body').on('window.OCA.Notification.Action', function (e) {\n  if (e.notification.app === 'files_sharing' && e.notification.object_type === 'remote_share' && e.action.type === 'POST') {\n    // User accepted a remote share reload\n    reloadFilesList();\n  }\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"federatedfilesharing-external\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"core-common\"], () => (__webpack_require__(\"./apps/federatedfilesharing/src/external.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":[],"sourceRoot":""}