mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-19 08:26:24 +00:00
2 lines
6.3 KiB
JavaScript
2 lines
6.3 KiB
JavaScript
!function(){"use strict";function e(e,t){e.state("administration",{abstract:!0,views:{administration:{templateUrl:"administration.html",controller:"AdministrationController",controllerAs:"app"}}}).state("administration.rights",{url:"/rights",views:{module:{templateUrl:"rights.html"}}}).state("administration.rights.edit",{url:"/:userId/:folderId/edit",views:{acl:{templateUrl:"UIxAdministrationAclEditor",controller:"AdministrationAclController",controllerAs:"acl"}},resolve:{stateUser:n,stateFolder:r,stateAcls:o}}).state("administration.theme",{url:"/theme",views:{module:{templateUrl:"UIxThemePreview",controller:"ThemePreviewController",controllerAs:"ctrl"}}}).state("administration.motd",{url:"/motd",views:{module:{templateUrl:"UIxAdministrationMotd",controller:"AdministrationMotdController",controllerAs:"ctrl"}}}),t.rules.otherwise("/rights")}function n(t,n,r){var o=_.find(r.$users,function(e){return e.uid==n.userId});return angular.isUndefined(o)?r.$filter(n.userId).then(function(e){return o=_.find(r.$users,function(e){return e.uid==n.userId}),angular.isUndefined(o)?t.reject("User with ID "+n.userId+" not found"):o.$folders().then(function(){return o})}):o}function r(e,t,n,r,o,i){var s=n(t.folderId),n=_.find(r.$$folders,function(e){return e.name==s}),t=new("Appointment"==n.type?i:o)({id:n.name.split("/").pop(),owner:n.owner,name:n.displayName});return r.selectedFolder=t.id,t}function o(e){return e.$acl.$users(e.owner)}function t(e,t,n,r){e.DebugEnabled||r.defaultErrorHandler(function(){}),n.onError({to:"administration.**"},function(e){"administration"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),r.go({state:"administration.rights"}))})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI","sgCkeditor"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],n.$inject=["$q","$stateParams","User"],r.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],o.$inject=["stateFolder"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(t,e,n,r,o,i,s,a,d){var u=this;function c(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;u.selectedUid==e.uid?u.selectedUid=null:(u.selectedUid=e.uid,u.selectedUser=e,u.selectedUser.$rights())}function m(){e.go("administration.rights").then(function(){delete u.user.selectedFolder,u.user=null})}u.user=o,u.folder=i,u.users=s,u.folderType=angular.isDefined(i.$cards)?"AddressBook":"Calendar",u.selectedUser=null,u.selectedUid=null,u.selectUser=c,u.selectAllRights=function(e){i.$acl.$selectAllRights(e)},u.showRights=function(e){return u.selectedUid==e.uid&&e.rights},u.removeUser=function(e){t(function(){i.$acl.$removeUser(e.uid,i.owner)},500)},u.getTemplate=function(){return angular.isDefined(i.$cards)?"../"+i.owner+"/Contacts/"+i.id+"/UIxContactsUserRightsEditor":"../"+i.owner+"/Calendar/"+i.id+"/UIxCalUserRightsEditor"},u.close=m,u.save=function(){i.$acl.$saveUsersRights(i.owner).then(function(){r.show(r.simple().textContent(l("ACLs saved")).position(a.toastPosition).hideDelay(2e3)),n("xs")&&m()})},u.userToAdd="",u.searchText="",u.userFilter=function(e){return d.$filter(e,i.$acl.users,{dry:!0,uid:u.user.uid})},u.addUser=function(e){e&&i.$acl.$addUser(e,i.owner).then(function(e){u.userToAdd="",u.searchText="",u.selectedUid=null,e&&c(e)})}}e.$inject=["$timeout","$state","$mdMedia","$mdToast","stateUser","stateFolder","stateAcls","sgConstant","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",e)}(),function(){"use strict";function e(t,e,n,r,o,i,s,a,d){var l=this;angular.element(e.document).find("title").attr("sg-default");this.$onInit=function(){this.service=d,this.selectedUser=null,this.users=d.$users},this.go=function(e){t.go("administration."+e),r(i["gt-md"])||o("left").close()},this.filter=function(e){d.$filter(e)},this.selectUser=function(e){this.selectedUser==this.users[e]?this.selectedUser=null:this.users[e].$folders().then(function(){l.selectedUser=l.users[e]})},this.selectFolder=function(e){t.go("administration.rights.edit",{userId:this.selectedUser.uid,folderId:a(e.name)})}}e.$inject=["$state","$window","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",e)}(),function(){"use strict";function e(e,t,n,r,o,i,s){var a=this;a.administration=i,a.motd=null,a.save=function(){this.administration.$saveMotd(a.motd).then(function(){r.show(r.simple().textContent(l("Message of the day has been saved")).position(o.toastPosition).hideDelay(3e3))})},a.clear=function(){console.log("HEY"),a.motd=""},a.ckConfig={autoGrow_minHeight:200,removeButtons:"Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Undo,Redo,Find,Replace,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,Image,HiddenField,CopyFormatting,RemoveFormat,NumberedList,BulletedList,Outdent,Indent,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Unlink,Anchor,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Styles,Format,Maximize,ShowBlocks,About,Strike,Subscript,Superscript,Underline,Emojipanel,Emoji,"},this.administration.$getMotd().then(function(e){e&&e.motd&&(a.motd=e.motd)})}e.$inject=["$timeout","$state","$mdMedia","$mdToast","sgConstant","Administration","sgSettings"],angular.module("SOGo.AdministrationUI").controller("AdministrationMotdController",e)}(),function(){"use strict";function e(e){e.registerStyles(['.foreground-1 { color: "{{foreground-1}}" }','.foreground-2 { color: "{{foreground-2}}" }','.foreground-3 { color: "{{foreground-3}}" }','.foreground-4 { color: "{{foreground-4}}" }','.background-contrast { color: "{{background-contrast}}" }','.background-contrast-secondary { color: "{{background-contrast-secondary}}" }','.background-default { background-color: "{{background-default}}" }'].join("")),e.generateThemesOnDemand(!1)}function t(e,t){this.defaultTheme=e.THEMES[e.defaultTheme()],this.jsonDefaultTheme=JSON.stringify(this.defaultTheme,void 0,2),this.getColor=t.getThemeColor}e.$inject=["$mdThemingProvider"],t.$inject=["$mdTheming","$mdColors"],angular.module("SOGo.AdministrationUI").config(e).controller("ThemePreviewController",t)}();
|
|
//# sourceMappingURL=Administration.js.map
|