芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/static/js/5023.app.84716568f24734f7cb89.min.js
(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[5023],{"17yT":(t,e,i)=>{"use strict";var s=i("a7T2"),o=i("M4cL"),n=i("p09A"),r=i("sdEb"),a=i("9kOp"),h=i("teN/"),l=i("H20a"),p=i("KC/L"),u=i("Tt1R"),c=i("REt5"),d=i("mGms"),b=["image/jpeg","image/jpg","image/png","image/gif","text/html","text/plain","text/css","text/rfc822-headers","message/delivery-status","application/x-httpd-php","application/javascript"],m=[];function f(){this.id=n.observable(""),this.index=n.observable(0),this.fileName=n.observable(""),this.tempName=n.observable(""),this.extension=n.observable(""),this.fileName.subscribe((function(t){this.id(t),this.extension(c.getFileExtension(t))}),this),this.displayName=n.computed((function(){return this.fileName()}),this),this.size=n.observable(0),this.friendlySize=n.computed((function(){return this.size()>0?l.getFriendlySize(this.size()):""}),this),this.hash=n.observable(""),this.thumbUrlInQueue=n.observable(""),this.thumbUrlInQueueSubscribtion=this.thumbUrlInQueue.subscribe((function(){this.getInThumbQueue()}),this),this.thumbnailSrc=n.observable(""),this.thumbnailLoaded=n.observable(!1),this.mimeType=n.observable(""),this.uploadUid=n.observable(""),this.uploaded=n.observable(!1),this.uploadError=n.observable(!1),this.downloading=n.observable(!1),this.bHasHtmlEmbed=!1,this.otherTemplates=n.observableArray([]),this.visibleCancelButton=n.observable(!0),this.cancelButtonTooltip=l.i18n("COREWEBCLIENT/ACTION_CANCEL"),this.statusText=n.observable(""),this.statusTooltip=n.computed((function(){return this.uploadError()?this.statusText():""}),this),this.progressPercent=n.observable(0),this.visibleProgress=n.observable(!1),this.uploadStarted=n.observable(!1),this.uploadStarted.subscribe((function(){this.uploadStarted()?(this.uploaded(!1),this.visibleProgress(!0),this.progressPercent(20)):(this.progressPercent(100),this.visibleProgress(!1),this.uploaded(!0))}),this),this.downloading.subscribe((function(){this.downloading()?this.visibleProgress(!0):(this.visibleProgress(!1),this.progressPercent(0))}),this),this.allowDrag=n.observable(!1),this.allowUpload=n.observable(!1),this.allowPublicLink=n.observable(!1),this.bIsSecure=n.observable(!1),this.sHeaderText="",this.oActionsData={view:{Text:l.i18n("COREWEBCLIENT/ACTION_VIEW_FILE"),HandlerName:"viewFile"},download:{Text:l.i18n("COREWEBCLIENT/ACTION_DOWNLOAD_FILE"),HandlerName:"downloadFile",Tooltip:n.computed((function(){var t=l.i18n("COREWEBCLIENT/INFO_CLICK_TO_DOWNLOAD_FILE",{FILENAME:this.fileName(),SIZE:this.friendlySize()});return""===this.friendlySize()&&(t=t.replace(" ()","")),t}),this)}},this.allowActions=n.observable(!0),this.iconAction=n.observable("download"),this.cssClasses=n.computed((function(){return this.getCommonClasses().join(" ")}),this),this.actions=n.observableArray([]),this.firstAction=n.computed((function(){return this.actions().length>1?this.actions()[0]:""}),this),this.secondAction=n.computed((function(){return 1===this.actions().length?this.actions()[0]:this.actions().length>1?this.actions()[1]:""}),this),this.subFiles=n.observableArray([]),this.subFilesExpanded=n.observable(!1),this.sUploadSubFolder="",this.bIsHidden=!1}o("html").hasClass("pdf")&&(b.push("application/pdf"),b.push("application/x-pdf")),f.prototype.addAction=function(t,e,i){e?this.actions.unshift(t):this.actions.push(t),this.actions(s.compact(this.actions())),i&&(this.oActionsData[t]=i)},f.prototype.removeAction=function(t){this.actions(s.without(this.actions(),t))},f.prototype.getMainAction=function(){return this.actions()[0]},f.prototype.hasAction=function(t){return-1!==s.indexOf(this.actions(),t)},f.prototype.getActionText=function(t){return this.hasAction(t)&&this.oActionsData[t]&&("string"==typeof this.oActionsData[t].Text||s.isFunction(this.oActionsData[t].Text))?s.isFunction(this.oActionsData[t].Text)?this.oActionsData[t].Text():this.oActionsData[t].Text:""},f.prototype.getActionUrl=function(t){return this.hasAction(t)&&this.oActionsData[t]&&this.oActionsData[t].Url||""},f.prototype.executeAction=function(t){var e=this.hasAction(t)&&this.oActionsData[t];e&&(s.isFunction(e.Handler)?e.Handler():"string"==typeof e.HandlerName&&s.isFunction(this[e.HandlerName])&&this[e.HandlerName]())},f.prototype.getTooltip=function(t){var e=this.hasAction(t)&&this.oActionsData[t]?this.oActionsData[t].Tooltip:"";return"string"==typeof e?e:s.isFunction(e)?e():""},f.prototype.getCommonClasses=function(){var t=[];return(this.allowUpload()&&!this.uploaded()||this.downloading())&&t.push("incomplete"),this.uploadError()?t.push("fail"):t.push("success"),t},f.prototype.parse=function(t){this.fileName(p.pString(t.FileName)),this.tempName(p.pString(t.TempName)),""===this.tempName()&&this.tempName(this.fileName()),this.mimeType(p.pString(t.MimeType)),this.size(t.EstimatedSize?p.pInt(t.EstimatedSize):p.pInt(t.SizeInBytes)),this.hash(p.pString(t.Hash)),this.parseActions(t),this.uploadUid(this.hash()),this.uploaded(!0),s.isFunction(this.additionalParse)&&this.additionalParse(t)},f.prototype.parseActions=function(t){this.thumbUrlInQueue(""!==p.pString(t.ThumbnailUrl)?p.pString(t.ThumbnailUrl)+"/"+Math.random():""),this.commonParseActions(t),this.commonExcludeActions()},f.prototype.commonExcludeActions=function(){this.isViewSupported()||this.removeAction("view")},f.prototype.commonParseActions=function(t){s.each(t.Actions,(function(t,e){this.oActionsData[e]||(this.oActionsData[e]={}),this.oActionsData[e].Url=p.pString(t.url),this.actions.push(e)}),this)},f.addViewExtensions=function(t){s.isArray(t)&&(m=s.union(m,t))},f.prototype.isViewSupported=function(){return-1!==o.inArray(this.mimeType(),b)||-1!==o.inArray(p.pString(this.extension()).toLowerCase(),m)},f.prototype.getInThumbQueue=function(){""===this.thumbUrlInQueue()||this.linked&&(!this.linked||this.linked())||h.thumbQueue(this.thumbUrlInQueue(),this.thumbnailSrc)},f.prototype.downloadFile=function(t){var e=this.getActionUrl("download"),i={File:this,CancelDownload:!1};e.length>0&&"#"!==e&&(t||a.broadcastEvent("AbstractFileModel::FileDownload::before",i),i.CancelDownload||(s.isFunction(i.CustomDownloadHandler)?i.CustomDownloadHandler():(e+="/"+r().unix(),u.downloadByUrl(e,"eml"===this.extension()))))},f.prototype.viewFile=function(t,e){c.calmEvent(e),this.viewCommonFile()},f.prototype.viewCommonFile=function(t){var e=null,i=null;p.isNonEmptyString(t)||(t=u.getAppPath()+this.getActionUrl("view")),t.length>0&&"#"!==t&&(i={sUrl:t+="/"+r().unix(),index:this.index(),hash:this.hash(),continueView:!0},a.broadcastEvent("AbstractFileModel::FileView::before",i),i.continueView&&(e=d.open(i.sUrl,i.sUrl,!1))&&e.focus())},f.prototype.eventDragStart=function(t,e){var i=e.originalEvent||e;return t&&i&&i.dataTransfer&&i.dataTransfer.setData&&i.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl()),!0},f.prototype.generateTransferDownloadUrl=function(){var t=this.getActionUrl("download");return"http"!==t.substr(0,4)&&(t=u.getAppPath()+t),this.mimeType()+":"+this.fileName()+":"+t},f.prototype.onUploadSelect=function(t,e,i){i||(this.fileName(p.pString(e.FileName)),this.mimeType(p.pString(e.Type)),this.size(p.pInt(e.Size))),this.uploadUid(t),this.uploaded(!1),this.statusText(""),this.progressPercent(0),this.visibleProgress(!1),this.sUploadSubFolder=p.pString(e.Folder),this.bIsHidden=""!==this.sUploadSubFolder},f.prototype.onUploadStart=function(){this.visibleProgress(!0)},f.prototype.onUploadProgress=function(t,e){e>0&&(this.progressPercent(Math.ceil(t/e*100)),this.visibleProgress(!0))},f.prototype.onDownloadProgress=function(t,e){e>0&&(this.progressPercent(Math.ceil(t/e*100)),this.visibleProgress(this.progressPercent()<100))},f.prototype.onUploadComplete=function(t,e,i){var s=!(e&&i&&!i.ErrorCode&&i.Result&&!i.Result.Error),o=i&&i.ErrorCode&&i.ErrorCode===Enums.Errors.CanNotUploadFileLimit?l.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE"):l.i18n("COREWEBCLIENT/ERROR_UPLOAD_UNKNOWN");this.progressPercent(0),this.visibleProgress(!1),this.uploaded(!0),this.uploadError(s),this.statusText(s?o:l.i18n("COREWEBCLIENT/REPORT_UPLOAD_COMPLETE")),s||(this.fillDataAfterUploadComplete(i,t),setTimeout(function(t){return function(){t.statusText("")}}(this),3e3))},f.prototype.fillDataAfterUploadComplete=function(t,e){},f.prototype.onImageLoad=function(t,e){""===this.thumbUrlInQueue()||this.thumbnailLoaded()||(this.thumbnailLoaded(!0),h.thumbQueue(this.thumbUrlInQueue()))},f.prototype.stopDownloading=function(){this.downloading(!1)},f.prototype.startDownloading=function(){this.downloading(!0)},t.exports=f},K4vF:(t,e,i)=>{"use strict";var s=i("a7T2"),o=i("p09A"),n=i("o1lX");function r(){n.call(this),this.htmlEmbed=o.observable("")}s.extendOwn(r.prototype,n.prototype),r.prototype.PopupTemplate="CoreWebclient_EmbedHtmlPopup",r.prototype.onOpen=function(t){this.htmlEmbed(t)},r.prototype.close=function(){this.closePopup(),this.htmlEmbed("")},t.exports=new r},"teN/":(t,e,i)=>{"use strict";var s,o,n=i("H20a"),r=i("oUN1"),a=i("hT1I"),h=i("OfVV"),l={getDownloadLink:function(t,e,i){return e.length>0?"?/Download/"+t+"/DownloadFile/"+e+"/"+(i?"0/"+i:""):""},getIframeWrappwer:function(t,e){return"?/Raw/Iframe/"+t+"/"+window.encodeURIComponent(e)+"/"}};l.thumbQueue=(s={},o={},function(t,e){e?!(t in o)||o[t]>0?(t in o||(o[t]=2,s[t]=[]),o[t]--,e(t)):s[t].push({imageSrc:t,imageSrcObserver:e}):s[t]&&s[t].length&&(s[t][0].imageSrcObserver(s[t][0].imageSrc),s[t].shift())}),l.showErrorIfAttachmentSizeLimit=function(t,e){var i=n.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE_DETAILED",{FILENAME:t,MAXSIZE:n.getFriendlySize(h.AttachmentSizeLimit)});return h.AttachmentSizeLimit>0&&e>h.AttachmentSizeLimit&&(r.showPopup(a,[i]),!0)},t.exports=l},CsgX:(t,e,i)=>{"use strict";var s=i("a7T2"),o=i("p09A"),n=i("sdEb"),r=i("H20a"),a=i("KC/L"),h=i("REt5"),l=i("9kOp"),p=i("mGms"),u=i("17yT"),c=i("jNBr"),d=i("oUN1"),b=i("K4vF"),m=i("FyTm"),f=window.Enums;function E(t,e){this.oParent=a.pObject(e),this.IS_FILE=!0,this.storageType=o.observable(a.pString(t.Type)),this.sLastModified=E.parseLastModified(t.LastModified),this.iLastModified=a.pInt(t.LastModified),this.path=o.observable(a.pString(t.Path)),this.fullPath=o.observable(a.pString(t.FullPath)),this.selected=o.observable(!1),this.checked=o.observable(!1),this.bIsLink=!!t.IsLink,this.sLinkType=this.bIsLink?a.pString(t.LinkType):"",this.sLinkUrl=this.bIsLink?a.pString(t.LinkUrl):"",this.sThumbnailExternalLink=this.bIsLink?a.pString(t.ThumbnailUrl):"",this.deleted=o.observable(!1),this.recivedAnim=o.observable(!1).extend({autoResetToFalse:500}),this.published=o.observable(!1),this.sOwnerName=a.pString(t.Owner),this.sInitiator=a.pString(t.Initiator,this.sOwnerName),u.call(this),this.oExtendedProps=a.pObject(t.ExtendedProps),this.sharedWithMeAccessReshare=o.observable(!1),this.sharedWithMeAccessWrite=o.observable(!1),this.sharedWithMe=o.observable(!1),this.sharedWithOthers=o.observable(!1),this.parseExtendedProps(),this.displayName=o.computed((function(){return this.storageType()===f.FileStorageType.Shared&&this.oParent.sharedParentFolder&&!this.oParent.sharedParentFolder()?this.fullPath().replace(/^\//,""):this.fileName()}),this),this.content=o.observable(""),this.thumbUrlInQueueSubscribtion.dispose(),this.thumbUrlInQueue.subscribe((function(){""!==this.sThumbnailExternalLink?this.thumbnailSrc(this.sThumbnailExternalLink):this.bIsLink||this.getInThumbQueue()}),this),this.visibleCancelButton=o.computed((function(){return this.visibleProgress()&&100!==this.progressPercent()}),this),this.progressText=o.computed((function(){return r.i18n("COREWEBCLIENT/LABEL_UPLOADING_PERCENT",{PERCENT:this.progressPercent()})}),this),this.oActionsData.list={Text:r.i18n("COREWEBCLIENT/ACTION_VIEW_FILE"),Handler:s.bind((function(){l.broadcastEvent("Files::ShowList",{Item:this})}),this)},this.oActionsData.open={Text:r.i18n("COREWEBCLIENT/ACTION_OPEN_LINK"),Handler:s.bind(this.openLink,this)},this.iconAction(""),this.sHeaderText=s.bind((function(){if(this.sharedWithMe()&&this.sInitiator)return r.i18n("FILESWEBCLIENT/INFO_SHARED_BY",{OWNER:this.sInitiator});if(this.sLastModified){var t=""!==this.sOwnerName?"FILESWEBCLIENT/INFO_OWNER_AND_DATA":"FILESWEBCLIENT/INFO_DATA";return r.i18n(t,{OWNER:this.sOwnerName,LASTMODIFIED:this.sLastModified})}return""}),this)(),this.type=this.storageType,this.canShare=o.computed((function(){return this.storageType()===f.FileStorageType.Personal||this.storageType()===f.FileStorageType.Corporate}),this),this.sHtmlEmbed=a.pString(t.OembedHtml),this.commonParseActions(t),this.cssClasses=o.computed((function(){var t=this.getCommonClasses();return this.allowDrag()&&t.push("dragHandle"),this.selected()&&t.push("selected"),this.checked()&&t.push("checked"),this.deleted()&&t.push("deleted"),this.allowPublicLink()&&this.published()&&t.push("published"),this.bIsLink&&t.push("aslink"),t.join(" ")}),this),this.parse(t,!!this.oParent.bInPopup)}s.extendOwn(E.prototype,u.prototype),s.extendOwn(E.prototype,m),E.parseLastModified=function(t){var e=new c;return t?(e.parse(t),e.getShortDate()):""},E.prepareLinkData=function(t,e){return{IsLink:!0,LinkType:t.LinkType,LinkUrl:e,Name:t.Name,Size:t.Size,ThumbnailUrl:t.Thumb}},E.prototype.parse=function(t,e){this.uploaded(!0),this.allowDrag(!e&&!l.isPublic()),this.allowUpload(!0),this.allowPublicLink(!0),this.allowActions(!e&&""!==this.fullPath()),this.fileName(a.pString(t.Name)),this.content(a.pString(t.Content)),this.id(a.pString(t.Id)),this.published(!!t.Published),this.size(a.pInt(t.Size)),this.hash(a.pString(t.Hash)),this.thumbUrlInQueue(""!==a.pString(t.ThumbnailUrl)?a.pString(t.ThumbnailUrl)+"/"+Math.random():""),this.mimeType(a.pString(t.ContentType)),this.bHasHtmlEmbed=!e&&""!==this.fullPath()&&"oembeded"===this.sLinkType,this.bHasHtmlEmbed&&this.iconAction("view"),this.isViewSupported()||this.bHasHtmlEmbed||this.actions(s.without(this.actions(),"view")),l.broadcastEvent("FilesWebclient::ParseFile::after",[this,t])},E.prepareUploadFileData=function(t,e,i,s){var o=t.FileName,r=h.getFileExtension(o),a=h.getFileNameWithoutExtension(o),p=0;for(""!==r&&(r="."+r);s(o);)o=a+" ("+p+")"+r,p++;return t.FileName=o,{Name:o,LastModified:n().unix(),Owner:l.getUserPublicId(),Path:e,FullPath:e+"/"+o,Type:i,ContentType:t.Type,Size:t.Size}},E.prototype.viewFile=function(t,e){e&&(e.ctrlKey||e.shiftKey)||(""!==this.sHtmlEmbed?d.showPopup(b,[this.sHtmlEmbed]):this.bIsLink?this.viewCommonFile(this.sLinkUrl):this.viewCommonFile())},E.prototype.openLink=function(){this.bIsLink&&p.openTab(this.sLinkUrl)},E.prototype.commonParseActions=function(t){s.each(t.Actions,(function(t,e){this.oActionsData[e]||(this.oActionsData[e]={});var i="";"download"!==e&&"view"!==e||(i="&"+h.getRandomHash()),this.oActionsData[e].Url=a.pString(t.url)+i,this.actions.push(e)}),this)},t.exports=E},FyTm:(t,e,i)=>{const s=i("KC/L"),o={updateExtendedProps:function(t={}){this.oExtendedProps||(this.oExtendedProps={});for(const e in t)this.oExtendedProps[e]=t[e];this.parseExtendedProps()},parseExtendedProps:function(){const t=this.oExtendedProps.SharedWithMeAccess,e=s.pArray(this.oExtendedProps.Shares);this.sharedWithMeAccessReshare(t===Enums.SharedFileAccess.Reshare),this.sharedWithMeAccessWrite(this.sharedWithMeAccessReshare()||t===Enums.SharedFileAccess.Write),this.sharedWithMe(this.sharedWithMeAccessWrite()||t===Enums.SharedFileAccess.Read),this.sharedWithOthers(e.length>0)}};t.exports=o}}]);