芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/static/js/Dropbox.app.0f08164bdb3c710608a8.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[287],{EYdH:(e,t,o)=>{var n=o("a7T2"),c=o("p09A"),s=o("KC/L");e.exports={ServerModuleName:"Dropbox",HashModuleName:"dropbox",Connected:!1,EnableModule:!1,Id:"",Secret:"",Scopes:[],init:function(e){var t=e.Dropbox;n.isEmpty(t)||(this.Connected=s.pBool(t.Connected,this.Connected),this.EnableModule=s.pBool(t.EnableModule,this.EnableModule),this.Id=s.pString(t.Id,this.Id),this.Secret=s.pString(t.Secret,this.Secret),this.Scopes=s.pArray(t.Scopes,this.Scopes))},getScopesCopy:function(){var e=[];return n.each(this.Scopes,(function(t){e.push({Description:t.Description,Name:t.Name,Value:c.observable(t.Value)})})),e},updateScopes:function(e,t){var o=[];n.each(t,(function(e){o.push({Description:e.Description,Name:e.Name,Value:e.Value()})})),this.Connected=e,this.Scopes=o},updateAdmin:function(e,t,o,n){this.EnableModule=e,this.Id=t,this.Secret=o,this.Scopes=n}}},IZ0N:(e,t,o)=>{e.exports=function(e){var t=o("a7T2"),n=o("H20a"),c=o("9kOp"),s=o("EYdH");return s.init(e),c.isUserNormalOrTenant()&&s.EnableModule&&t.isArray(s.Scopes)&&s.Scopes.length>0?{start:function(e){e.run("SettingsWebclient","registerSettingsTab",[function(){return o("OGa9")},s.HashModuleName,n.i18n("DROPBOX/LABEL_SETTINGS_TAB")])}}:null}},OGa9:(e,t,o)=>{var n=o("a7T2"),c=o("M4cL"),s=o("p09A"),a=o("KC/L"),i=o("Tt1R"),r=o("EFhx"),p=o("/QeJ"),u=o("9kOp"),l=o("TdEd"),h=o("mGms"),d=l.run("SettingsWebclient","getAbstractSettingsFormViewClass"),b=o("EYdH");function S(){d.call(this,b.ServerModuleName),this.connected=s.observable(b.Connected),this.scopes=s.observable(b.getScopesCopy()),this.bRunCallback=!1,window.dropboxConnectCallback=n.bind((function(e,t,o){this.bRunCallback=!0,e?(this.connected(!0),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):p.showErrorByCode({ErrorCode:a.pInt(t),ErrorMessage:"",Module:o},"",!0)}),this)}n.extendOwn(S.prototype,d.prototype),S.prototype.ViewTemplate="Dropbox_DropboxSettingsFormView",S.prototype.getCurrentValues=function(){var e=n.map(this.scopes(),(function(e){return e.Name+e.Value()}));return[this.connected(),e]},S.prototype.revertGlobalValues=function(){this.connected(b.Connected),this.scopes(b.getScopesCopy())},S.prototype.checkAndConnect=function(){var e={Scopes:[],Service:"dropbox",AllowConnect:!0},t=n.find(this.scopes(),(function(e){return"auth"===e.Name})),o=!!t&&!!t.Value(),c=n.find(b.getScopesCopy(),(function(e){return"auth"===e.Name})),s=!!c&&!!c.Value();n.each(this.scopes(),(function(t){t.Value()&&e.Scopes.push(t.Name)})),u.broadcastEvent("OAuthAccountChange::before",e),e.AllowConnect&&(o||o===s||!o&&u.isAccountDeletingAvailable())&&this.connect(e.Scopes)},S.prototype.connect=function(e){c.removeCookie("oauth-scopes"),c.cookie("oauth-scopes",e.join("|")),c.cookie("oauth-redirect","connect"),this.bRunCallback=!1;var t=h.open(i.getAppPath()+"?oauth=dropbox-connect","Dropbox"),o=setInterval(n.bind((function(){t.closed&&(clearInterval(o),this.bRunCallback?(u.broadcastEvent("OAuthAccountChange::after"),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):window.location.reload())}),this),1e3)},S.prototype.checkAndDisconnect=function(){var e={Service:"dropbox",AllowDisconnect:!0},t=n.find(b.getScopesCopy(),(function(e){return"auth"===e.Name})),o=!!t&&!!t.Value();u.broadcastEvent("OAuthAccountChange::before",e),!e.AllowDisconnect||o&&!u.isAccountDeletingAvailable()||this.disconnect()},S.prototype.disconnect=function(){r.send(b.ServerModuleName,"DeleteAccount",null,(function(e){e.Result?(this.connected(!1),n.each(this.scopes(),(function(e){e.Value(!1)})),u.broadcastEvent("OAuthAccountChange::after"),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):p.showErrorByCode(e,"",!0)}),this)},e.exports=new S}}]);