sogo/UI/WebServerResources/js/Mailer.app.popup.js.map

1 line
11 KiB
Plaintext

{"version":3,"sources":["Mailer/Mailer.popup.js"],"names":["configure","$stateProvider","$urlRouterProvider","state","url","abstract","views","message","template","resolve","stateAccounts","stateAccount","stateMailbox","message@","controller","stateMessage","stateNewMessage","templateUrl","controllerAs","stateContent","otherwise","$q","Account","accounts","promises","window","opener","$mailboxController","when","$findAll","angular","forEach","account","i","mailboxes","$getMailboxes","push","then","objects","all","$stateParams","_","find","id","accountId","decodeUriFilter","_find","mailboxId","mailbox","o","path","children","length","$mailboxes","$newMessage","encodeUriFilter","$state","Message","data","$messageController","uid","parseInt","messageId","$account","$omit","privateAttributes","toString","$reload","$editableContent","runBlock","$window","$rootScope","$log","$on","event","toState","toParams","fromState","fromParams","error","close","current","previous","rejection","MessageEditorControllerPopup","$mdDialog","show","hasBackdrop","disableParentScroll","clickOutsideToClose","escapeToClose","locals","stateRecipients","module","config","run","$inject"],"mappings":"CAGA,WACE,YAWA,SAASA,GAAUC,EAAgBC,GACjCD,EACGE,MAAM,QACLC,IAAK,QACLC,YAAU,EACVC,OACEC,SACEC,SAAU,eAGdC,SACEC,cAAeA,KAGlBP,MAAM,gBACLC,IAAK,cACLC,YAAU,EACVG,SAAU,0BACVC,SACEE,aAAcA,KAGjBR,MAAM,wBACLC,IAAK,cACLC,YAAU,EACVG,SAAU,0BACVC,SACEG,aAAcA,KAGjBT,MAAM,mCACLC,IAAK,OACLE,OACEO,YACEL,SAAU,aACVM,WAAY,iCAGhBL,SACEM,aAAcC,KAGjBb,MAAM,gCACLC,IAAK,cACLE,OACEO,YACEI,YAAa,sBACbH,WAAY,oBACZI,aAAc,WAGlBT,SACEM,aAAcA,KAGjBZ,MAAM,qCACLC,IAAK,QACLE,OACEO,YACEI,YAAa,gBACbH,WAAY,0BACZI,aAAc,WAGlBT,SACEU,aAAcA,KAGjBhB,MAAM,uCACLC,IAAK,2CACLE,OACEC,SACEU,YAAa,gBACbH,WAAY,0BACZI,a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U,GAAIkD,GAAQ7C,EAAamD,SAASpB,GAAI/B,EAAc8C,GACvDnD,EAAQ4D,WAQnB,QAAShD,GAAaJ,GACpB,MAAOA,GAAaqD,mBAOtB,QAASC,GAASC,EAASC,EAAYC,GACrCD,EAAWE,IAAI,oBAAqB,SAASC,EAAOC,EAASC,EAAUC,EAAWC,EAAYC,GAC5FP,EAAKO,MAAMA,GACXT,EAAQU,UAEVT,EAAWE,IAAI,oBAAqB,SAASC,EAAOO,EAASC,EAAUC,GACrEX,EAAKO,MAAML,EAAOO,EAASC,EAAUC,KAQzC,QAASC,GAA6Bd,EAASe,EAAW3E,EAAeK,GACvEsE,EACGC,MACCC,aAAa,EACbC,qBAAqB,EACrBC,qBAAqB,EACrBC,eAAe,EACfzE,YAAa,gBACbH,WAAY,0BACZI,aAAc,SACdyE,QACEjF,cAAeA,EACfK,aAAcA,EACd6E,sBAZNP,WAeW,WACPf,EAAQU,UArOdlD,QAAQ+D,OAAO,iBAAkB,YAAa,YAAa,KAAM,oBAAqB,cAAe,kBAAmB,mBAAoB,YAAa,uBACtJC,OAAO9F,GACP+F,IAAI1B,GACJvD,WAAW,+BAAgCsE,GAK9CpF,EAAUgG,SAAW,iBAAkB,sBAuFvCtF,EAAcsF,SAAW,KAAM,WA2B/BrF,EAAaqF,SAAW,eAAgB,iBAUxCpF,EAAaoF,SAAW,eAAgB,eAAgB,mBAwBxDhF,EAAgBgF,SAAW,gBAQ3BjF,EAAaiF,SAAW,kBAAmB,KAAM,eAAgB,SAAU,eAAgB,WAyB3F7E,EAAa6E,SAAW,gBAQxB3B,EAAS2B,SAAW,UAAW,aAAc,QAc7CZ,EAA6BY,SAAW,UAAW,YAAa,gBAAiB","file":"Mailer.app.popup.js","sourcesContent":["/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGo.MailerUI module */\n\n(function() {\n 'use strict';\n\n angular.module('SOGo.MailerUI', ['ngCookies', 'ui.router', 'ck', 'angularFileUpload', 'SOGo.Common', 'SOGo.ContactsUI', 'SOGo.SchedulerUI', 'ngAnimate', 'SOGo.PreferencesUI'])\n .config(configure)\n .run(runBlock)\n .controller('MessageEditorControllerPopup', MessageEditorControllerPopup);\n\n /**\n * @ngInject\n */\n configure.$inject = ['$stateProvider', '$urlRouterProvider'];\n function configure($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('mail', {\n url: '/Mail',\n abstract: true,\n views: {\n message: {\n template: '<ui-view/>'\n }\n },\n resolve: {\n stateAccounts: stateAccounts\n }\n })\n .state('mail.account', {\n url: '/:accountId',\n abstract: true,\n template: '<ui-view id=\"account\"/>',\n resolve: {\n stateAccount: stateAccount\n }\n })\n .state('mail.account.mailbox', {\n url: '/:mailboxId',\n abstract: true,\n template: '<ui-view id=\"mailbox\"/>',\n resolve: {\n stateMailbox: stateMailbox\n }\n })\n .state('mail.account.mailbox.newMessage', {\n url: '/new',\n views: {\n 'message@': {\n template: '<ui-view/>',\n controller: 'MessageEditorControllerPopup'\n }\n },\n resolve: {\n stateMessage: stateNewMessage\n }\n })\n .state('mail.account.mailbox.message', {\n url: '/:messageId',\n views: {\n 'message@': {\n templateUrl: 'UIxMailViewTemplate', // UI/Templates/MailerUI/UIxMailViewTemplate.wox\n controller: 'MessageController',\n controllerAs: 'viewer'\n }\n },\n resolve: {\n stateMessage: stateMessage\n }\n })\n .state('mail.account.mailbox.message.edit', {\n url: '/edit',\n views: {\n 'message@': {\n templateUrl: 'UIxMailEditor', // UI/Templates/MailerUI/UIxMailEditor.wox\n controller: 'MessageEditorController',\n controllerAs: 'editor'\n }\n },\n resolve: {\n stateContent: stateContent\n }\n })\n .state('mail.account.mailbox.message.action', {\n url: '/{actionName:(?:reply|replyall|forward)}',\n views: {\n message: {\n templateUrl: 'UIxMailEditor', // UI/Templates/MailerUI/UIxMailEditor.wox\n controller: 'MessageEditorController',\n controllerAs: 'editor'\n }\n }\n });\n\n // if none of the above states are matched, use this as the fallback\n $urlRouterProvider.otherwise('/Mail/0/folderINBOX/new');\n }\n\n /**\n * @ngInject\n */\n stateAccounts.$inject = ['$q', 'Account'];\n function stateAccounts($q, Account) {\n var accounts, promises = [];\n\n if (window &&\n window.opener &&\n window.opener.$mailboxController) {\n // Mail accounts are available from the parent window\n accounts = window.opener.$mailboxController.accounts;\n return $q.when(accounts);\n }\n else {\n accounts = Account.$findAll();\n // Fetch list of mailboxes for each account\n angular.forEach(accounts, function(account, i) {\n var mailboxes = account.$getMailboxes();\n promises.push(mailboxes.then(function(objects) {\n return account;\n }));\n });\n return $q.all(promises);\n }\n }\n\n /**\n * @ngInject\n */\n stateAccount.$inject = ['$stateParams', 'stateAccounts'];\n function stateAccount($stateParams, stateAccounts) {\n return _.find(stateAccounts, function(account) {\n return account.id == $stateParams.accountId;\n });\n }\n\n /**\n * @ngInject\n */\n stateMailbox.$inject = ['$stateParams', 'stateAccount', 'decodeUriFilter'];\n function stateMailbox($stateParams, stateAccount, decodeUriFilter) {\n var mailboxId = decodeUriFilter($stateParams.mailboxId),\n _find;\n // Recursive find function\n _find = function(mailboxes) {\n var mailbox = _.find(mailboxes, function(o) {\n return o.path == mailboxId;\n });\n if (!mailbox) {\n angular.forEach(mailboxes, function(o) {\n if (!mailbox && o.children && o.children.length > 0) {\n mailbox = _find(o.children);\n }\n });\n }\n return mailbox;\n };\n return _find(stateAccount.$mailboxes);\n }\n\n /**\n * @ngInject\n */\n stateNewMessage.$inject = ['stateAccount'];\n function stateNewMessage(stateAccount) {\n return stateAccount.$newMessage();\n }\n\n /**\n * @ngInject\n */\n stateMessage.$inject = ['encodeUriFilter', '$q', '$stateParams', '$state', 'stateMailbox', 'Message'];\n function stateMessage(encodeUriFilter, $q, $stateParams, $state, stateMailbox, Message) {\n var data, message;\n\n if (window &&\n window.opener &&\n window.opener.$messageController &&\n window.opener.$messageController.message.uid == parseInt($stateParams.messageId)) {\n // Message is available from the parent window\n message = new Message(stateMailbox.$account.id,\n stateMailbox,\n window.opener.$messageController.message.$omit({privateAttributes: true}));\n return $q.when(message);\n }\n else {\n // Message is not available; load it from the server\n data = { uid: $stateParams.messageId.toString() };\n message = new Message(stateMailbox.$account.id, stateMailbox, data);\n return message.$reload();\n }\n }\n\n /**\n * @ngInject\n */\n stateContent.$inject = ['stateMessage'];\n function stateContent(stateMessage) {\n return stateMessage.$editableContent();\n }\n\n /**\n * @ngInject\n */\n runBlock.$inject = ['$window', '$rootScope', '$log'];\n function runBlock($window, $rootScope, $log) {\n $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {\n $log.error(error);\n $window.close();\n });\n $rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {\n $log.error(event, current, previous, rejection);\n });\n }\n\n /**\n * @ngInject\n */\n MessageEditorControllerPopup.$inject = ['$window', '$mdDialog', 'stateAccounts', 'stateMessage'];\n function MessageEditorControllerPopup($window, $mdDialog, stateAccounts, stateMessage) {\n $mdDialog\n .show({\n hasBackdrop: false,\n disableParentScroll: false,\n clickOutsideToClose: false,\n escapeToClose: false,\n templateUrl: 'UIxMailEditor',\n controller: 'MessageEditorController',\n controllerAs: 'editor',\n locals: {\n stateAccounts: stateAccounts,\n stateMessage: stateMessage,\n stateRecipients: []\n }\n })\n .finally(function() {\n $window.close();\n });\n }\n \n})();\n"]}