nextcloud/apps/files_versions/js/files_versions.js

2 lines
18 KiB
JavaScript
Raw Normal View History

!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/js/",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);n(1),n(2),n(3),n(4),n(5),n(6);window.OCA.Versions=OCA.Versions},function(e,t){var n;n=OC.Backbone.Model.extend({sync:OC.Backbone.davSync,davProperties:{size:"{DAV:}getcontentlength",mimetype:"{DAV:}getcontenttype",timestamp:"{DAV:}getlastmodified"},revert:function(e){e=e?_.clone(e):{};var t=this;return this.get("client").move("/versions/"+this.get("fileId")+"/"+this.get("id"),"/restore/target",!0).done(function(){e.success&&e.success.call(e.context,t,{},e),t.trigger("revert",t,e)}).fail(function(){e.error&&e.error.call(e.context,t,{},e),t.trigger("error",t,{},e)})},getFullPath:function(){return this.get("fullPath")},getPreviewUrl:function(){var e=OC.generateUrl("/apps/files_versions/preview"),t={file:this.get("fullPath"),version:this.get("timestamp")};return e+"?"+OC.buildQueryString(t)},getDownloadUrl:function(){return OC.linkToRemoteBase("dav")+"/versions/"+this.get("user")+"/versions/"+this.get("fileId")+"/"+this.get("id")}}),OCA.Versions=OCA.Versions||{},OCA.Versions.VersionModel=n},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,r;i=Handlebars.template,(r=OCA.Versions.Templates=OCA.Versions.Templates||{}).item=i({1:function(e,t,i,r,o){var s,l=null!=t?t:e.nullContext||{},a=i.helperMissing,c=e.escapeExpression;return'\t\t\t\t<div class="version-details">\n\t\t\t\t\t<span class="size has-tooltip" title="'+c("function"===n(s=null!=(s=i.altSize||(null!=t?t.altSize:t))?s:a)?s.call(l,{name:"altSize",hash:{},data:o}):s)+'">'+c("function"===n(s=null!=(s=i.humanReadableSize||(null!=t?t.humanReadableSize:t))?s:a)?s.call(l,{name:"humanReadableSize",hash:{},data:o}):s)+"</span>\n\t\t\t\t</div>\n"},3:function(e,t,i,r,o){var s,l=null!=t?t:e.nullContext||{},a=i.helperMissing,c=e.escapeExpression;return'\t\t\t<a href="#" class="revertVersion" title="'+c("function"===n(s=null!=(s=i.revertLabel||(null!=t?t.revertLabel:t))?s:a)?s.call(l,{name:"revertLabel",hash:{},data:o}):s)+'"><img src="'+c("function"===n(s=null!=(s=i.revertIconUrl||(null!=t?t.revertIconUrl:t))?s:a)?s.call(l,{name:"revertIconUrl",hash:{},data:o}):s)+'" /></a>\n'},compiler:[7,">= 4.0.0"],main:function(e,t,i,r,o){var s,l,a,c=null!=t?t:e.nullContext||{},u=i.helperMissing,f="function",d=e.escapeExpression,p=i.blockHelperMissing,h='<li data-revision="'+d(n(l=null!=(l=i.timestamp||(null!=t?t.timestamp:t))?l:u)===f?l.call(c,{name:"timestamp",hash:{},data:o}):l)+'">\n\t<div>\n\t\t<div class="preview-container">\n\t\t\t<img class="preview" src="'+d(n(l=null!=(l=i.previewUrl||(null!=t?t.previewUrl:t))?l:u)===f?l.call(c,{name:"previewUrl",hash:{},data:o}):l)+'" width="44" height="44"/>\n\t\t</div>\n\t\t<div class="version-container">\n\t\t\t<div>\n\t\t\t\t<a href="'+d(n(l=null!=(l=i.downloadUrl||(null!=t?t.downloadUrl:t))?l:u)===f?l.call(c,{name:"downloadUrl",hash:{},data:o}):l)+'" class="downloadVersion" download="'+d(n(l=null!=(l=i.downloadName||(null!=t?t.downloadName:t))?l:u)===f?l.call(c,{name:"downloadName",hash:{},data:o}):l)+'"><img src="
//# sourceMappingURL=files_versions.js.map