2018-07-11 06:53:35 +02:00
|
|
|
!function(){"use strict";angular.module("SOGo.MailerUI",["ngCookies","ui.router","ck","angularFileUpload","SOGo.Common","SOGo.ContactsUI","SOGo.SchedulerUI","ngAnimate","SOGo.PreferencesUI"]).config(e).run(d),e.$inject=["$stateProvider","$urlServiceProvider"];function e(e,d){if(e.state("mail",{url:"/Mail",views:{mailboxes:{templateUrl:"UIxMailMainFrame",controller:"MailboxesController",controllerAs:"app"}},resolve:{stateAccounts:t}}).state("mail.account",{url:"/:accountId",abstract:!0,views:{mailbox:{template:"<ui-view/>"}},resolve:{stateAccount:a}}).state("mail.account.virtualMailbox",{url:"/virtual",views:{"mailbox@mail":{templateUrl:"UIxMailFolderTemplate",controller:"MailboxController",controllerAs:"mailbox"}},resolve:{stateMailbox:l}}).state("mail.account.virtualMailbox.message",{url:"/:mailboxId/:messageId",views:{message:{templateUrl:"UIxMailViewTemplate",controller:"MessageController",controllerAs:"viewer"}},resolve:{stateMailbox:n,stateMessages:i,stateMessage:s},onEnter:c,onExit:u}).state("mail.account.inbox",{url:"/inbox",onEnter:r}).state("mail.account.mailbox",{url:"/:mailboxId",views:{"mailbox@mail":{templateUrl:"UIxMailFolderTemplate",controller:"MailboxController",controllerAs:"mailbox"}},resolve:{stateMailbox:o,stateMessages:i}}).state("mail.account.mailbox.message",{url:"/:messageId",views:{message:{templateUrl:"UIxMailViewTemplate",controller:"MessageController",controllerAs:"viewer"}},onEnter:c,onExit:u,resolve:{stateMessage:s}}),d.rules.otherwise("/Mail/0/inbox"),navigator&&navigator.registerProtocolHandler){var m=window.location.origin+window.ApplicationBaseURL+"UIxMailPopupView#!/Mail/0/INBOX/new?%s";navigator.registerProtocolHandler("mailto",m,"SOGo")}}t.$inject=["$window","$q","Account"];function t(e,t,a){var o=a.$findAll(e.mailAccounts),r=[];return angular.forEach(o,function(e,t){var a=e.$getMailboxes();0===t?r.push(a.then(function(t){return e})):r.push(e)}),t.all(r)}a.$inject=["$stateParams","stateAccounts"];function a(e,t){return _.find(t,function(t){return t.id==e.accountId})}o.$inject=["$q","$stateParams","stateAccount","decodeUriFilter","Mailbox"];function o(e,t,a,o,r){var i,l,n=o(t.mailboxId);return l=function(e){var t=_.find(e,function(e){return e.path==n});return t||angular.forEach(e,function(e){!t&&e.children&&e.children.length>0&&(t=l(e.children))}),t},r.selectedFolder&&!r.$virtualMode&&(r.selectedFolder.$isLoading=!0),(i=l(a.$mailboxes))?(i.$topIndex=0,i.selectFolder(),i):e.reject("Mailbox doesn't exist")}r.$inject=["$transition$","encodeUriFilter","Mailbox"];function r(e,t,a){return e.injector().getAsync("stateAccount").then(function(o){return o.$mailboxes.length>0?e.router.stateService.target("mail.account.mailbox",{accountId:o.id,mailboxId:t(o.$mailboxes[0].path)}):(a.selectedFolder=!1,e.router.stateService.target("mail"))})}i.$inject=["$q","$state","Mailbox","stateMailbox"];function i(e,t,a,o){return a.$virtualMode?[]:o?o.$filter().catch(function(){return e.reject("Mailbox not found")}):e.reject("Mailbox doesn't exist")}l.$inject=["$q","Mailbox"];function l(e,t){return t.$virtualMode?t.selectedFolder:e.reject("No virtual mailbox defined")}n.$inject=["$q","Mailbox","decodeUriFilter","$stateParams"];function n(e,t,a,o){var r=a(o.mailboxId);return t.$virtualMode?(t.selectedFolder.resetSelectedMessage(),_.find(t.selectedFolder.$mailboxes,function(e){return e.path==r})):e.reject("No virtual mailbox defined for message")}s.$inject=["Mailbox","encodeUriFilter","$stateParams","$state","stateMailbox","stateMessages"];function s(e,t,a,o,r,i){var l;if(l=_.find(r.$messages,function(e){return e.uid==parseInt(a.messageId)}))return l.$reload({useCache:!0});o.go("mail.account.mailbox",{accountId:r.$account.id,mailboxId:t(r.path)})}c.$inject=["$stateParams","stateMailbox"];function c(e,t){t.selectedMessage=parseInt(e.messageId)}u.$inject=["stateMailbox"];function u(e){delete e.selectedMessage}d.$inject=["$window","$transitions","$log","$state","Mailbox"];function d(e,t,a,o,r){e.DebugEnabled||o.defaultErrorHandler(function(){}),t.onError({to:"mail.**"},function(e){"mail"!=e.to().name&&!e.ignored()&
|