2021-03-31 13:34:13 +03:00
! function ( e ) { var t = { } ; function n ( r ) { if ( t [ r ] ) return t [ r ] . exports ; var o = t [ r ] = { i : r , l : ! 1 , exports : { } } ; return e [ r ] . call ( o . exports , o , o . exports , n ) , o . l = ! 0 , o . exports } n . m = e , n . c = t , n . d = function ( e , t , r ) { n . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : r } ) } , 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 r = Object . create ( null ) ; if ( n . r ( r ) , Object . defineProperty ( r , "default" , { enumerable : ! 0 , value : e } ) , 2 & t && "string" != typeof e ) for ( var o in e ) n . d ( r , o , function ( t ) { return e [ t ] } . bind ( null , o ) ) ; return r } , 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 = 32 ) } ( [ function ( e , t , n ) { "use strict" ; t . _ _esModule = ! 0 , t . extend = l , t . indexOf = function ( e , t ) { for ( var n = 0 , r = e . length ; n < r ; n ++ ) if ( e [ n ] === t ) return n ; return - 1 } , t . escapeExpression = function ( e ) { if ( "string" != typeof e ) { if ( e && e . toHTML ) return e . toHTML ( ) ; if ( null == e ) return "" ; if ( ! e ) return e + "" ; e = "" + e } if ( ! i . test ( e ) ) return e ; return e . replace ( o , a ) } , t . isEmpty = function ( e ) { return ! e && 0 !== e || ! ( ! u ( e ) || 0 !== e . length ) } , t . createFrame = function ( e ) { var t = l ( { } , e ) ; return t . _parent = e , t } , t . blockParams = function ( e , t ) { return e . path = t , e } , t . appendContextPath = function ( e , t ) { return ( e ? e + "." : "" ) + t } ; var r = { "&" : "&" , "<" : "<" , ">" : ">" , '"' : """ , "'" : "'" , "`" : "`" , "=" : "=" } , o = /[&<>"'`=]/g , i = /[&<>"'`=]/ ; function a ( e ) { return r [ e ] } function l ( e ) { for ( var t = 1 ; t < arguments . length ; t ++ ) for ( var n in arguments [ t ] ) Object . prototype . hasOwnProperty . call ( arguments [ t ] , n ) && ( e [ n ] = arguments [ t ] [ n ] ) ; return e } var s = Object . prototype . toString ; t . toString = s ; var c = function ( e ) { return "function" == typeof e } ; c ( /x/ ) && ( t . isFunction = c = function ( e ) { return "function" == typeof e && "[object Function]" === s . call ( e ) } ) , t . isFunction = c ; var u = Array . isArray || function ( e ) { return ! ( ! e || "object" != typeof e ) && "[object Array]" === s . call ( e ) } ; t . isArray = u } , function ( e , t , n ) { "use strict" ; t . _ _esModule = ! 0 ; var r = [ "description" , "fileName" , "lineNumber" , "endLineNumber" , "message" , "name" , "number" , "stack" ] ; function o ( e , t ) { var n = t && t . loc , i = void 0 , a = void 0 , l = void 0 , s = void 0 ; n && ( i = n . start . line , a = n . end . line , l = n . start . column , s = n . end . column , e += " - " + i + ":" + l ) ; for ( var c = Error . prototype . constructor . call ( this , e ) , u = 0 ; u < r . length ; u ++ ) this [ r [ u ] ] = c [ r [ u ] ] ; Error . captureStackTrace && Error . captureStackTrace ( this , o ) ; try { n && ( this . lineNumber = i , this . endLineNumber = a , Object . defineProperty ? ( Object . defineProperty ( this , "column" , { value : l , enumerable : ! 0 } ) , Object . defineProperty ( this , "endColumn" , { value : s , enumerable : ! 0 } ) ) : ( this . column = l , this . endColumn = s ) ) } catch ( e ) { } } o . prototype = new Error , t . default = o , e . exports = t . default } , function ( e , t , n ) { "use strict" ; var r = n ( 12 ) , o = n . n ( r ) , i = n ( 13 ) , a = n . n ( i ) ( ) ( o . a ) ; a . push ( [ e . i , ".versionsTabView .clear-float {\n\tclear: both;\n}\n\n.versionsTabView li {\n\twidth: 100%;\n\tcursor: default;\n\theight: 56px;\n\tfloat: left;\n\tborder-bottom: 1px solid rgba(100,100,100,.1);\n}\n.versionsTabView li:last-child {\n\tborder-bottom: none;\n}\n\n.versionsTabView a,\n.versionsTabView div > span {\n\tvertical-align: middle;\n\topacity: .5;\n}\n\n.versionsTabView li a{\n\tpadding: 15px 10px 11px;\n}\n\n.versionsTabView a:hover,\n.versionsTabView a:focus {\n\topacity: 1;\n}\n\n.versionsTabView .preview-container {\n\tdisplay: inline-block;\n vertical-align: top;\n}\n\n.versionsTabView img {\n\tcursor: pointer;\n\tpadding-right: 4px;\n}\n\n.versionsTabView img.preview {\n\tcursor: default;\n}\n\n.versionsTabView .version-container {\n\tdisplay: inline-block;\n}\n\n.versionsTabView .versiondate {\n\tmin-width: 100px;\n\tvertical-align: super;\n}\n\n.versionsTabView .version-details {\n\ttext-align: left;\n}\n\n.versionsTabView .version-details > span {\n\tpadding: 0 10px;\n}\n\n.versionsTabView .revertVersion {\n\tcursor: pointer;\n\tfloat: right;\n\tmargin-right: -10px;\n}\n" , "" , { version : 3 , sources : [ "webpack://./apps/files_versions/src/css/versions.css" ] , name
/ * *
* Copyright ( c ) 2015
*
* @ author John Molakvoæ < skjnldsv @ protonmail . com >
* @ author Robin Appelman < robin @ icewind . nl >
* @ author Vincent Petry < vincent @ nextcloud . com >
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
* /
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 ( "id" ) } ; 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 ) {
/ * *
* Copyright ( c ) 2015
*
* @ author John Molakvoæ < skjnldsv @ protonmail . com >
* @ author Robin Appelman < robin @ icewind . nl >
* @ author Vincent Petry < vincent @ nextcloud . com >
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
* /
var n ; n = OC . Backbone . Collection . extend ( { model : OCA . Versions . VersionModel , sync : OC . Backbone . davSync , _fileInfo : null , _currentUser : null , _client : null , setFileInfo : function ( e ) { this . _fileInfo = e } , getFileInfo : function ( ) { return this . _fileInfo } , setCurrentUser : function ( e ) { this . _currentUser = e } , getCurrentUser : function ( ) { return this . _currentUser || OC . getCurrentUser ( ) . uid } , setClient : function ( e ) { this . _client = e } , getClient : function ( ) { return this . _client || new OC . Files . Client ( { host : OC . getHost ( ) , root : OC . linkToRemoteBase ( "dav" ) + "/versions/" + this . getCurrentUser ( ) , useHTTPS : "https" === OC . getProtocol ( ) } ) } , url : function ( ) { return OC . linkToRemoteBase ( "dav" ) + "/versions/" + this . getCurrentUser ( ) + "/versions/" + this . _fileInfo . get ( "id" ) } , parse : function ( e ) { var t = this . _fileInfo . getFullPath ( ) , n = this . _fileInfo . get ( "id" ) , r = this . _fileInfo . get ( "name" ) , o = this . getCurrentUser ( ) , i = this . getClient ( ) ; return _ . map ( e , ( function ( e ) { return e . fullPath = t , e . fileId = n , e . name = r , e . timestamp = parseInt ( moment ( new Date ( e . timestamp ) ) . format ( "X" ) , 10 ) , e . id = OC . basename ( e . href ) , e . size = parseInt ( e . size , 10 ) , e . user = o , e . client = i , e } ) ) } } ) , OCA . Versions = OCA . Versions || { } , OCA . Versions . VersionCollection = n } , function ( e , t , n ) { "use strict" ; function r ( e ) { return e && e . _ _esModule ? e : { default : e } } function o ( e ) { if ( e && e . _ _esModule ) return e ; var t = { } ; if ( null != e ) for ( var n in e ) Object . prototype . hasOwnProperty . call ( e , n ) && ( t [ n ] = e [ n ] ) ; return t . default = e , t } t . _ _esModule = ! 0 ; var i = o ( n ( 4 ) ) , a = r ( n ( 27 ) ) , l = r ( n ( 1 ) ) , s = o ( n ( 0 ) ) , c = o ( n ( 28 ) ) , u = r ( n ( 30 ) ) ; function d ( ) { var e = new i . HandlebarsEnvironment ; return s . extend ( e , i ) , e . SafeString = a . default , e . Exception = l . default , e . Utils = s , e . escapeExpression = s . escapeExpression , e . VM = c , e . template = function ( t ) { return c . template ( t , e ) } , e } var f = d ( ) ; f . create = d , u . default ( f ) , f . default = f , t . default = f , e . exports = t . default } , function ( e , t , n ) { "use strict" ; t . _ _esModule = ! 0 ; var r = n ( 0 ) ; t . default = function ( e ) { e . registerHelper ( "blockHelperMissing" , ( function ( t , n ) { var o = n . inverse , i = n . fn ; if ( ! 0 === t ) return i ( this ) ; if ( ! 1 === t || null == t ) return o ( this ) ; if ( r . isArray ( t ) ) return t . length > 0 ? ( n . ids && ( n . ids = [ n . name ] ) , e . helpers . each ( t , n ) ) : o ( this ) ; if ( n . data && n . ids ) { var a = r . createFrame ( n . data ) ; a . contextPath = r . appendContextPath ( n . data . contextPath , n . name ) , n = { data : a } } return i ( t , n ) } ) ) } , e . exports = t . default } , function ( e , t , n ) { "use strict" ; ( function ( r ) { t . _ _esModule = ! 0 ; var o , i = n ( 0 ) , a = n ( 1 ) , l = ( o = a ) && o . _ _esModule ? o : { default : o } ; t . default = function ( e ) { e . registerHelper ( "each" , ( function ( e , t ) { if ( ! t ) throw new l . default ( "Must pass iterator to #each" ) ; var n , o = t . fn , a = t . inverse , s = 0 , c = "" , u = void 0 , d = void 0 ; function f ( t , n , r ) { u && ( u . key = t , u . index = n , u . first = 0 === n , u . last = ! ! r , d && ( u . contextPath = d + t ) ) , c += o ( e [ t ] , { data : u , blockParams : i . blockParams ( [ e [ t ] , t ] , [ d + t , null ] ) } ) } if ( t . data && t . ids && ( d = i . appendContextPath ( t . data . contextPath , t . ids [ 0 ] ) + "." ) , i . isFunction ( e ) && ( e = e . call ( this ) ) , t . data && ( u = i . createFrame ( t . data ) ) , e && "object" == typeof e ) if ( i . isArray ( e ) ) for ( var p = e . length ; s < p ; s ++ ) s in e && f ( s , s , s === e . length - 1 ) ; else if ( r . Symbol && e [ r . Symbol . iterator ] ) { for ( var h = [ ] , v = e [ r . Symbol . iterator ] ( ) , m = v . next ( ) ; ! m . done ; m = v . next ( ) ) h . push ( m . value ) ; for ( p = ( e = h ) . length ; s < p ; s ++ ) f ( s , s , s === e . length - 1 ) } else n = void 0 , Object . keys ( e ) . forEach ( ( function ( e ) { void 0 !== n && f ( n , s - 1 ) , n = e , s ++ } ) ) , void 0 !== n && f ( n , s - 1 , ! 0 ) ; return 0 === s && ( c = a ( this ) ) , c } ) ) } , e . exports = t . default } ) . call ( this , n ( 6 ) ) } , function ( e , t , n ) { "use strict" ; t . _ _esModule = ! 0 ; var r , o = n ( 1 ) , i = ( r = o ) && r . _ _esModule ? r : { default : r } ; t . default = function ( e ) { e . registerHelper ( "helperMissing" , ( function ( ) { if ( 1 !== arguments . length ) throw new i . default ( 'Missing helper: "' + arguments [ arguments . length - 1 ] . name + '"' ) } ) ) } , e . exports = t . default } , function ( e , t , n ) { "use strict" ; t . _ _esModule = ! 0 ; var r , o = n ( 0 ) , i = n ( 1 ) , a = ( r = i ) && r . _ _esModule ? r : { default : r } ; t . default = function ( e ) { e . registerHelper ( "if" , ( function ( e , t ) { if ( 2 != arguments . length ) throw new a . default ( "#if requires exactly one argument" ) ; return o . isFunction ( e ) && ( e = e . call ( this ) ) , ! t . hash . includeZero && ! e || o . isEmpty ( e ) ? t . inverse ( this ) : t . fn ( this ) } ) ) , e . registerHelper ( "unless" , ( function ( t , n ) { if ( 2 != arguments . length ) throw new a . default ( "#unless requires exactly one argument" ) ; return e . helpers . if . call ( this , t , { fn : n . inverse , inverse : n . fn , hash : n . hash } ) } ) ) } , e . exports = t . default } , f
/ * *
* Copyright ( c ) 2015
*
* @ author Jan - Christoph Borchardt < hey @ jancborchardt . net >
* @ author John Molakvoæ < skjnldsv @ protonmail . com >
* @ author Julius Härtl < jus @ bitgrid . net >
* @ author Michael Jobst < mjobst + github @ tecratech . de >
* @ author noveens < noveen . sachdeva @ research . iiit . ac . in >
* @ author Robin Appelman < robin @ icewind . nl >
* @ author Vincent Petry < vincent @ nextcloud . com >
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
* /
i = OCA . Files . DetailTabView . extend ( { id : "versionsTabView" , className : "tab versionsTabView" , _template : null , $versionsContainer : null , events : { "click .revertVersion" : "_onClickRevertVersion" } , initialize : function ( ) { OCA . Files . DetailTabView . prototype . initialize . apply ( this , arguments ) , this . collection = new OCA . Versions . VersionCollection , this . collection . on ( "request" , this . _onRequest , this ) , this . collection . on ( "sync" , this . _onEndRequest , this ) , this . collection . on ( "update" , this . _onUpdate , this ) , this . collection . on ( "error" , this . _onError , this ) , this . collection . on ( "add" , this . _onAddModel , this ) } , getLabel : function ( ) { return t ( "files_versions" , "Versions" ) } , getIcon : function ( ) { return "icon-history" } , nextPage : function ( ) { this . _loading || this . collection . getFileInfo ( ) && this . collection . getFileInfo ( ) . isDirectory ( ) || this . collection . fetch ( ) } , _onClickRevertVersion : function ( e ) { var n = this , r = $ ( e . target ) , o = this . collection . getFileInfo ( ) ; r . is ( "li" ) || ( r = r . closest ( "li" ) ) , e . preventDefault ( ) ; var i = r . attr ( "data-revision" ) , a = this . collection . get ( i ) ; a . revert ( { success : function ( ) { n . $versionsContainer . empty ( ) , n . collection . setFileInfo ( o ) , n . collection . reset ( [ ] , { silent : ! 0 } ) , n . collection . fetch ( ) , n . $el . find ( ".versions" ) . removeClass ( "hidden" ) , o . trigger ( "busy" , o , ! 1 ) , o . set ( { size : a . get ( "size" ) , mtime : 1e3 * a . get ( "timestamp" ) , etag : a . get ( "id" ) + a . get ( "timestamp" ) } ) } , error : function ( ) { o . trigger ( "busy" , o , ! 1 ) , n . $el . find ( ".versions" ) . removeClass ( "hidden" ) , n . _toggleLoading ( ! 1 ) , OC . Notification . show ( t ( "files_version" , "Failed to revert {file} to revision {timestamp}." , { file : a . getFullPath ( ) , timestamp : OC . Util . formatDate ( 1e3 * a . get ( "timestamp" ) ) } ) , { type : "error" } ) } } ) , this . _toggleLoading ( ! 0 ) , o . trigger ( "busy" , o , ! 0 ) } , _toggleLoading : function ( e ) { this . _loading = e , this . $el . find ( ".loading" ) . toggleClass ( "hidden" , ! e ) } , _onRequest : function ( ) { this . _toggleLoading ( ! 0 ) } , _onEndRequest : function ( ) { this . _toggleLoading ( ! 1 ) , this . $el . find ( ".empty" ) . toggleClass ( "hidden" , ! ! this . collection . length ) } , _onAddModel : function ( e ) { var t = $ ( this . itemTemplate ( this . _formatItem ( e ) ) ) ; this . $versionsContainer . append ( t ) , t . find ( ".has-tooltip" ) . tooltip ( ) } , template : function ( e ) { return c ( ) ( e ) } , itemTemplate : function ( e ) { return l ( ) ( e ) } , setFileInfo : function ( e ) { e ? ( this . render ( ) , this . collection . setFileInfo ( e ) , this . collection . reset ( [ ] , { silent : ! 0 } ) , this . nextPage ( ) ) : ( this . render ( ) , this . collection . reset ( ) ) } , _formatItem : function ( e ) { var r = 1e3 * e . get ( "timestamp" ) , o = e . has ( "size" ) ? e . get ( "size" ) : 0 , i = OC . MimeType . getIconUrl ( e . get ( "mimetype" ) ) , a = new Image ; return a . onload = function ( ) { $ ( "li[data-revision=" + e . get ( "id" ) + "] .preview" ) . attr ( "src" , e . getPreviewUrl ( ) ) } , a . src = e . getPreviewUrl ( ) , _ . extend ( { versionId : e . get ( "id" ) , formattedTimestamp : OC . Util . formatDate ( r ) , relativeTimestamp : OC . Util . relativeModifiedDate ( r ) , millisecondsTimestamp : r , humanReadableSize : OC . Util . humanFileSize ( o , ! 0 ) , altSize : n ( "files" , "%n byte" , "%n bytes" , o ) , hasDetails : e . has ( "size" ) , downloadUrl : e . getDownloadUrl ( ) , downloadIconUrl : OC . imagePath ( "core" , "actions/download" ) , downloadName : e . get ( "name" ) , revertIconUrl : OC . imagePath ( "core" , "actions/history" ) , previewUrl : i , revertLabel : t ( "files_versions" , "Restore" ) , canRevert : 0 != ( this . collection . getFileInfo ( ) . get ( "permissions" ) & OC . PERMISSION _UPDATE ) } , e . attributes ) } , render : function ( ) { this . $el . html ( this . template ( { emptyResultLabel : t ( "files_versions" , "No other versions available" ) } ) ) , this . $el . find ( ".has-tooltip" ) . tooltip ( ) , this . $versionsContainer = this . $el . find ( "ul.versions" ) , this . delegateEvents ( ) } , canDisplay : function ( e ) { return ! ! e && ! e . isDirectory ( ) } } ) , OCA . Versions = OCA . Versions || { } , OCA . Versions . VersionsTabView = i ; o ( 31 ) ; var u = o ( 11 ) , d = o . n ( u ) , f = o ( 2 ) , p = { insert : "head" , singleton : ! 1 } ; d ( ) ( f . a , p ) , f . a . locals ;
/ * *
* @ copyright Copyright ( c ) 2016 Roeland Jago Douma < roeland @ famdouma . nl >
*
* @ author Roeland Jago Douma < roeland @ famdouma . nl >
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
* /
window . OCA . Versions = OCA . Versions } ] ) ;
2020-07-14 15:34:10 +03:00
//# sourceMappingURL=files_versions.js.map