123 |
- /*! For license information please see files_versions-files_versions.js.LICENSE.txt */
- !function(){var n,e={62187:function(n,e,r){"use strict";var s=r(20144),o=r(9944),i=r(37368),a=r(2470),u=r(45400),l=r.n(u),c=r(76212),f=r.n(c),d=r(12143),v=r.n(d),m=r(93455),p=r.n(m),j=r(26932),h=r(22200),g=r(81063),b=r(79753),y=r(4820);(0,g.getPatcher)().patch("request",y.default);var A=(0,b.generateRemoteUrl)("dav"),_=(0,g.createClient)(A),w='<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:"\n\txmlns:oc="http://owncloud.org/ns"\n\txmlns:nc="http://nextcloud.org/ns"\n\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t<d:prop>\n\t\t<d:getcontentlength />\n\t\t<d:getcontenttype />\n\t\t<d:getlastmodified />\n\t</d:prop>\n</d:propfind>',k=(0,r(17499).IY)().setApp("files_version").detectUser().build(),x=r(65358),C=r(80351),z=r.n(C);function R(n,e,t,r,s,o,i){try{var a=n[o](i),u=a.value}catch(n){return void t(n)}a.done?e(u):Promise.resolve(u).then(r,s)}function O(n){return function(){var e=this,t=arguments;return new Promise((function(r,s){var o=n.apply(e,t);function i(n){R(o,r,s,i,a,"next",n)}function a(n){R(o,r,s,i,a,"throw",n)}i(void 0)}))}}function S(n){return P.apply(this,arguments)}function P(){return(P=O(regeneratorRuntime.mark((function n(e){var t,r,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r="/versions/".concat(null===(t=(0,h.getCurrentUser)())||void 0===t?void 0:t.uid,"/versions/").concat(e.id),n.prev=1,n.next=4,_.getDirectoryContents(r,{data:w});case 4:return s=n.sent,n.abrupt("return",s.map((function(n){return E(n,e)})));case 8:throw n.prev=8,n.t0=n.catch(1),k.error("Could not fetch version",{exception:n.t0}),n.t0;case 12:case"end":return n.stop()}}),n,null,[[1,8]])})))).apply(this,arguments)}function I(n,e){return N.apply(this,arguments)}function N(){return(N=O(regeneratorRuntime.mark((function n(e,t){var r,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,k.debug("Restoring version",{url:e.url}),n.next=4,_.moveFile("/versions/".concat(null===(r=(0,h.getCurrentUser)())||void 0===r?void 0:r.uid,"/versions/").concat(t.id,"/").concat(e.fileVersion),"/versions/".concat(null===(s=(0,h.getCurrentUser)())||void 0===s?void 0:s.uid,"/restore/target"));case 4:n.next=10;break;case 6:throw n.prev=6,n.t0=n.catch(0),k.error("Could not restore version",{exception:n.t0}),n.t0;case 10:case"end":return n.stop()}}),n,null,[[0,6]])})))).apply(this,arguments)}function E(n,e){var t=""===n.mime,r=t?null:(0,x.EZ)(n.filename),s=null,i=null;return t?(s=(0,x.RQ)("/remote.php/webdav",e.path,e.name),i=(0,b.generateUrl)("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0",{fileId:e.id,fileEtag:e.etag})):(s=(0,x.RQ)("/remote.php/dav",n.filename),i=(0,b.generateUrl)("/apps/files_versions/preview?file={file}&version={fileVersion}",{file:(0,x.RQ)(e.path,e.name),fileVersion:r})),{title:t?(0,o.translate)("files_versions","Current version"):"",fileName:n.filename,mimeType:n.mime,size:t?e.size:n.size,type:n.type,mtime:z()(t?e.mtime:n.lastmod).unix(),preview:i,url:s,fileVersion:r,isCurrent:t}}function V(n,e,t,r,s,o,i){try{var a=n[o](i),u=a.value}catch(n){return void t(n)}a.done?e(u):Promise.resolve(u).then(r,s)}function Z(n){return function(){var e=this,t=arguments;return new Promise((function(r,s){var o=n.apply(e,t);function i(n){V(o,r,s,i,a,"next",n)}function a(n){V(o,r,s,i,a,"throw",n)}i(void 0)}))}}var B={name:"VersionTab",components:{NcEmptyContent:p(),NcActionLink:f(),NcActionButton:l(),NcListItem:v(),BackupRestore:i.Z,Download:a.Z},filters:{humanReadableSize:function(n){return OC.Util.humanFileSize(n)},humanDateFromNow:function(n){return z()(1e3*n).fromNow()}},data:function(){return{fileInfo:null,versions:[],loading:!1}},methods:{update:function(n){var e=this;return Z(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.fileInfo=n,e.resetState(),e.fetchVersions();case 3:case"end":return t.stop()}}),t)})))()},fetchVersions:function(){var n=this;return Z(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loading=!0,e.next=4,S(n.fileInfo);case 4:n.versions=e.sent;case 5:return e.prev=5,n.loading=!1,e.finish(5);case 8:case"end":return e.stop()}}),e,null,[[0,,5,8]])})))()},restoreVersion:function(n){var e=this;return Z(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,I(n,e.fileInfo);case 3:return e.fileInfo.size=n.size,e.fileInfo.mtime=n.lastmod,(0,j.s$)(t("files_versions","Version restored")),r.next=8,e.fetchVersions();case 8:r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),(0,j.x2)(t("files_versions","Could not restore version"));case 13:case"end":return r.stop()}}),r,null,[[0,10]])})))()},resetState:function(){this.versions=[]}}},D=r(93379),T=r.n(D),U=r(7795),F=r.n(U),L=r(90569),M=r.n(L),$=r(3565),q=r.n($),Q=r(19216),Y=r.n(Q),J=r(44589),W=r.n(J),G=r(82512),H={};H.styleTagTransform=W(),H.setAttributes=q(),H.insert=M().bind(null,"head"),H.domAPI=F(),H.insertStyleElement=Y(),T()(G.Z,H),G.Z&&G.Z.locals&&G.Z.locals;var K=(0,r(51900).Z)(B,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("ul",[n._l(n.versions,(function(e){return t("NcListItem",{key:e.mtime,staticClass:"version",attrs:{title:e.title,href:e.url},scopedSlots:n._u([{key:"icon",fn:function(){return[t("img",{staticClass:"version__image",attrs:{lazy:"true",src:e.preview,alt:"",height:"256",width:"256"}})]},proxy:!0},{key:"subtitle",fn:function(){return[t("div",{staticClass:"version__info"},[t("span",[n._v(n._s(n._f("humanDateFromNow")(e.mtime)))]),n._v(" "),t("span",{staticClass:"version__info__size"},[n._v("•")]),n._v(" "),t("span",{staticClass:"version__info__size"},[n._v(n._s(n._f("humanReadableSize")(e.size)))])])]},proxy:!0},e.isCurrent?null:{key:"actions",fn:function(){return[t("NcActionLink",{attrs:{href:e.url,download:e.url},scopedSlots:n._u([{key:"icon",fn:function(){return[t("Download",{attrs:{size:22}})]},proxy:!0}],null,!0)},[n._v("\n\t\t\t\t\t"+n._s(n.t("files_versions","Download version"))+"\n\t\t\t\t")]),n._v(" "),t("NcActionButton",{on:{click:function(t){return n.restoreVersion(e)}},scopedSlots:n._u([{key:"icon",fn:function(){return[t("BackupRestore",{attrs:{size:22}})]},proxy:!0}],null,!0)},[n._v("\n\t\t\t\t\t"+n._s(n.t("files_versions","Restore version"))+"\n\t\t\t\t")])]},proxy:!0}],null,!0)})})),n._v(" "),n.loading||1!==n.versions.length?n._e():t("NcEmptyContent",{attrs:{title:n.t("files_version","No versions yet")},scopedSlots:n._u([{key:"icon",fn:function(){return[t("BackupRestore")]},proxy:!0}],null,!1,3003672357)})],2)])}),[],!1,null,null,null).exports,X=r(34741),nn=r(27608);function en(n,e,t,r,s,o,i){try{var a=n[o](i),u=a.value}catch(n){return void t(n)}a.done?e(u):Promise.resolve(u).then(r,s)}s.ZP.prototype.t=o.translate,s.ZP.prototype.n=o.translatePlural,s.ZP.use(X.default);var tn=s.ZP.extend(K),rn=null;window.addEventListener("DOMContentLoaded",(function(){var n;void 0!==(null===(n=OCA.Files)||void 0===n?void 0:n.Sidebar)&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"version_vue",name:(0,o.translate)("files_versions","Version"),iconSvg:nn,mount:function(n,e,t){return(r=regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return rn&&rn.$destroy(),rn=new tn({parent:t}),r.next=4,rn.update(e);case 4:rn.$mount(n);case 5:case"end":return r.stop()}}),r)})),function(){var n=this,e=arguments;return new Promise((function(t,s){var o=r.apply(n,e);function i(n){en(o,t,s,i,a,"next",n)}function a(n){en(o,t,s,i,a,"throw",n)}i(void 0)}))})();var r},update:function(n){rn.update(n)},destroy:function(){rn.$destroy(),rn=null},enabled:function(n){var e;return!(null===(e=null==n?void 0:n.isDirectory())||void 0===e||e)}}))}))},82512:function(n,e,t){"use strict";var r=t(87537),s=t.n(r),o=t(23645),i=t.n(o)()(s());i.push([n.id,".version{display:flex;flex-direction:row}.version__info{display:flex;flex-direction:row;align-items:center;gap:.5rem}.version__info__size{color:var(--color-text-lighter)}.version__image{width:3rem;height:3rem;border:1px solid var(--color-border);margin-right:1rem;border-radius:var(--border-radius-large)}","",{version:3,sources:["webpack://./apps/files_versions/src/views/VersionTab.vue"],names:[],mappings:"AA8JA,SACC,YAAA,CACA,kBAAA,CAEA,eACC,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,SAAA,CAEA,qBACC,+BAAA,CAIF,gBACC,UAAA,CACA,WAAA,CACA,oCAAA,CACA,iBAAA,CACA,wCAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.version {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&__info {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tgap: 0.5rem;\n\n\t\t&__size {\n\t\t\tcolor: var(--color-text-lighter);\n\t\t}\n\t}\n\n\t&__image {\n\t\twidth: 3rem;\n\t\theight: 3rem;\n\t\tborder: 1px solid var(--color-border);\n\t\tmargin-right: 1rem;\n\t\tborder-radius: var(--border-radius-large);\n\t}\n}\n"],sourceRoot:""}]),e.Z=i},46700:function(n,e,t){var r={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function s(n){var e=o(n);return t(e)}function o(n){if(!t.o(r,n)){var e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}return r[n]}s.keys=function(){return Object.keys(r)},s.resolve=o,n.exports=s,s.id=46700},69862:function(){},40964:function(){}},r={};function s(n){var t=r[n];if(void 0!==t)return t.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,s),o.loaded=!0,o.exports}s.m=e,s.amdD=function(){throw new Error("define cannot be used indirect")},s.amdO={},n=[],s.O=function(e,t,r,o){if(!t){var i=1/0;for(c=0;c<n.length;c++){t=n[c][0],r=n[c][1],o=n[c][2];for(var a=!0,u=0;u<t.length;u++)(!1&o||i>=o)&&Object.keys(s.O).every((function(n){return s.O[n](t[u])}))?t.splice(u--,1):(a=!1,o<i&&(i=o));if(a){n.splice(c--,1);var l=r();void 0!==l&&(e=l)}}return e}o=o||0;for(var c=n.length;c>0&&n[c-1][2]>o;c--)n[c]=n[c-1];n[c]=[t,r,o]},s.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return s.d(e,{a:e}),e},s.d=function(n,e){for(var t in e)s.o(e,t)&&!s.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),s.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},s.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},s.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},s.j=1358,function(){s.b=document.baseURI||self.location.href;var n={1358:0};s.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,o,i=t[0],a=t[1],u=t[2],l=0;if(i.some((function(e){return 0!==n[e]}))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(u)var c=u(s)}for(e&&e(t);l<i.length;l++)o=i[l],s.o(n,o)&&n[o]&&n[o][0](),n[o]=0;return s.O(c)},t=self.webpackChunknextcloud=self.webpackChunknextcloud||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}(),s.nc=void 0;var o=s.O(void 0,[7874],(function(){return s(62187)}));o=s.O(o)}();
- //# sourceMappingURL=files_versions-files_versions.js.map?v=4945387b5173ddcdf103
|