mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-14 16:07:15 +00:00
Updated JS files for new build
This commit is contained in:
1 parent
302187410c
commit
565ad6900b
8 files changed
+8
-8
No files matched your search
Submodule UI/WebServerResources/angular-material updated: 80a8929f51...8ef798f0fe.
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(a,d){a.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:b,stateFolder:c}}),d.otherwise("/rights")}function b(a,b,c){var d;return d=_.find(c.$users,function(a){return a.uid==b.userId}),angular.isUndefined(d)?c.$filter(b.userId).then(function(e){return d=_.find(c.$users,function(a){return a.uid==b.userId}),angular.isUndefined(d)?a.reject("User with ID "+b.userId+" not found"):d.$folders().then(function(){return d})}):d}function c(a,b,c,d,e,f){var g,h,i=c(b.folderId);return g=_.find(d.$$folders,function(a){return a.name==i}),h="Appointment"==g.type?new f({id:g.name.split("/").pop(),owner:g.owner,name:g.displayName}):new e({id:g.name.split("/").pop(),owner:g.owner,name:g.displayName}),d.selectedFolder=h.id,h}function d(a,b,c){b.$on("$stateChangeError",function(b,d,e,f,g,h){a.error(h),c.go("administration.rights")}),b.$on("$routeChangeError",function(b,c,d,e){a.error(b,c,d,e)})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(a).run(d),a.$inject=["$stateProvider","$urlRouterProvider"],b.$inject=["$q","$stateParams","User"],c.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],d.$inject=["$log","$rootScope","$state"]}(),function(){"use strict";function a(a,b,c,d,e,f){function g(){return angular.isDefined(e.$cards)?"../"+e.owner+"/Contacts/"+e.id+"/UIxContactsUserRightsEditor":"../"+e.owner+"/Calendar/"+e.id+"/UIxCalUserRightsEditor"}function h(a){o.selectedUid==a.uid?o.selectedUid=null:(o.selectedUid=a.uid,o.selectedUser=a,o.selectedUser.$rights())}function i(a){return f.$filter(a,e.$acl.users,{dry:!0})}function j(a){e.$acl.$removeUser(a.uid)["catch"](function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}function k(a){a&&e.$acl.$addUser(a,e.owner).then(function(){o.userToAdd="",o.searchText=""},function(a){Dialog.alert(l("Warning"),a)})}function m(){b.go("administration.rights").then(function(){delete o.user.selectedFolder,o.user=null})}function n(){e.$acl.$saveUsersRights(e.owner).then(function(){c.show(c.simple().content(l("ACLs saved")).position("top right").hideDelay(3e3))},function(a,b){Dialog.alert(l("Warning"),l("An error occured please try again."))})}var o=this;o.user=d,o.folder=e,o.folderType=angular.isDefined(e.$cards)?"AddressBook":"Calendar",o.selectedUser=null,o.selectedUid=null,o.selectUser=h,o.removeUser=j,o.getTemplate=g,o.close=m,o.save=n,o.userToAdd="",o.searchText="",o.userFilter=i,o.addUser=k,e.$acl.$users(e.owner).then(function(a){o.users=a})}a.$inject=["$animate","$state","$mdToast","stateUser","stateFolder","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",a)}(),function(){"use strict";function a(a,b,c,d,e){function f(b){a.go("administration."+b)}function g(a){e.$filter(a)}function h(a){j.selectedUser==j.users[a]?j.selectedUser=null:j.users[a].$folders().then(function(){j.selectedUser=j.users[a]})}function i(b){a.go("administration.rights.edit",{userId:j.selectedUser.uid,folderId:d(b.name)})}var j=this;j.service=e,j.selectedUser=null,j.users=e.$users,j.go=f,j.filter=g,j.selectUser=h,j.selectFolder=i}a.$inject=["$state","$mdToast","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",a)}();
|
||||
(function(){"use strict";angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(configure).run(runBlock);configure.$inject=["$stateProvider","$urlRouterProvider"];function configure($stateProvider,$urlRouterProvider){$stateProvider.state("administration",{"abstract":true,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:stateUser,stateFolder:stateFolder}});$urlRouterProvider.otherwise("/rights")}stateUser.$inject=["$q","$stateParams","User"];function stateUser($q,$stateParams,User){var user;user=_.find(User.$users,function(user){return user.uid==$stateParams.userId});if(angular.isUndefined(user)){return User.$filter($stateParams.userId).then(function(users){user=_.find(User.$users,function(user){return user.uid==$stateParams.userId});if(angular.isUndefined(user)){return $q.reject("User with ID "+$stateParams.userId+" not found")}else{return user.$folders().then(function(){return user})}return user})}return user}stateFolder.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"];function stateFolder($state,$stateParams,decodeUriFilter,stateUser,AddressBook,Calendar){var folder,o,folderId=decodeUriFilter($stateParams.folderId);folder=_.find(stateUser.$$folders,function(folder){return folder.name==folderId});if(folder.type=="Appointment"){o=new Calendar({id:folder.name.split("/").pop(),owner:folder.owner,name:folder.displayName})}else{o=new AddressBook({id:folder.name.split("/").pop(),owner:folder.owner,name:folder.displayName})}stateUser.selectedFolder=o.id;return o}runBlock.$inject=["$log","$rootScope","$state"];function runBlock($log,$rootScope,$state){$rootScope.$on("$stateChangeError",function(event,toState,toParams,fromState,fromParams,error){$log.error(error);$state.go("administration.rights")});$rootScope.$on("$routeChangeError",function(event,current,previous,rejection){$log.error(event,current,previous,rejection)})}})();(function(){"use strict";AdministrationAclController.$inject=["$animate","$state","$mdToast","stateUser","stateFolder","User"];function AdministrationAclController($animate,$state,$mdToast,stateUser,stateFolder,User){var vm=this;vm.user=stateUser;vm.folder=stateFolder;vm.folderType=angular.isDefined(stateFolder.$cards)?"AddressBook":"Calendar";vm.selectedUser=null;vm.selectedUid=null;vm.selectUser=selectUser;vm.removeUser=removeUser;vm.getTemplate=getTemplate;vm.close=close;vm.save=save;vm.userToAdd="";vm.searchText="";vm.userFilter=userFilter;vm.addUser=addUser;stateFolder.$acl.$users(stateFolder.owner).then(function(data){vm.users=data});function getTemplate(){if(angular.isDefined(stateFolder.$cards))return"../"+stateFolder.owner+"/Contacts/"+stateFolder.id+"/UIxContactsUserRightsEditor";return"../"+stateFolder.owner+"/Calendar/"+stateFolder.id+"/UIxCalUserRightsEditor"}function selectUser(user){if(vm.selectedUid==user.uid){vm.selectedUid=null}else{vm.selectedUid=user.uid;vm.selectedUser=user;vm.selectedUser.$rights()}}function userFilter($query){return User.$filter($query,stateFolder.$acl.users,{dry:true})}function removeUser(user){stateFolder.$acl.$removeUser(user.uid).catch(function(data,status){Dialog.alert(l("Warning"),l("An error occured please try again."))})}function addUser(data){if(data){stateFolder.$acl.$addUser(data,stateFolder.owner).then(function(){vm.userToAdd="";vm.searchText=""},function(error){Dialog.alert(l("Warning"),error)})}}function close(){$state.go("administration.rights").then(function(){delete vm.user.selectedFolder;vm.user=null})}function save(){stateFolder.$acl.$saveUsersRights(stateFolder.owner).then(function(){$mdToast.show($mdToast.simple().content(l("ACLs saved")).position("top right").hideDelay(3e3))},function(data,status){Dialog.alert(l("Warning"),l("An error occured please try again."))})}}angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",AdministrationAclController)})();(function(){"use strict";AdministrationController.$inject=["$state","$mdToast","Dialog","encodeUriFilter","User"];function AdministrationController($state,$mdToast,Dialog,encodeUriFilter,User){var vm=this;vm.service=User;vm.selectedUser=null;vm.users=User.$users;vm.go=go;vm.filter=filter;vm.selectUser=selectUser;vm.selectFolder=selectFolder;function go(module){$state.go("administration."+module)}function filter(searchText){User.$filter(searchText)}function selectUser(i){if(vm.selectedUser==vm.users[i]){vm.selectedUser=null}else{vm.users[i].$folders().then(function(){vm.selectedUser=vm.users[i]})}}function selectFolder(folder){$state.go("administration.rights.edit",{usLine truncated
|
||||
//# sourceMappingURL=Administration.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(){}a.$factory=["$q","$timeout","$log","sgSettings","Resource","User",function(b,c,d,e,f,g){return angular.extend(a,{$q:b,$timeout:c,$log:d,$$resource:new f(e.activeUser("folderURL"),e.activeUser()),activeUser:e.activeUser(),$User:g}),new a}];try{angular.module("SOGo.AdministrationUI")}catch(b){angular.module("SOGo.AdministrationUI",["SOGo.Common"])}angular.module("SOGo.AdministrationUI").factory("Administration",a.$factory)}();
|
||||
(function(){"use strict";function Administration(){}Administration.$factory=["$q","$timeout","$log","sgSettings","Resource","User",function($q,$timeout,$log,Settings,Resource,User){angular.extend(Administration,{$q:$q,$timeout:$timeout,$log:$log,$$resource:new Resource(Settings.activeUser("folderURL"),Settings.activeUser()),activeUser:Settings.activeUser(),$User:User});return new Administration}];try{angular.module("SOGo.AdministrationUI")}catch(e){angular.module("SOGo.AdministrationUI",["SOGo.Common"])}angular.module("SOGo.AdministrationUI").factory("Administration",Administration.$factory)})();
|
||||
//# sourceMappingURL=Administration.services.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(a,f){a.state("app",{url:"/addressbooks","abstract":!0,views:{addressbooks:{templateUrl:"UIxContactFoldersView",controller:"AddressBooksController",controllerAs:"app"}},resolve:{stateAddressbooks:b}}).state("app.addressbook",{url:"/:addressbookId",views:{addressbook:{templateUrl:"addressbook",controller:"AddressBookController",controllerAs:"addressbook"}},resolve:{stateAddressbook:c}}).state("app.addressbook.new",{url:"/{contactType:(?:card|list)}/new",views:{card:{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}},resolve:{stateCard:d}}).state("app.addressbook.card",{url:"/:cardId","abstract":!0,views:{card:{template:"<ui-view/>"}},resolve:{stateCard:e}}).state("app.addressbook.card.view",{url:"/view",views:{"card@app.addressbook":{templateUrl:"UIxContactViewTemplate",controller:"CardController",controllerAs:"editor"}}}).state("app.addressbook.card.editor",{url:"/edit",views:{"card@app.addressbook":{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}}}),f.otherwise("/addressbooks/personal")}function b(a){return a.$findAll(window.contactFolders)}function c(a,b,c,d){var e=_.find(d.$findAll(),function(a){return a.id==c.addressbookId});return e?(e.$reload(),e):a.reject("Addressbook "+c.addressbookId+" not found")}function d(a,b,c){var d="v"+a.contactType,e=new c({pid:a.addressbookId,c_component:d});return b.selectedCard=!0,e}function e(a,b){return b.selectedCard=a.cardId,b.$getCard(a.cardId)}function f(a,b,c){a.$on("$stateChangeError",function(a,d,e,f,g,h){b.error(h),c.go("app.addressbook",{addressbookId:"personal"})}),a.$on("$routeChangeError",function(a,c,d,e){b.error(a,c,d,e)})}angular.module("SOGo.ContactsUI",["ui.router","angularFileUpload","ck","SOGo.Common","SOGo.PreferencesUI","SOGo.MailerUI"]).config(a).run(f),a.$inject=["$stateProvider","$urlRouterProvider"],b.$inject=["AddressBook"],c.$inject=["$q","$state","$stateParams","AddressBook"],d.$inject=["$stateParams","stateAddressbook","Card"],e.$inject=["$stateParams","stateAddressbook"],f.$inject=["$rootScope","$log","$state"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,m){function n(a){c.go("app.addressbook.card.view",{addressbookId:m.id,cardId:a.id})}function o(a,b){b.selected=!b.selected,a.preventDefault(),a.stopPropagation()}function p(a){function b(a,b,c,d){a.create=function(a){b.hide(),c.go("app.addressbook.new",{addressbookId:d,contactType:a})}}e.show({parent:angular.element(document.body),targetEvent:a,clickOutsideToClose:!0,escapeToClose:!0,template:['<md-dialog aria-label="'+l("Create component")+'">'," <md-dialog-content>",' <div layout="column">'," <md-button ng-click=\"create('card')\">"," "+l("Contact")," </md-button>"," <md-button ng-click=\"create('list')\">"," "+l("List")," </md-button>"," </div>"," </md-dialog-content>","</md-dialog>"].join(""),locals:{addressbookId:C.selectedFolder.id},controller:b}),b.$inject=["scope","$mdDialog","$state","addressbookId"]}function q(a,b){return a&&a.c_component==b&&!a.selected}function r(){_.each(C.selectedFolder.cards,function(a){a.selected=!1})}function s(){i.confirm(l("Warning"),l("Are you sure you want to delete the selected contacts?")).then(function(){var a=_.filter(C.selectedFolder.cards,function(a){return a.selected});C.selectedFolder.$deleteCards(a),delete C.selectedFolder.selectedCard},function(a,b){})}function t(){var a=_.filter(C.selectedFolder.cards,function(a){return a.selected}),b=_.pluck(a,"id");window.location.href=ApplicationBaseURL+"/"+C.selectedFolder.id+"/export?uid="+b.join("&uid=")}function u(a){var b=_.filter(C.selectedFolder.cards,function(a){return a.selected});C.selectedFolder.$copyCards(b,a).then(function(){},function(a){i.alert(l("Error"),a)})}function v(){_.each(C.selectedFolder.cards,function(a){a.selected=!0})}function w(a){C.selectedFolder.$filter("",{sort:a})}function x(a){return h.$query.sort==a}function y(){C.mode.search=!1,C.selectedFolder.$filter("")}function z(a,b){f.$findAll().then(function(c){var d=_.filter(c,function(a){return 0===a.id?a:void 0})[0];d.$getMailboxes().then(function(f){d.$newMessage().then(function(d){e.show({parent:angular.element(document.body),targetEvent:a,clickOutsideToClose:!1,escapeToClose:!1,templateUrl:"../Mail/UIxMailEditor",controller:"MessageEditorController",controllerAs:"editor",locals:{stateAccounts:c,stateMessage:d,stateRecipients:b}})})})})}function A(a,b,c){var d=[{full:c+" <"+b+">"}];C.newMessage(a,d),a.stopPropagation(),a.preventDefault()}function B(a){var c=_.filter(C.selectedFolder.cards,function(a){return a.selected}),d=[],e=[];_.each(c,function(a){"vcard"==a.c_component&&a.c_mail.length?e.push({full:a.c_cn+" <"+a.c_mail+">"}):"vlist"==a.c_component&&(angular.isDefined(a.refs)&&a.refs.length?_.each(a.refs,function(a){a.email.length&&e.push({full:a.c_cn+" <"+a.email+">"})}):d.push(C.selectedFolder.$getCard(a.id).then(function(a){return a.$futureCardDataLine truncated
|
||||
(function(){"use strict";angular.module("SOGo.ContactsUI",["ui.router","angularFileUpload","ck","SOGo.Common","SOGo.PreferencesUI","SOGo.MailerUI"]).config(configure).run(runBlock);configure.$inject=["$stateProvider","$urlRouterProvider"];function configure($stateProvider,$urlRouterProvider){$stateProvider.state("app",{url:"/addressbooks","abstract":true,views:{addressbooks:{templateUrl:"UIxContactFoldersView",controller:"AddressBooksController",controllerAs:"app"}},resolve:{stateAddressbooks:stateAddressbooks}}).state("app.addressbook",{url:"/:addressbookId",views:{addressbook:{templateUrl:"addressbook",controller:"AddressBookController",controllerAs:"addressbook"}},resolve:{stateAddressbook:stateAddressbook}}).state("app.addressbook.new",{url:"/{contactType:(?:card|list)}/new",views:{card:{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}},resolve:{stateCard:stateNewCard}}).state("app.addressbook.card",{url:"/:cardId","abstract":true,views:{card:{template:"<ui-view/>"}},resolve:{stateCard:stateCard}}).state("app.addressbook.card.view",{url:"/view",views:{"card@app.addressbook":{templateUrl:"UIxContactViewTemplate",controller:"CardController",controllerAs:"editor"}}}).state("app.addressbook.card.editor",{url:"/edit",views:{"card@app.addressbook":{templateUrl:"UIxContactEditorTemplate",controller:"CardController",controllerAs:"editor"}}});$urlRouterProvider.otherwise("/addressbooks/personal")}stateAddressbooks.$inject=["AddressBook"];function stateAddressbooks(AddressBook){return AddressBook.$findAll(window.contactFolders)}stateAddressbook.$inject=["$q","$state","$stateParams","AddressBook"];function stateAddressbook($q,$state,$stateParams,AddressBook){var addressbook=_.find(AddressBook.$findAll(),function(addressbook){return addressbook.id==$stateParams.addressbookId});if(addressbook){addressbook.$reload();return addressbook}return $q.reject("Addressbook "+$stateParams.addressbookId+" not found")}stateNewCard.$inject=["$stateParams","stateAddressbook","Card"];function stateNewCard($stateParams,stateAddressbook,Card){var tag="v"+$stateParams.contactType,card=new Card({pid:$stateParams.addressbookId,c_component:tag});stateAddressbook.selectedCard=true;return card}stateCard.$inject=["$stateParams","stateAddressbook"];function stateCard($stateParams,stateAddressbook){stateAddressbook.selectedCard=$stateParams.cardId;return stateAddressbook.$getCard($stateParams.cardId)}runBlock.$inject=["$rootScope","$log","$state"];function runBlock($rootScope,$log,$state){$rootScope.$on("$stateChangeError",function(event,toState,toParams,fromState,fromParams,error){$log.error(error);$state.go("app.addressbook",{addressbookId:"personal"})});$rootScope.$on("$routeChangeError",function(event,current,previous,rejection){$log.error(event,current,previous,rejection)})}})();(function(){"use strict";AddressBookController.$inject=["$scope","$q","$state","$timeout","$mdDialog","Account","Card","AddressBook","Dialog","sgSettings","stateAddressbooks","stateAddressbook"];function AddressBookController($scope,$q,$state,$timeout,$mdDialog,Account,Card,AddressBook,Dialog,Settings,stateAddressbooks,stateAddressbook){var vm=this;AddressBook.selectedFolder=stateAddressbook;vm.service=AddressBook;vm.selectedFolder=stateAddressbook;vm.selectCard=selectCard;vm.toggleCardSelection=toggleCardSelection;vm.newComponent=newComponent;vm.notSelectedComponent=notSelectedComponent;vm.unselectCards=unselectCards;vm.confirmDeleteSelectedCards=confirmDeleteSelectedCards;vm.saveSelectedCards=saveSelectedCards;vm.copySelectedCards=copySelectedCards;vm.selectAll=selectAll;vm.sort=sort;vm.sortedBy=sortedBy;vm.cancelSearch=cancelSearch;vm.newMessage=newMessage;vm.newMessageWithSelectedCards=newMessageWithSelectedCards;vm.newMessageWithRecipient=newMessageWithRecipient;vm.mode={search:false};function selectCard(card){$state.go("app.addressbook.card.view",{addressbookId:stateAddressbook.id,cardId:card.id})}function toggleCardSelection($event,card){card.selected=!card.selected;$event.preventDefault();$event.stopPropagation()}function newComponent(ev){$mdDialog.show({parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:true,escapeToClose:true,template:['<md-dialog aria-label="'+l("Create component")+'">'," <md-dialog-content>",' <div layout="column">'," <md-button ng-click=\"create('card')\">"," "+l("Contact")," </md-button>"," <md-button ng-click=\"create('list')\">"," "+l("List")," </md-button>"," </div>"," </md-dialog-content>","</md-dialog>"].join(""),locals:{addressbookId:vm.selectedFolder.id},controller:ComponentDialogController});ComponentDialogController.$inject=["scope","$mdDialog","$state","addressbookId"];function ComponentDialogController(scope,$mdDialog,$state,addressbookId){scope.create=function(type){$mdDialog.hide();$state.go("app.addressbook.new",{addressbookId:addressbookId,contactType:type})}}}function notSelectedComponent(currentCard,type){returnLine truncated
|
||||
//# sourceMappingURL=Contacts.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(b){if("function"!=typeof b.then)if(this.init(b),this.name&&!this.id){var c=a.$$resource.create("createFolder",this.name);this.$unwrap(c)}else this.id&&(this.$acl=new a.$$Acl("Contacts/"+this.id));else this.$unwrap(b)}a.$factory=["$q","$timeout","$log","sgSettings","Resource","Card","Acl","Preferences",function(b,c,d,e,f,g,h,i){return angular.extend(a,{$q:b,$timeout:c,$log:d,$$resource:new f(e.activeUser("folderURL")+"Contacts",e.activeUser()),$Card:g,$$Acl:h,$Preferences:i,$query:{search:"name_or_address",value:"",sort:"c_cn",asc:1},activeUser:e.activeUser(),selectedFolder:null,$refreshTimeout:null}),i.ready().then(function(){i.settings.Contact.SortingState&&(a.$query.sort=i.settings.Contact.SortingState[0],a.$query.asc=parseInt(i.settings.Contact.SortingState[1]))}),a}];try{angular.module("SOGo.ContactsUI")}catch(b){angular.module("SOGo.ContactsUI",["SOGo.Common","SOGo.PreferencesUI"])}angular.module("SOGo.ContactsUI").factory("AddressBook",a.$factory),a.$filterAll=function(b,c,d){var e={search:b};if(!b)return a.$cards=[],a.$q.when(a.$cards);if(angular.isUndefined(a.$cards))a.$cards=[];else if(a.$query.value==b)return a.$q.when(a.$cards);return a.$query.value=b,angular.extend(e,c),a.$$resource.fetch(null,"allContactSearch",e).then(function(c){var e,f,g,h=function(a){return this.id==a.id};for(e=d?_.filter(c.contacts,function(a){return _.isUndefined(_.find(d,h,a))}):c.contacts,g=a.$cards.length-1;g>=0;g--)f=a.$cards[g],_.isUndefined(_.find(e,h,f))&&a.$cards.splice(g,1);return _.each(e,function(c,d){if(_.isUndefined(_.find(a.$cards,h,c))){var e=new a.$Card(c,b);a.$cards.splice(d,0,e)}}),a.$log.debug(a.$cards),a.$cards})},a.$add=function(a){var b,c,d;b=a.isSubscription?this.$subscriptions:this.$addressbooks,c=_.find(b,function(b){return"personal"==a.id||"personal"!=b.id&&1===b.name.localeCompare(a.name)}),d=c?_.indexOf(_.pluck(b,"id"),c.id):1,b.splice(d,0,a)},a.$findAll=function(b){var c=this;return b&&(this.$addressbooks=[],this.$subscriptions=[],this.$remotes=[],angular.forEach(b,function(b,d){var e=new a(b);e.isRemote?c.$remotes.push(e):e.isSubscription?c.$subscriptions.push(e):c.$addressbooks.push(e)})),_.union(this.$addressbooks,this.$subscriptions,this.$remotes)},a.$find=function(b){var c=a.$Preferences.ready().then(function(){return a.$$resource.fetch(b,"view",a.$query)});return new a(c)},a.$subscribe=function(b,c){var d=this;return a.$$resource.userResource(b).fetch(c,"subscribe").then(function(b){var c=new a(b);return _.isUndefined(_.find(d.$subscriptions,function(a){return a.id==b.id}))&&a.$add(c),c})},a.prototype.init=function(b,c){this.$cards||(this.$isLoading=!0,this.$cards=[],this.cards=[]),angular.extend(this,b),this.isOwned=a.activeUser.isSuperUser||this.owner==a.activeUser.login,this.isSubscription=!this.isRemote&&this.owner!=a.activeUser.login},a.prototype.$id=function(){return this.id?a.$q.when(this.id):this.$futureAddressBookData.then(function(a){return a.id})},a.prototype.isSelectedCard=function(a){return this.selectedCard==a},a.prototype.$selectedCount=function(){var a;return a=0,this.cards&&(a=_.filter(this.cards,function(a){return a.selected}).length),a},a.prototype.$startRefreshTimeout=function(){var b=this;a.$refreshTimeout&&a.$timeout.cancel(a.$refreshTimeout),a.$Preferences.ready().then(function(){var c=a.$Preferences.defaults.SOGoRefreshViewCheck;if(c&&"manually"!=c){var d=angular.bind(b,a.prototype.$reload);a.$refreshTimeout=a.$timeout(d,1e3*c.timeInterval())}})},a.prototype.$reload=function(){return this.$startRefreshTimeout(),this.$filter()},a.prototype.$filter=function(b,c,d){var e=this;return c&&c.dry||(this.$isLoading=!0),a.$Preferences.ready().then(function(){if(c&&(angular.extend(a.$query,c),c.dry)){if(!b)return e.$cards=[],a.$q.when(e.$cards);if(a.$query.value==b)return a.$q.when(e.$cards)}return angular.isDefined(b)&&(a.$query.value=b),e.$id().then(function(b){return a.$$resource.fetch(b,"view",a.$query)}).then(function(f){var g,h,i,j,k=function(a){return e.id==a.id};for(h=c&&c.dry?e.$cards:e.cards,g=d?_.filter(f.cards,function(a){return _.isUndefined(_.find(d,k,a))}):f.cards,j=h.length-1;j>=0;j--)i=h[j],_.isUndefined(_.find(g,k,i))&&h.splice(j,1);return _.each(g,function(c,d){if(_.isUndefined(_.find(h,k,c))){var e=new a.$Card(c,b);h.splice(d,0,e)}}),_.each(g,function(a,b){var c,d;h[b].id!=a.id&&(c=_.findIndex(h,k,a),d=h.splice(c,1),h.splice(b,0,d[0]))}),e.$isLoading=!1,h})})},a.prototype.$rename=function(b){var c=_.indexOf(_.pluck(a.$addressbooks,"id"),this.id);return this.name=b,a.$addressbooks.splice(c,1),a.$add(this),this.$save()},a.prototype.$delete=function(){var b,c,d=this,e=a.$q.defer();return this.isSubscription?(c=a.$$resource.fetch(this.id,"unsubscribe"),b=a.$subscriptions):(c=a.$$resource.remove(this.id),b=a.$addressbooks),c.then(function(){var a=_.indexOf(_.pluck(b,"id"),d.id);b.splice(a,1),e.resolve()},e.reject),e.promise},a.prototype.$deleteCards=function(b){var c=_.map(b,function(a){return a.id}),d=this;return a.$$resouLine truncated
|
||||
(function(){"use strict";function AddressBook(futureAddressBookData){if(typeof futureAddressBookData.then!=="function"){this.init(futureAddressBookData);if(this.name&&!this.id){var newAddressBookData=AddressBook.$$resource.create("createFolder",this.name);this.$unwrap(newAddressBookData)}else if(this.id){this.$acl=new AddressBook.$$Acl("Contacts/"+this.id)}}else{this.$unwrap(futureAddressBookData)}}AddressBook.$factory=["$q","$timeout","$log","sgSettings","Resource","Card","Acl","Preferences",function($q,$timeout,$log,Settings,Resource,Card,Acl,Preferences){angular.extend(AddressBook,{$q:$q,$timeout:$timeout,$log:$log,$$resource:new Resource(Settings.activeUser("folderURL")+"Contacts",Settings.activeUser()),$Card:Card,$$Acl:Acl,$Preferences:Preferences,$query:{search:"name_or_address",value:"",sort:"c_cn",asc:1},activeUser:Settings.activeUser(),selectedFolder:null,$refreshTimeout:null});Preferences.ready().then(function(){if(Preferences.settings.Contact.SortingState){AddressBook.$query.sort=Preferences.settings.Contact.SortingState[0];AddressBook.$query.asc=parseInt(Preferences.settings.Contact.SortingState[1])}});return AddressBook}];try{angular.module("SOGo.ContactsUI")}catch(e){angular.module("SOGo.ContactsUI",["SOGo.Common","SOGo.PreferencesUI"])}angular.module("SOGo.ContactsUI").factory("AddressBook",AddressBook.$factory);AddressBook.$filterAll=function(search,options,excludedCards){var params={search:search};if(!search){AddressBook.$cards=[];return AddressBook.$q.when(AddressBook.$cards)}if(angular.isUndefined(AddressBook.$cards)){AddressBook.$cards=[]}else if(AddressBook.$query.value==search){return AddressBook.$q.when(AddressBook.$cards)}AddressBook.$query.value=search;angular.extend(params,options);return AddressBook.$$resource.fetch(null,"allContactSearch",params).then(function(response){var results,card,index,compareIds=function(data){return this.id==data.id};if(excludedCards){results=_.filter(response.contacts,function(data){return _.isUndefined(_.find(excludedCards,compareIds,data))})}else{results=response.contacts}for(index=AddressBook.$cards.length-1;index>=0;index--){card=AddressBook.$cards[index];if(_.isUndefined(_.find(results,compareIds,card))){AddressBook.$cards.splice(index,1)}}_.each(results,function(data,index){if(_.isUndefined(_.find(AddressBook.$cards,compareIds,data))){var card=new AddressBook.$Card(data,search);AddressBook.$cards.splice(index,0,card)}});AddressBook.$log.debug(AddressBook.$cards);return AddressBook.$cards})};AddressBook.$add=function(addressbook){var list,sibling,i;list=addressbook.isSubscription?this.$subscriptions:this.$addressbooks;sibling=_.find(list,function(o){return addressbook.id=="personal"||o.id!="personal"&&o.name.localeCompare(addressbook.name)===1});i=sibling?_.indexOf(_.pluck(list,"id"),sibling.id):1;list.splice(i,0,addressbook)};AddressBook.$findAll=function(data){var _this=this;if(data){this.$addressbooks=[];this.$subscriptions=[];this.$remotes=[];angular.forEach(data,function(o,i){var addressbook=new AddressBook(o);if(addressbook.isRemote)_this.$remotes.push(addressbook);else if(addressbook.isSubscription)_this.$subscriptions.push(addressbook);else _this.$addressbooks.push(addressbook)})}return _.union(this.$addressbooks,this.$subscriptions,this.$remotes)};AddressBook.$find=function(addressbookId){var futureAddressBookData=AddressBook.$Preferences.ready().then(function(){return AddressBook.$$resource.fetch(addressbookId,"view",AddressBook.$query)});return new AddressBook(futureAddressBookData)};AddressBook.$subscribe=function(uid,path){var _this=this;return AddressBook.$$resource.userResource(uid).fetch(path,"subscribe").then(function(addressbookData){var addressbook=new AddressBook(addressbookData);if(_.isUndefined(_.find(_this.$subscriptions,function(o){return o.id==addressbookData.id}))){AddressBook.$add(addressbook)}return addressbook})};AddressBook.prototype.init=function(data,options){if(!this.$cards){this.$isLoading=true;this.$cards=[];this.cards=[]}angular.extend(this,data);this.isOwned=AddressBook.activeUser.isSuperUser||this.owner==AddressBook.activeUser.login;this.isSubscription=!this.isRemote&&this.owner!=AddressBook.activeUser.login};AddressBook.prototype.$id=function(){if(this.id){return AddressBook.$q.when(this.id)}else{return this.$futureAddressBookData.then(function(addressbook){return addressbook.id})}};AddressBook.prototype.isSelectedCard=function(cardId){return this.selectedCard==cardId};AddressBook.prototype.$selectedCount=function(){var count;count=0;if(this.cards){count=_.filter(this.cards,function(card){return card.selected}).length}return count};AddressBook.prototype.$startRefreshTimeout=function(){var _this=this;if(AddressBook.$refreshTimeout)AddressBook.$timeout.cancel(AddressBook.$refreshTimeout);AddressBook.$Preferences.ready().then(function(){var refreshViewCheck=AddressBook.$Preferences.defaults.SOGoRefreshViewCheck;if(refreshViewCheck&&refreshViewCheck!="manually"){var f=angular.bind(_this,AddressBook.prototype.$relLine truncated
|
||||
//# sourceMappingURL=Contacts.services.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(a,b,c,d,e){function f(){return e.login(h.creds).then(function(a){window.location.href===a?window.location.reload(!0):window.location.href=a},function(a){c.alert(l("Authentication Failed"),a.error)}),!1}function g(a){function b(a){this.closeDialog=function(){a.hide()}}d.show({targetEvent:a,templateUrl:"aboutBox.html",controller:b,controllerAs:"about"}),b.$inject=["$mdDialog"]}var h=this;h.creds={username:cookieUsername,password:null},h.login=f,h.showAbout=g,h.showLogin=!1,b(function(){h.showLogin=!0},100)}angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]),a.$inject=["$scope","$timeout","Dialog","$mdDialog","Authentication"],angular.module("SOGo.MainUI").controller("LoginController",a)}();
|
||||
(function(){"use strict";angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]);LoginController.$inject=["$scope","$timeout","Dialog","$mdDialog","Authentication"];function LoginController($scope,$timeout,Dialog,$mdDialog,Authentication){var vm=this;vm.creds={username:cookieUsername,password:null};vm.login=login;vm.showAbout=showAbout;vm.showLogin=false;$timeout(function(){vm.showLogin=true},100);function login(){Authentication.login(vm.creds).then(function(url){if(window.location.href===url)window.location.reload(true);else window.location.href=url},function(msg){Dialog.alert(l("Authentication Failed"),msg.error)});return false}function showAbout($event){$mdDialog.show({targetEvent:$event,templateUrl:"aboutBox.html",controller:AboutDialogController,controllerAs:"about"});AboutDialogController.$inject=["$mdDialog"];function AboutDialogController($mdDialog){this.closeDialog=function(){$mdDialog.hide()}}}}angular.module("SOGo.MainUI").controller("LoginController",LoginController)})();
|
||||
//# sourceMappingURL=Main.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(a,c){a.state("preferences",{"abstract":!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}},resolve:{statePreferences:b}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),c.otherwise("/general")}function b(a){return a}function c(a){a.$on("$routeChangeError",function(a,b,c,d){console.error(a,b,c,d)})}angular.module("SOGo.PreferencesUI",["ui.router","ck","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication"]).config(a).run(c),a.$inject=["$stateProvider","$urlRouterProvider"],b.$inject=["Preferences"],c.$inject=["$rootScope"]}(),function(){"use strict";function a(a,b,c,d,e){function f(){return d>0?!1:!e}function g(){a.cancel()}function h(){a.hide()}var i=this;i.defaults=b,i.account=c,i.accountId=d,i.customFromIsReadonly=f,i.cancel=g,i.save=h}a.$inject=["$mdDialog","defaults","account","accountId","mailCustomFromEnabled"],angular.module("SOGo.PreferencesUI").controller("AccountDialogController",a)}(),function(){"use strict";function a(a,b,c,d,e,f){function g(){c.cancel()}function h(a){c.hide()}function i(a){n.filter.rules||(n.filter.rules=[]),n.filter.rules.push({field:"subject",operator:"contains"})}function j(a){n.filter.rules.splice(a,1)}function k(a){n.filter.actions||(n.filter.actions=[]),n.filter.actions.push({method:"discard"})}function m(a){n.filter.actions.splice(a,1)}var n=this,o=b.sieveCapabilities;n.filter=d,n.mailboxes=e,n.labels=f,n.cancel=g,n.save=h,n.addMailFilterRule=i,n.removeMailFilterRule=j,n.addMailFilterAction=k,n.removeMailFilterAction=m,n.fieldLabels={subject:l("Subject"),from:l("From"),to:l("To"),cc:l("Cc"),to_or_cc:l("To or Cc"),size:l("Size (Kb)"),header:l("Header")},o.indexOf("body")>-1&&(n.fieldLabels.body=l("Body")),n.methodLabels={discard:l("Discard the message"),keep:l("Keep the message"),redirect:l("Forward the message to"),vacation:l("Send a vacation message"),stop:l("Stop processing filter rules")},o.indexOf("reject")>-1&&(n.methodLabels.reject=l("Send a reject message")),o.indexOf("fileinto")>-1&&(n.methodLabels.fileinto=l("File the message in")),(o.indexOf("imapflags")>-1||o.indexOf("imap4flags")>-1)&&(n.methodLabels.addflag=l("Flag the message with")),n.numberOperatorLabels={under:l("is under"),over:l("is over")},n.textOperatorLabels={is:l("is"),is_not:l("is not"),contains:l("contains"),contains_not:l("does not contain"),matches:l("matches"),matches_not:l("does not match")},o.indexOf("regex")>-1&&(n.textOperatorLabels.regex=l("matches regex"),n.textOperatorLabels.regex_not=l("does not match regex")),n.flagLabels={seen:l("Seen"),deleted:l("Deleted"),answered:l("Answered"),flagged:l("Flagged"),junk:l("Junk"),not_junk:l("Not Junk")}}a.$inject=["$scope","$window","$mdDialog","filter","mailboxes","labels"],angular.module("SOGo.PreferencesUI").controller("FiltersDialogController",a)}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,m,n){function o(a){d("xs")&&e("left").close(),c.go("preferences."+a)}function p(){i.confirm(l("Warning"),l("Save preferences and reload page now?"),{ok:l("Yes"),cancel:l("No")}).then(function(){D().then(function(){b.location.reload(!0)})})}function q(){I.preferences.defaults.SOGoCalendarCategoriesColors["New category"]="#aaa",I.preferences.defaults.SOGoCalendarCategories.push("New category"),h("calendarCategory_"+(I.preferences.defaults.SOGoCalendarCategories.length-1))}function r(a){var b=I.preferences.defaults.SOGoCalendarCategories[a];I.preferences.defaults.SOGoCalendarCategories.splice(a,1),delete I.preferences.defaults.SOGoCalendarCategoriesColors[b]}function s(){I.preferences.defaults.SOGoContactsCategories.push(""),h("contactCategory_"+(I.preferences.defaults.SOGoContactsCategories.length-1))}function t(a){I.preferences.defaults.SOGoContactsCategories.splice(a,1)}function u(a){var b;I.preferences.defaults.AuxiliaryMailAccounts.push({}),b=_.last(I.preferences.defaults.AuxiliaryMailAccounts),b.name=l("New account"),b.identities=[{fullName:"",email:""}],b.receipts={receiptAction:"ignore",receiptNonRecipientAction:"ignore",receiptOutsideDomainAction:"ignore",receiptAnyAction:"ignore"},f.show({controller:"AccountDialogController",controllerAs:"$AccountDialogController",templateUrl:"editAccount?account=new",targetEvent:a,locals:{defaults:I.preferences.defaults,account:b,accountId:I.preferences.defaults.AuxiliaryMailAccounts.length-1,mailCustomFromEnabled:window.mailCustomFromEnabled}})}function v(a,b){var c=I.preferences.defaults.AuxiliaryMailAccounts[b];f.show({controller:"AccountDialogController",controllerAs:"$AccountDialogController",templateUrl:"editAccount?accoLine truncated
|
||||
(function(){"use strict";angular.module("SOGo.PreferencesUI",["ui.router","ck","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication"]).config(configure).run(runBlock);configure.$inject=["$stateProvider","$urlRouterProvider"];function configure($stateProvider,$urlRouterProvider){$stateProvider.state("preferences",{"abstract":true,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}},resolve:{statePreferences:statePreferences}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}});$urlRouterProvider.otherwise("/general")}statePreferences.$inject=["Preferences"];function statePreferences(Preferences){return Preferences}runBlock.$inject=["$rootScope"];function runBlock($rootScope){$rootScope.$on("$routeChangeError",function(event,current,previous,rejection){console.error(event,current,previous,rejection)})}})();(function(){"use strict";AccountDialogController.$inject=["$mdDialog","defaults","account","accountId","mailCustomFromEnabled"];function AccountDialogController($mdDialog,defaults,account,accountId,mailCustomFromEnabled){var vm=this;vm.defaults=defaults;vm.account=account;vm.accountId=accountId;vm.customFromIsReadonly=customFromIsReadonly;vm.cancel=cancel;vm.save=save;function customFromIsReadonly(){if(accountId>0)return false;return!mailCustomFromEnabled}function cancel(){$mdDialog.cancel()}function save(){$mdDialog.hide()}}angular.module("SOGo.PreferencesUI").controller("AccountDialogController",AccountDialogController)})();(function(){"use strict";FiltersDialogController.$inject=["$scope","$window","$mdDialog","filter","mailboxes","labels"];function FiltersDialogController($scope,$window,$mdDialog,filter,mailboxes,labels){var vm=this,sieveCapabilities=$window.sieveCapabilities;vm.filter=filter;vm.mailboxes=mailboxes;vm.labels=labels;vm.cancel=cancel;vm.save=save;vm.addMailFilterRule=addMailFilterRule;vm.removeMailFilterRule=removeMailFilterRule;vm.addMailFilterAction=addMailFilterAction;vm.removeMailFilterAction=removeMailFilterAction;vm.fieldLabels={subject:l("Subject"),from:l("From"),to:l("To"),cc:l("Cc"),to_or_cc:l("To or Cc"),size:l("Size (Kb)"),header:l("Header")};if(sieveCapabilities.indexOf("body")>-1)vm.fieldLabels.body=l("Body");vm.methodLabels={discard:l("Discard the message"),keep:l("Keep the message"),redirect:l("Forward the message to"),vacation:l("Send a vacation message"),stop:l("Stop processing filter rules")};if(sieveCapabilities.indexOf("reject")>-1)vm.methodLabels.reject=l("Send a reject message");if(sieveCapabilities.indexOf("fileinto")>-1)vm.methodLabels.fileinto=l("File the message in");if(sieveCapabilities.indexOf("imapflags")>-1||sieveCapabilities.indexOf("imap4flags")>-1)vm.methodLabels.addflag=l("Flag the message with");vm.numberOperatorLabels={under:l("is under"),over:l("is over")};vm.textOperatorLabels={is:l("is"),is_not:l("is not"),contains:l("contains"),contains_not:l("does not contain"),matches:l("matches"),matches_not:l("does not match")};if(sieveCapabilities.indexOf("regex")>-1){vm.textOperatorLabels.regex=l("matches regex");vm.textOperatorLabels.regex_not=l("does not match regex")}vm.flagLabels={seen:l("Seen"),deleted:l("Deleted"),answered:l("Answered"),flagged:l("Flagged"),junk:l("Junk"),not_junk:l("Not Junk")};function cancel(){$mdDialog.cancel()}function save(form){$mdDialog.hide()}function addMailFilterRule(event){if(!vm.filter.rules)vm.filter.rules=[];vm.filter.rules.push({field:"subject",operator:"contains"})}function removeMailFilterRule(index){vm.filter.rules.splice(index,1)}function addMailFilterAction(event){if(!vm.filter.actions)vm.filter.actions=[];vm.filter.actions.push({method:"discard"})}function removeMailFilterAction(index){vm.filter.actions.splice(index,1)}}angular.module("SOGo.PreferencesUI").controller("FiltersDialogController",FiltersDialogController)})();(function(){"use strict";PreferencesController.$inject=["$q","$window","$state","$mdMedia","$mdSidenav","$mdDialog","$mdToast","sgFocus","Dialog","User","Account","statePreferences","Authentication"];function PreferencesController($q,$window,$state,$mdMedia,$mdSidenav,$mdDialog,$mdToast,focus,Dialog,User,Account,statePreferences,Authentication){var vm=this,account,mailboxes=[];vm.preferences=statePreferences;vm.passwords={newPassword:null,newPasswordConfirmation:null};vm.go=go;vm.onLanguageChange=onLanguageChange;vm.addCalendarCategory=addCalendarCategory;vm.removeCalendarCategory=removeCalendarCategory;vm.addContactCategory=addContactCategory;vm.removeContactCategory=removeContactCategory;vm.addMailAccount=addMailAccount;vm.editMailAccount=editMailAccount;vm.removeLine truncated
|
||||
//# sourceMappingURL=Preferences.js.map
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function a(b){if(this.init(b),this.name&&!this.id){var c=a.$$resource.create("createFolder",this.name);this.$unwrap(c)}this.id&&(this.$acl=new a.$$Acl("Calendar/"+this.id))}a.$factory=["$q","$timeout","$log","sgSettings","Resource","Preferences","Component","Acl",function(b,c,d,e,f,g,h,i){return angular.extend(a,{$q:b,$timeout:c,$log:d,$$resource:new f(e.activeUser("folderURL")+"Calendar",e.activeUser()),$Preferences:g,$Component:h,$$Acl:i,activeUser:e.activeUser(),$view:null}),a}];try{angular.module("SOGo.SchedulerUI")}catch(b){angular.module("SOGo.SchedulerUI",["SOGo.Common"])}angular.module("SOGo.SchedulerUI").value("CalendarSettings",{EventDragDayLength:96,EventDragHorizontalOffset:3}).factory("Calendar",a.$factory),a.$defaultCalendar=function(){var b,c=a.$Preferences.defaults.SOGoDefaultCalendar;return"first"==c&&(b=_.find(a.$findAll(null,!0),function(a){return a.active}))?b.id:"personal"},a.$add=function(a){var b,c,d;b=a.isWebCalendar?this.$webcalendars:a.isSubscription?this.$subscriptions:this.$calendars,c=_.find(b,function(b){return"personal"!=b.id&&1===b.name.localeCompare(a.name)}),d=c?_.indexOf(_.pluck(b,"id"),c.id):1,b.splice(d,0,a)},a.$findAll=function(b,c){var d=this;return b&&(this.$calendars=[],this.$subscriptions=[],this.$webcalendars=[],angular.forEach(b,function(b,c){var e=new a(b);e.isWebCalendar?d.$webcalendars.push(e):e.isSubscription?d.$subscriptions.push(e):d.$calendars.push(e)})),c?_.union(this.$calendars,_.filter(this.$subscriptions,function(a){return a.acls.objectCreator})):_.union(this.$calendars,this.$subscriptions,this.$webcalendars)},a.$get=function(b){var c;return c=_.find(a.$calendars,function(a){return a.id==b}),c||(c=_.find(a.$subscriptions,function(a){return a.id==b})),c||(c=_.find(a.$webcalendars,function(a){return a.id==b})),c},a.$getIndex=function(b){var c;return c=_.indexOf(_.pluck(a.$calendars,"id"),b),0>c&&(c=_.indexOf(_.pluck(a.$subscriptions,"id"),b)),0>c&&(c=_.indexOf(_.pluck(a.$webcalendars,"id"),b)),c},a.$subscribe=function(b,c){var d=this;return a.$$resource.userResource(b).fetch(c,"subscribe").then(function(b){var c=new a(b);return _.find(d.$subscriptions,function(a){return a.id==b.id})||a.$add(c),c})},a.$addWebCalendar=function(b){var c=this,d=a.$q.defer();return _.find(c.$webcalendars,function(a){return a.urls.webCalendarURL==b})?d.reject():a.$$resource.post(null,"addWebCalendar",{url:b}).then(function(c){angular.extend(c,{isWebCalendar:!0,isEditable:!0,isRemote:!1,owner:a.activeUser.login,urls:{webCalendarURL:b}});var e=new a(c);a.$add(e),a.$$resource.fetch(e.id,"reload").then(function(b){a.$log.debug(JSON.stringify(b,void 0,2))}),d.resolve()},function(){d.reject()}),d.promise},a.$deleteComponents=function(b){var c={},d=this;_.forEach(b,function(a){angular.isDefined(c[a.c_folder])||(c[a.c_folder]=[]),c[a.c_folder].push(a.c_name)}),_.forEach(c,function(b,c){a.$$resource.post(c,"batchDelete",{uids:b})}),d.$Component.$events=_.difference(d.$Component.$events,b),d.$Component.$tasks=_.difference(d.$Component.$tasks,b)},a.prototype.init=function(b){this.color=this.color||"#AAAAAA",angular.extend(this,b),this.isOwned=a.activeUser.isSuperUser||this.owner==a.activeUser.login,this.isSubscription=!this.isRemote&&this.owner!=a.activeUser.login,angular.isUndefined(this.$shadowData)&&(this.$shadowData=this.$omit())},a.prototype.$id=function(){return this.id?a.$q.when(this.id):this.$futureCalendarData.then(function(a){return a.id})},a.prototype.getClassName=function(a){return angular.isUndefined(a)&&(a="fg"),a+"-folder"+this.id},a.prototype.$rename=function(){var b,c,d=this;return this.name==this.$shadowData.name?a.$q.when():(c=this.isWebCalendar?a.$webcalendars:this.isSubscription?a.$subscriptions:a.$calendars,b=_.indexOf(_.pluck(c,"id"),this.id),b>-1?this.$save().then(function(){c.splice(b,1),a.$add(d)}):a.$q.reject())},a.prototype.$delete=function(){var b,c,d=this;return this.isSubscription?(c=a.$$resource.fetch(this.id,"unsubscribe"),b=a.$subscriptions):(c=a.$$resource.remove(this.id),b=this.isWebCalendar?a.$webcalendars:a.$calendars),c.then(function(){var a=_.indexOf(_.pluck(b,"id"),d.id);b.splice(a,1)})},a.prototype.$reset=function(){var a=this;angular.forEach(this,function(b,c){"constructor"!=c&&"$"!=c[0]&&delete a[c]}),angular.extend(this,this.$shadowData),this.$shadowData=this.$omit()},a.prototype.$save=function(){var b=this;return a.$$resource.save(this.id,this.$omit()).then(function(a){return b.$shadowData=b.$omit(),a},function(c){return a.$log.error(JSON.stringify(c,void 0,2)),b.$reset(),c})},a.prototype.$setActivation=function(){return a.$$resource.fetch(this.id,(this.active?"":"de")+"activateFolder")},a.prototype.$getComponent=function(b,c){return a.$Component.$find(this.id,b,c)},a.prototype.$unwrap=function(b){var c=this;this.$futureCalendarData=b.then(function(b){return a.$timeout(function(){return c.init(b),c})},function(b){c.isError=!0,angular.isObject(b)&&a.$timeout(function(){angular.extend(c,b)})})},a.prototype.$omit=functioLine truncated
|
||||
(function(){"use strict";function Calendar(futureCalendarData){this.init(futureCalendarData);if(this.name&&!this.id){var newCalendarData=Calendar.$$resource.create("createFolder",this.name);this.$unwrap(newCalendarData)}if(this.id){this.$acl=new Calendar.$$Acl("Calendar/"+this.id)}}Calendar.$factory=["$q","$timeout","$log","sgSettings","Resource","Preferences","Component","Acl",function($q,$timeout,$log,Settings,Resource,Preferences,Component,Acl){angular.extend(Calendar,{$q:$q,$timeout:$timeout,$log:$log,$$resource:new Resource(Settings.activeUser("folderURL")+"Calendar",Settings.activeUser()),$Preferences:Preferences,$Component:Component,$$Acl:Acl,activeUser:Settings.activeUser(),$view:null});return Calendar}];try{angular.module("SOGo.SchedulerUI")}catch(e){angular.module("SOGo.SchedulerUI",["SOGo.Common"])}angular.module("SOGo.SchedulerUI").value("CalendarSettings",{EventDragDayLength:24*4,EventDragHorizontalOffset:3}).factory("Calendar",Calendar.$factory);Calendar.$defaultCalendar=function(){var defaultCalendar=Calendar.$Preferences.defaults.SOGoDefaultCalendar,calendar;if(defaultCalendar=="first"){calendar=_.find(Calendar.$findAll(null,true),function(calendar){return calendar.active});if(calendar)return calendar.id}return"personal"};Calendar.$add=function(calendar){var list,sibling,i;if(calendar.isWebCalendar)list=this.$webcalendars;else if(calendar.isSubscription)list=this.$subscriptions;else list=this.$calendars;sibling=_.find(list,function(o){return o.id!="personal"&&o.name.localeCompare(calendar.name)===1});i=sibling?_.indexOf(_.pluck(list,"id"),sibling.id):1;list.splice(i,0,calendar)};Calendar.$findAll=function(data,writable){var _this=this;if(data){this.$calendars=[];this.$subscriptions=[];this.$webcalendars=[];angular.forEach(data,function(o,i){var calendar=new Calendar(o);if(calendar.isWebCalendar)_this.$webcalendars.push(calendar);else if(calendar.isSubscription)_this.$subscriptions.push(calendar);else _this.$calendars.push(calendar)})}if(writable){return _.union(this.$calendars,_.filter(this.$subscriptions,function(calendar){return calendar.acls.objectCreator}))}return _.union(this.$calendars,this.$subscriptions,this.$webcalendars)};Calendar.$get=function(id){var calendar;calendar=_.find(Calendar.$calendars,function(o){return o.id==id});if(!calendar)calendar=_.find(Calendar.$subscriptions,function(o){return o.id==id});if(!calendar)calendar=_.find(Calendar.$webcalendars,function(o){return o.id==id});return calendar};Calendar.$getIndex=function(id){var i;i=_.indexOf(_.pluck(Calendar.$calendars,"id"),id);if(i<0)i=_.indexOf(_.pluck(Calendar.$subscriptions,"id"),id);if(i<0)i=_.indexOf(_.pluck(Calendar.$webcalendars,"id"),id);return i};Calendar.$subscribe=function(uid,path){var _this=this;return Calendar.$$resource.userResource(uid).fetch(path,"subscribe").then(function(calendarData){var calendar=new Calendar(calendarData);if(!_.find(_this.$subscriptions,function(o){return o.id==calendarData.id})){Calendar.$add(calendar)}return calendar})};Calendar.$addWebCalendar=function(url){var _this=this,d=Calendar.$q.defer();if(_.find(_this.$webcalendars,function(o){return o.urls.webCalendarURL==url})){d.reject()}else{Calendar.$$resource.post(null,"addWebCalendar",{url:url}).then(function(calendarData){angular.extend(calendarData,{isWebCalendar:true,isEditable:true,isRemote:false,owner:Calendar.activeUser.login,urls:{webCalendarURL:url}});var calendar=new Calendar(calendarData);Calendar.$add(calendar);Calendar.$$resource.fetch(calendar.id,"reload").then(function(data){Calendar.$log.debug(JSON.stringify(data,undefined,2))});d.resolve()},function(){d.reject()})}return d.promise};Calendar.$deleteComponents=function(components){var calendars={},_this=this;_.forEach(components,function(component){if(!angular.isDefined(calendars[component.c_folder]))calendars[component.c_folder]=[];calendars[component.c_folder].push(component.c_name)});_.forEach(calendars,function(uids,c_folder){Calendar.$$resource.post(c_folder,"batchDelete",{uids:uids})});_this.$Component.$events=_.difference(_this.$Component.$events,components);_this.$Component.$tasks=_.difference(_this.$Component.$tasks,components)};Calendar.prototype.init=function(data){this.color=this.color||"#AAAAAA";angular.extend(this,data);this.isOwned=Calendar.activeUser.isSuperUser||this.owner==Calendar.activeUser.login;this.isSubscription=!this.isRemote&&this.owner!=Calendar.activeUser.login;if(angular.isUndefined(this.$shadowData)){this.$shadowData=this.$omit()}};Calendar.prototype.$id=function(){if(this.id){return Calendar.$q.when(this.id)}else{return this.$futureCalendarData.then(function(calendar){return calendar.id})}};Calendar.prototype.getClassName=function(base){if(angular.isUndefined(base))base="fg";return base+"-folder"+this.id};Calendar.prototype.$rename=function(){var _this=this,i,calendars;if(this.name==this.$shadowData.name){return Calendar.$q.when()}if(this.isWebCalendar)calendars=Calendar.$webcalendars;else if(this.isSubscription)calendars=Calendar.$suLine truncated
|
||||
//# sourceMappingURL=Scheduler.services.js.map
|
||||
Reference in new issue
Block a user