federatedfilesharing-external.js 4.2 KB

12
  1. (()=>{"use strict";var e,o={54878:(e,o,n)=>{var r=n(32981),i=n(63814);window.OCA.Sharing=window.OCA.Sharing||{},window.OCA.Sharing.showAddExternalDialog=function(e,o,n){const r=e.remote,i=e.ownerDisplayName||e.owner,a=e.name,s=r.replace(/^https?:\/\//,"").replace(/\/$/,"");o?window.OC.dialogs.prompt(t("files_sharing","Do you want to add the remote share {name} from {owner}@{remote}?",{name:a,owner:i,remote:s}),t("files_sharing","Remote share"),(function(o,t){e.password=t,n(o,e)}),!0,t("files_sharing","Remote share password"),!0).then(this._adjustDialog):window.OC.dialogs.confirm(t("files_sharing","Do you want to add the remote share {name} from {owner}@{remote}?",{name:a,owner:i,remote:s}),t("files_sharing","Remote share"),(function(o){n(o,e)}),!0).then(this._adjustDialog)},window.OCA.Sharing._adjustDialog=function(){const e=$(".oc-dialog:visible"),o=e.find("button");e.find(".ui-icon").remove(),o.eq(1).text(t("core","Cancel")),o.eq(2).text(t("files_sharing","Add remote share"))};const a=function(){var e;null!==(e=window)&&void 0!==e&&null!==(e=e.OCP)&&void 0!==e&&null!==(e=e.Files)&&void 0!==e&&null!==(e=e.Router)&&void 0!==e&&e.goToRoute?window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:void 0},{...window.OCP.Files.Router.query,dir:"/",openfile:void 0}):window.location.reload()};!function(){const e=window.OC.Util.History.parseUrlQuery();if(e.remote&&e.token&&e.name){const o=function(e,o){const n=o.password||"";e&&$.post((0,i.Jv)("apps/federatedfilesharing/askForFederatedShare"),{remote:o.remote,token:o.token,owner:o.owner,ownerDisplayName:o.ownerDisplayName||o.owner,name:o.name,password:n}).done((function(e){e.hasOwnProperty("legacyMount")?a():window.OC.Notification.showTemporary(e.message)})).fail((function(e){window.OC.Notification.showTemporary(JSON.parse(e.responseText).message)}))};location.hash="",e.passwordProtected=1===parseInt(e.protected,10),window.OCA.Sharing.showAddExternalDialog(e,e.passwordProtected,o)}}(),!0!==(0,r.C)("federatedfilesharing","notificationsEnabled",!0)&&$.get((0,i.Jv)("/apps/files_sharing/api/externalShares"),{},(function(e){let o;for(o=0;o<e.length;++o)window.OCA.Sharing.showAddExternalDialog(e[o],!1,(function(e,o){e?$.post((0,i.Jv)("/apps/files_sharing/api/externalShares"),{id:o.id}).then((function(){a()})):$.ajax({url:(0,i.Jv)("/apps/files_sharing/api/externalShares/"+o.id),type:"DELETE"})}))})),$("body").on("window.OCA.Notification.Action",(function(e){"files_sharing"===e.notification.app&&"remote_share"===e.notification.object_type&&"POST"===e.action.type&&a()}))}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return o[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=o,e=[],r.O=(o,n,t,i)=>{if(!n){var a=1/0;for(f=0;f<e.length;f++){n=e[f][0],t=e[f][1],i=e[f][2];for(var s=!0,l=0;l<n.length;l++)(!1&i||a>=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,i<a&&(a=i));if(s){e.splice(f--,1);var d=t();void 0!==d&&(o=d)}}return o}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[n,t,i]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var n in o)r.o(o,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},r.e=()=>Promise.resolve(),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=2299,(()=>{r.b=document.baseURI||self.location.href;var e={2299:0};r.O.j=o=>0===e[o];var o=(o,n)=>{var t,i,a=n[0],s=n[1],l=n[2],d=0;if(a.some((o=>0!==e[o]))){for(t in s)r.o(s,t)&&(r.m[t]=s[t]);if(l)var f=l(r)}for(o&&o(n);d<a.length;d++)i=a[d],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(f)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(o.bind(null,0)),n.push=o.bind(null,n.push.bind(n))})(),r.nc=void 0;var i=r.O(void 0,[4208],(()=>r(54878)));i=r.O(i)})();
  2. //# sourceMappingURL=federatedfilesharing-external.js.map?v=c189f97cbeb77a056e14