1 line
56 KiB
Plaintext
1 line
56 KiB
Plaintext
{"version":3,"sources":["Contacts/Contacts.app.js","Contacts/AddressBookController.js","Contacts/AddressBooksController.js","Contacts/CardController.js","Contacts/sgAddress.directive.js"],"names":["configure","$stateProvider","$urlRouterProvider","state","url","abstract","views","addressbooks","templateUrl","controller","controllerAs","resolve","stateAddressbooks","addressbook","stateAddressbook","card","stateCard","stateNewCard","template","onEnter","onEnterCard","onExit","onExitCard","card@app.addressbook","otherwise","AddressBook","$findAll","window","contactFolders","$q","$state","$stateParams","_","find","id","addressbookId","selectedCard","$reload","reject","Card","tag","contactType","pid","c_component","$cards","cardObject","cardId","go","stateMailbox","runBlock","$rootScope","$log","$on","event","toState","toParams","fromState","fromParams","error","current","previous","rejection","angular","module","config","run","$inject","AddressBookController","$scope","$window","$timeout","$mdDialog","$mdToast","Account","focus","Dialog","Settings","sgHotkeys","_registerHotkeys","keys","push","createHotkey","key","l","description","callback","searchMode","bind","vm","newComponent","toggleCardSelection","_nextCard","_previousCard","_addNextCardToSelection","_addPreviousCardToSelection","confirmDeleteSelectedCards","forEach","registerHotkey","selectCard","$event","selectedFolder","$selectedCard","selected","mode","multiple","preventDefault","stopPropagation","type","unselectCards","index","$selectedCardIndex","isDefined","$topIndex","length","getLength","hasSelectedCard","selectedCards","$selectedCards","size","confirm","ok","then","$deleteCards","_selectedCardsOperation","operation","dstId","srcFolder","allCards","cards","ids","clearCardView","promise","success","filter","$isCard","show","simple","content","position","hideDelay","$copyCards","$moveCards","map","indexOf","copySelectedCards","folder","moveSelectedCards","selectAll","sort","field","$filter","sortedBy","$query","search","cancelSearch","newMessage","recipients","accounts","account","o","$getMailboxes","mailboxes","$newMessage","message","extend","editable","to","parent","element","document","body","targetEvent","clickOutsideToClose","escapeToClose","locals","stateAccount","stateMessage","newMessageWithRecipient","recipient","fn","newMessageWithSelectedCards","promises","$isList","expandable","refs","ref","email","$shortFormat","c_mail","all","uniq","this","hotkeys","service","deregisterHotkey","AddressBooksController","$mdMedia","$mdSidenav","FileUploader","sgConstant","User","confirmDelete","select","params","editMode","value","close","newAddressbook","prompt","name","isEditable","isRemote","owner","UserLogin","$add","edit","originalAddressbook","$omit","revertEditing","save","$rename","data","status","alert","isSubscription","$delete","catch","response","statusText","importCards","CardsImportDialogController","scope","filterByExtension","item","isTextFile","test","join","uploader","ApplicationBaseURL","autoUpload","queueLimit","filters","onSuccessItem","headers","msg","hide","imported","onErrorItem","showLinks","LinksDialogController","urls","when","$reloadAll","showProperties","PropertiesDialogController","srcAddressBook","saveProperties","$save","init","cancel","share","$acl","$users","usersWithACL","users","subscribeToFolder","addressbookData","console","debug","$subscribe","isDroppableFolder","dstFolder","isOwned","acls","objectCreator","dragSelectedCards","activeUser","CardController","sgSettings","currentFolder","$selectedCount","transformCategory","input","isString","addOrgUnit","i","$addOrgUnit","addBirthday","birthday","Date","addScreenName","$addScreenName","addEmail","$addEmail","addPhone","$addPhone","addUrl","$addUrl","addAddress","$addAddress","userFilter","excludedCards","minimumSearchLength","dry","excludeLists","form","$valid","copy","reset","$reset","isNew","$fullname","toggleRawSource","showRawSource","rawSource","$$resource","post","allEmailTypes","$EMAIL_TYPES","allTelTypes","$TEL_TYPES","allUrlTypes","$URL_TYPES","allAddressTypes","$ADDRESS_TYPES","categories","userFilterResults","sgAddress","restrict","addressLines","lines","locality_region","street","street2","locality","region","country","postalcode","directive"],"mappings":"CAGA,WACE,YAUA,SAASA,GAAUC,EAAgBC,GACjCD,EACGE,MAAM,OACLC,IAAK,gBACLC,UAAU,EACVC,OACEC,cACEC,YAAa,wBACbC,WAAY,yBACZC,aAAc,QAGlBC,SACEC,kBAAmBA,KAGtBT,MAAM,mBACLC,IAAK,kBACLE,OACEO,aACEL,YAAa,cACbC,WAAY,wBACZC,aAAc,gBAGlBC,SACEG,iBAAkBA,KAGrBX,MAAM,uBACLC,IAAK,mCACLE,OACES,MACEP,YAAa,2BACbC,WAAY,iBACZC,aAAc,WAGlBC,SACEK,UAAWC,KAGdd,MAAM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G,OAASV,KAAM,cACfpN,YAAa,SAAU,SAAS2D,GAC9BA,EAAOqQ,aAAe,SAAS5G,GAC7B,GAAI6G,MACAC,IAQJ,OAPI9G,GAAK+G,QAAQF,EAAM1P,KAAK6I,EAAK+G,QAC7B/G,EAAKgH,SAASH,EAAM1P,KAAK6I,EAAKgH,SAC9BhH,EAAKiH,UAAUH,EAAgB3P,KAAK6I,EAAKiH,UACzCjH,EAAKkH,QAAQJ,EAAgB3P,KAAK6I,EAAKkH,QACvCJ,EAAgB1N,OAAS,GAAGyN,EAAM1P,KAAK2P,EAAgB/F,KAAK,OAC5Df,EAAKmH,SAASN,EAAM1P,KAAK6I,EAAKmH,SAC9BnH,EAAKoH,YAAYP,EAAM1P,KAAK6I,EAAKoH,YAC9BP,EAAM9F,KAAK,WAGtB1N,SAAU,yDAId4C,QACGC,OAAO,eACPmR,UAAU,YAAaX","file":"Contacts.js","sourcesContent":["/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for SOGoContacts */\n\n(function() {\n 'use strict';\n\n angular.module('SOGo.ContactsUI', ['ngCookies', 'ui.router', 'angularFileUpload', 'ck', 'SOGo.Common', 'SOGo.PreferencesUI', 'SOGo.MailerUI'])\n .config(configure)\n .run(runBlock);\n\n /**\n * @ngInject\n */\n configure.$inject = ['$stateProvider', '$urlRouterProvider'];\n function configure($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('app', {\n url: '/addressbooks',\n abstract: true,\n views: {\n addressbooks: {\n templateUrl: 'UIxContactFoldersView', // UI/Templates/Contacts/UIxContactFoldersView.wox\n controller: 'AddressBooksController',\n controllerAs: 'app'\n }\n },\n resolve: {\n stateAddressbooks: stateAddressbooks\n }\n })\n .state('app.addressbook', {\n url: '/:addressbookId',\n views: {\n addressbook: {\n templateUrl: 'addressbook',\n controller: 'AddressBookController',\n controllerAs: 'addressbook'\n }\n },\n resolve: {\n stateAddressbook: stateAddressbook\n }\n })\n .state('app.addressbook.new', {\n url: '/{contactType:(?:card|list)}/new',\n views: {\n card: {\n templateUrl: 'UIxContactEditorTemplate', // UI/Templates/Contacts/UIxContactEditorTemplate.wox\n controller: 'CardController',\n controllerAs: 'editor'\n }\n },\n resolve: {\n stateCard: stateNewCard\n }\n })\n .state('app.addressbook.card', {\n url: '/:cardId',\n abstract: true,\n views: {\n card: {\n template: '<ui-view/>'\n }\n },\n resolve: {\n stateCard: stateCard\n },\n onEnter: onEnterCard,\n onExit: onExitCard\n })\n .state('app.addressbook.card.view', {\n url: '/view',\n views: {\n 'card@app.addressbook': {\n templateUrl: 'UIxContactViewTemplate', // UI/Templates/Contacts/UIxContactViewTemplate.wox\n controller: 'CardController',\n controllerAs: 'editor'\n }\n }\n })\n .state('app.addressbook.card.editor', {\n url: '/edit',\n views: {\n 'card@app.addressbook': {\n templateUrl: 'UIxContactEditorTemplate', // UI/Templates/Contacts/UIxContactEditorTemplate.wox\n controller: 'CardController',\n controllerAs: 'editor'\n }\n }\n });\n\n // if none of the above states are matched, use this as the fallback\n $urlRouterProvider.otherwise('/addressbooks/personal');\n }\n\n /**\n * @ngInject\n */\n stateAddressbooks.$inject = ['AddressBook'];\n function stateAddressbooks(AddressBook) {\n return AddressBook.$findAll(window.contactFolders);\n }\n\n /**\n * @ngInject\n */\n stateAddressbook.$inject = ['$q', '$state', '$stateParams', 'AddressBook'];\n function stateAddressbook($q, $state, $stateParams, AddressBook) {\n var addressbook = _.find(AddressBook.$findAll(), function(addressbook) {\n return addressbook.id == $stateParams.addressbookId;\n });\n if (addressbook) {\n delete addressbook.selectedCard;\n addressbook.$reload();\n return addressbook;\n }\n return $q.reject('Addressbook ' + $stateParams.addressbookId + ' not found');\n }\n\n /**\n * @ngInject\n */\n stateNewCard.$inject = ['$stateParams', 'stateAddressbook', 'Card'];\n function stateNewCard($stateParams, stateAddressbook, Card) {\n var tag = 'v' + $stateParams.contactType,\n card = new Card({ pid: $stateParams.addressbookId, c_component: tag });\n stateAddressbook.selectedCard = true;\n return card;\n }\n\n /**\n * @ngInject\n */\n stateCard.$inject = ['$state', '$stateParams', 'stateAddressbook'];\n function stateCard($state, $stateParams, stateAddressbook) {\n var card;\n\n card = _.find(stateAddressbook.$cards, function(cardObject) {\n return (cardObject.id == $stateParams.cardId);\n });\n\n if (card) {\n return card.$reload();\n }\n else {\n // Card not found\n $state.go('app.addressbook');\n }\n }\n\n /**\n * @ngInject\n */\n onEnterCard.$inject = ['$stateParams', 'stateAddressbook'];\n function onEnterCard($stateParams, stateAddressbook) {\n stateAddressbook.selectedCard = $stateParams.cardId;\n }\n\n /**\n * @ngInject\n */\n onExitCard.$inject = ['stateAddressbook'];\n function onExitCard(stateMailbox) {\n delete stateAddressbook.selectedCard;\n }\n\n /**\n * @ngInject\n */\n runBlock.$inject = ['$rootScope', '$log', '$state'];\n function runBlock($rootScope, $log, $state) {\n $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {\n $log.error(error);\n $state.go('app.addressbook', { addressbookId: 'personal' });\n });\n $rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {\n $log.error(event, current, previous, rejection);\n });\n }\n\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'sgFocus', 'Dialog', 'sgSettings', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook'];\n function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, focus, Dialog, Settings, sgHotkeys, stateAddressbooks, stateAddressbook) {\n var vm = this, hotkeys = [];\n\n AddressBook.selectedFolder = stateAddressbook;\n\n vm.service = AddressBook;\n vm.selectedFolder = stateAddressbook;\n vm.selectCard = selectCard;\n vm.toggleCardSelection = toggleCardSelection;\n vm.newComponent = newComponent;\n vm.unselectCards = unselectCards;\n vm.confirmDeleteSelectedCards = confirmDeleteSelectedCards;\n vm.copySelectedCards = copySelectedCards;\n vm.moveSelectedCards = moveSelectedCards;\n vm.selectAll = selectAll;\n vm.sort = sort;\n vm.sortedBy = sortedBy;\n vm.searchMode = searchMode;\n vm.cancelSearch = cancelSearch;\n vm.newMessage = newMessage;\n vm.newMessageWithSelectedCards = newMessageWithSelectedCards;\n vm.newMessageWithRecipient = newMessageWithRecipient;\n vm.mode = { search: false, multiple: 0 };\n\n\n _registerHotkeys(hotkeys);\n\n $scope.$on('$destroy', function() {\n // Deregister hotkeys\n _.forEach(hotkeys, function(key) {\n sgHotkeys.deregisterHotkey(key);\n });\n });\n\n\n function _registerHotkeys(keys) {\n keys.push(sgHotkeys.createHotkey({\n key: l('hotkey_search'),\n description: l('Search'),\n callback: searchMode\n }));\n keys.push(sgHotkeys.createHotkey({\n key: l('key_create_card'),\n description: l('Create a new address book card'),\n callback: angular.bind(vm, newComponent, 'card')\n }));\n keys.push(sgHotkeys.createHotkey({\n key: l('key_create_list'),\n description: l('Create a new list'),\n callback: angular.bind(vm, newComponent, 'list')\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'space',\n description: l('Toggle item'),\n callback: toggleCardSelection\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'up',\n description: l('View next item'),\n callback: _nextCard\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'down',\n description: l('View previous item'),\n callback: _previousCard\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'shift+up',\n description: l('Add next item to selection'),\n callback: _addNextCardToSelection\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'shift+down',\n description: l('Add previous item to selection'),\n callback: _addPreviousCardToSelection\n }));\n keys.push(sgHotkeys.createHotkey({\n key: 'backspace',\n description: l('Delete selected card or address book'),\n callback: confirmDeleteSelectedCards\n }));\n\n // Register the hotkeys\n _.forEach(keys, function(key) {\n sgHotkeys.registerHotkey(key);\n });\n }\n\n function selectCard(card) {\n $state.go('app.addressbook.card.view', {cardId: card.id});\n }\n\n function toggleCardSelection($event, card) {\n if (!card) card = vm.selectedFolder.$selectedCard();\n card.selected = !card.selected;\n vm.mode.multiple += card.selected? 1 : -1;\n $event.preventDefault();\n $event.stopPropagation();\n }\n\n function newComponent(type) {\n $state.go('app.addressbook.new', { contactType: type });\n }\n\n function unselectCards() {\n _.forEach(vm.selectedFolder.$cards, function(card) {\n card.selected = false;\n });\n vm.mode.multiple = 0;\n }\n\n /**\n * User has pressed up arrow key\n */\n function _nextCard($event) {\n var index = vm.selectedFolder.$selectedCardIndex();\n\n if (angular.isDefined(index)) {\n index--;\n if (vm.selectedFolder.$topIndex > 0)\n vm.selectedFolder.$topIndex--;\n }\n else {\n // No message is selected, show oldest message\n index = vm.selectedFolder.$cards.length() - 1;\n vm.selectedFolder.$topIndex = vm.selectedFolder.getLength();\n }\n\n if (index > -1)\n selectCard(vm.selectedFolder.$cards[index]);\n\n $event.preventDefault();\n\n return index;\n }\n\n /**\n * User has pressed the down arrow key\n */\n function _previousCard($event) {\n var index = vm.selectedFolder.$selectedCardIndex();\n\n if (angular.isDefined(index)) {\n index++;\n if (vm.selectedFolder.$topIndex < vm.selectedFolder.$cards.length)\n vm.selectedFolder.$topIndex++;\n }\n else\n // No message is selected, show newest\n index = 0;\n\n if (index < vm.selectedFolder.$cards.length)\n selectCard(vm.selectedFolder.$cards[index]);\n else\n index = -1;\n\n $event.preventDefault();\n\n return index;\n }\n\n function _addNextCardToSelection($event) {\n var index;\n\n if (vm.selectedFolder.hasSelectedCard()) {\n index = _nextCard($event);\n if (index >= 0)\n toggleCardSelection($event, vm.selectedFolder.$cards[index]);\n }\n }\n\n function _addPreviousCardToSelection($event) {\n var index;\n\n if (vm.selectedFolder.hasSelectedCard()) {\n index = _previousCard($event);\n if (index >= 0)\n toggleCardSelection($event, vm.selectedFolder.$cards[index]);\n }\n }\n\n function confirmDeleteSelectedCards($event) {\n var selectedCards = vm.selectedFolder.$selectedCards();\n\n if (_.size(selectedCards) > 0)\n Dialog.confirm(l('Warning'),\n l('Are you sure you want to delete the selected contacts?'),\n { ok: l('Delete') })\n .then(function() {\n // User confirmed the deletion\n vm.selectedFolder.$deleteCards(selectedCards).then(function() {\n vm.mode.multiple = 0;\n if (!vm.selectedFolder.selectedCard)\n $state.go('app.addressbook');\n });\n });\n\n $event.preventDefault();\n }\n\n /**\n * @see AddressBooksController.dragSelectedCards\n */\n function _selectedCardsOperation(operation, dstId) {\n var srcFolder, allCards, cards, ids, clearCardView, promise, success;\n\n srcFolder = vm.selectedFolder;\n clearCardView = false;\n allCards = srcFolder.$selectedCards();\n cards = _.filter(allCards, function(card) {\n return card.$isCard();\n });\n\n if (cards.length != allCards.length)\n $mdToast.show(\n $mdToast.simple()\n .content(l(\"Lists can't be moved or copied.\"))\n .position('top right')\n .hideDelay(2000));\n\n if (cards.length) {\n if (operation == 'copy') {\n promise = srcFolder.$copyCards(cards, dstId);\n success = l('%{0} card(s) copied', cards.length);\n }\n else {\n promise = srcFolder.$moveCards(cards, dstId);\n success = l('%{0} card(s) moved', cards.length);\n // Check if currently displayed card will be moved\n ids = _.map(cards, 'id');\n clearCardView = (srcFolder.selectedCard && ids.indexOf(srcFolder.selectedCard) >= 0);\n }\n\n // Show success toast when action succeeds\n promise.then(function() {\n if (clearCardView)\n $state.go('app.addressbook');\n $mdToast.show(\n $mdToast.simple()\n .content(success)\n .position('top right')\n .hideDelay(2000));\n });\n }\n }\n\n function copySelectedCards(folder) {\n _selectedCardsOperation('copy', folder);\n }\n\n function moveSelectedCards(folder) {\n _selectedCardsOperation('move', folder);\n }\n\n function selectAll() {\n _.forEach(vm.selectedFolder.$cards, function(card) {\n card.selected = true;\n });\n vm.mode.multiple = vm.selectedFolder.$cards.length;\n }\n\n function sort(field) {\n vm.selectedFolder.$filter('', { sort: field });\n }\n\n function sortedBy(field) {\n return AddressBook.$query.sort == field;\n }\n\n function searchMode() {\n vm.mode.search = true;\n focus('search');\n }\n\n function cancelSearch() {\n vm.mode.search = false;\n vm.selectedFolder.$filter('');\n }\n\n function newMessage($event, recipients) {\n Account.$findAll().then(function(accounts) {\n var account = _.find(accounts, function(o) {\n if (o.id === 0)\n return o;\n });\n\n // We must initialize the Account with its mailbox\n // list before proceeding with message's creation\n account.$getMailboxes().then(function(mailboxes) {\n account.$newMessage().then(function(message) {\n angular.extend(message.editable, { to: recipients });\n $mdDialog.show({\n parent: angular.element(document.body),\n targetEvent: $event,\n clickOutsideToClose: false,\n escapeToClose: false,\n templateUrl: '../Mail/UIxMailEditor',\n controller: 'MessageEditorController',\n controllerAs: 'editor',\n locals: {\n stateAccount: account,\n stateMessage: message\n }\n });\n });\n });\n });\n }\n\n function newMessageWithRecipient($event, recipient, fn) {\n var recipients = [fn + ' <' + recipient + '>'];\n vm.newMessage($event, recipients);\n $event.stopPropagation();\n $event.preventDefault();\n }\n\n function newMessageWithSelectedCards($event) {\n var selectedCards = _.filter(vm.selectedFolder.$cards, function(card) { return card.selected; });\n var promises = [], recipients = [];\n\n _.forEach(selectedCards, function(card) {\n if (card.$isList({expandable: true})) {\n // If the list's members were already fetch, use them\n if (angular.isDefined(card.refs) && card.refs.length) {\n _.forEach(card.refs, function(ref) {\n if (ref.email.length)\n recipients.push(ref.$shortFormat());\n });\n }\n else {\n promises.push(card.$reload().then(function(card) {\n _.forEach(card.refs, function(ref) {\n if (ref.email.length)\n recipients.push(ref.$shortFormat());\n });\n }));\n }\n }\n else if (card.c_mail.length) {\n recipients.push(card.$shortFormat());\n }\n });\n\n $q.all(promises).then(function() {\n recipients = _.uniq(recipients);\n if (recipients.length)\n vm.newMessage($event, recipients);\n });\n }\n }\n\n angular\n .module('SOGo.ContactsUI')\n .controller('AddressBookController', AddressBookController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @ngInject\n */\n AddressBooksController.$inject = ['$q', '$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$window', '$mdDialog', '$mdToast', '$mdMedia', '$mdSidenav', 'FileUploader', 'sgConstant', 'sgHotkeys', 'sgFocus', 'Card', 'AddressBook', 'Dialog', 'sgSettings', 'User', 'stateAddressbooks'];\n function AddressBooksController($q, $state, $scope, $rootScope, $stateParams, $timeout, $window, $mdDialog, $mdToast, $mdMedia, $mdSidenav, FileUploader, sgConstant, sgHotkeys, focus, Card, AddressBook, Dialog, Settings, User, stateAddressbooks) {\n var vm = this, hotkeys = [];\n\n vm.activeUser = Settings.activeUser;\n vm.service = AddressBook;\n vm.select = select;\n vm.newAddressbook = newAddressbook;\n vm.edit = edit;\n vm.revertEditing = revertEditing;\n vm.save = save;\n vm.confirmDelete = confirmDelete;\n vm.importCards = importCards;\n vm.showLinks = showLinks;\n vm.showProperties = showProperties;\n vm.share = share;\n vm.subscribeToFolder = subscribeToFolder;\n vm.isDroppableFolder = isDroppableFolder;\n vm.dragSelectedCards = dragSelectedCards;\n\n\n _registerHotkeys(hotkeys);\n\n $scope.$on('$destroy', function() {\n // Deregister hotkeys\n _.forEach(hotkeys, function(key) {\n sgHotkeys.deregisterHotkey(key);\n });\n });\n\n\n function _registerHotkeys(keys) {\n keys.push(sgHotkeys.createHotkey({\n key: 'backspace',\n description: l('Delete selected card or address book'),\n callback: function() {\n if (AddressBook.selectedFolder && !AddressBook.selectedFolder.hasSelectedCard())\n confirmDelete();\n }\n }));\n\n // Register the hotkeys\n _.forEach(keys, function(key) {\n sgHotkeys.registerHotkey(key);\n });\n }\n\n function select($event, folder) {\n if ($state.params.addressbookId != folder.id &&\n vm.editMode != folder.id) {\n vm.editMode = false;\n AddressBook.$query.value = '';\n // Close sidenav on small devices\n if (!$mdMedia(sgConstant['gt-md']))\n $mdSidenav('left').close();\n $state.go('app.addressbook', {addressbookId: folder.id});\n }\n else {\n $event.preventDefault();\n $event.stopPropagation();\n }\n }\n\n function newAddressbook() {\n Dialog.prompt(l('New Addressbook...'),\n l('Name of the Address Book'))\n .then(function(name) {\n var addressbook = new AddressBook(\n {\n name: name,\n isEditable: true,\n isRemote: false,\n owner: UserLogin\n }\n );\n AddressBook.$add(addressbook);\n });\n }\n\n function edit(folder) {\n if (!folder.isRemote) {\n vm.editMode = folder.id;\n vm.originalAddressbook = angular.extend({}, folder.$omit());\n focus('addressBookName_' + folder.id);\n }\n }\n\n function revertEditing(folder) {\n folder.name = vm.originalAddressbook.name;\n vm.editMode = false;\n }\n\n function save(folder) {\n var name = folder.name;\n if (name && name.length > 0 && name != vm.originalAddressbook.name) {\n folder.$rename(name)\n .then(function(data) {\n vm.editMode = false;\n }, function(data, status) {\n Dialog.alert(l('Warning'), data);\n });\n }\n }\n\n function confirmDelete() {\n if (vm.service.selectedFolder.isSubscription) {\n // Unsubscribe without confirmation\n vm.service.selectedFolder.$delete()\n .then(function() {\n vm.service.selectedFolder = null;\n $state.go('app.addressbook', { addressbookId: 'personal' });\n }, function(data, status) {\n Dialog.alert(l('An error occured while deleting the addressbook \"%{0}\".',\n vm.service.selectedFolder.name),\n l(data.error));\n });\n }\n else {\n Dialog.confirm(l('Warning'), l('Are you sure you want to delete the addressbook \"%{0}\"?',\n vm.service.selectedFolder.name),\n { ok: l('Delete') })\n .then(function() {\n return vm.service.selectedFolder.$delete();\n })\n .then(function() {\n vm.service.selectedFolder = null;\n $state.go('app.addressbook', { addressbookId: 'personal' });\n return true;\n })\n .catch(function(response) {\n if (response) {\n var message = response.data.message || response.statusText;\n Dialog.alert(l('An error occured while deleting the addressbook \"%{0}\".',\n vm.service.selectedFolder.name),\n message);\n }\n });\n }\n }\n\n function importCards($event, folder) {\n $mdDialog.show({\n parent: angular.element(document.body),\n targetEvent: $event,\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: 'UIxContactsImportDialog',\n controller: CardsImportDialogController,\n controllerAs: '$CardsImportDialogController',\n locals: {\n folder: folder\n }\n });\n\n /**\n * @ngInject\n */\n CardsImportDialogController.$inject = ['scope', '$mdDialog', 'folder'];\n function CardsImportDialogController(scope, $mdDialog, folder) {\n var vm = this;\n\n vm.uploader = new FileUploader({\n url: ApplicationBaseURL + [folder.id, 'import'].join('/'),\n autoUpload: true,\n queueLimit: 1,\n filters: [{ name: filterByExtension, fn: filterByExtension }],\n onSuccessItem: function(item, response, status, headers) {\n var msg;\n\n $mdDialog.hide();\n\n if (response.imported === 0)\n msg = l('No card was imported.');\n else {\n msg = l('A total of %{0} cards were imported in the addressbook.', response.imported);\n AddressBook.selectedFolder.$reload();\n }\n\n $mdToast.show(\n $mdToast.simple()\n .content(msg)\n .position('top right')\n .hideDelay(3000));\n },\n onErrorItem: function(item, response, status, headers) {\n $mdToast.show({\n template: [\n '<md-toast>',\n ' <div class=\"md-toast-content\">',\n ' <md-icon class=\"md-warn md-hue-1\">error_outline</md-icon>',\n ' <span>' + l('An error occured while importing contacts.') + '</span>',\n ' </div>',\n '</md-toast>'\n ].join(''),\n position: 'top right',\n hideDelay: 3000\n });\n }\n });\n\n vm.close = function() {\n $mdDialog.hide();\n };\n\n function filterByExtension(item) {\n var isTextFile = item.type.indexOf('text') === 0 ||\n /\\.(ldif|vcf|vcard)$/.test(item.name);\n\n if (!isTextFile)\n $mdToast.show({\n template: [\n '<md-toast>',\n ' <div class=\"md-toast-content\">',\n ' <md-icon class=\"md-warn md-hue-1\">error_outline</md-icon>',\n ' <span>' + l('Select a vCard or LDIF file.') + '</span>',\n ' </div>',\n '</md-toast>'\n ].join(''),\n position: 'top right',\n hideDelay: 3000\n });\n\n return isTextFile;\n }\n }\n }\n\n function showLinks(addressbook) {\n var promise;\n if (addressbook.urls)\n promise = $q.when();\n else\n // Refresh list of addressbooks to fetch links associated to addressbook\n promise = AddressBook.$reloadAll();\n promise.then(function() {\n $mdDialog.show({\n parent: angular.element(document.body),\n clickOutsideToClose: true,\n escapeToClose: true,\n templateUrl: addressbook.id + '/links',\n controller: LinksDialogController,\n controllerAs: 'links',\n locals: {\n addressbook: addressbook\n }\n });\n });\n\n /**\n * @ngInject\n */\n LinksDialogController.$inject = ['$mdDialog', 'addressbook'];\n function LinksDialogController($mdDialog, addressbook) {\n var vm = this;\n this.addressbook = addressbook;\n this.close = close;\n\n function close() {\n $mdDialog.hide();\n }\n }\n }\n\n function showProperties(addressbook) {\n $mdDialog.show({\n templateUrl: addressbook.id + '/properties',\n controller: PropertiesDialogController,\n controllerAs: 'properties',\n clickOutsideToClose: true,\n escapeToClose: true,\n locals: {\n srcAddressBook: addressbook\n }\n }).catch(function() {\n // Do nothing\n });\n\n /**\n * @ngInject\n */\n PropertiesDialogController.$inject = ['$scope', '$mdDialog', 'srcAddressBook'];\n function PropertiesDialogController($scope, $mdDialog, srcAddressBook) {\n var vm = this;\n\n vm.addressbook = new AddressBook(srcAddressBook.$omit());\n vm.saveProperties = saveProperties;\n vm.close = close;\n\n function saveProperties() {\n vm.addressbook.$save().then(function() {\n // Refresh list instance\n srcAddressBook.init(vm.addressbook.$omit());\n $mdDialog.hide();\n });\n }\n\n function close() {\n $mdDialog.cancel();\n }\n }\n }\n\n function share(addressbook) {\n // Fetch list of ACL users\n addressbook.$acl.$users().then(function() {\n // Show ACL editor\n $mdDialog.show({\n templateUrl: addressbook.id + '/UIxAclEditor', // UI/Templates/UIxAclEditor.wox\n controller: 'AclController', // from the ng module SOGo.Common\n controllerAs: 'acl',\n clickOutsideToClose: true,\n escapeToClose: true,\n locals: {\n usersWithACL: addressbook.$acl.users,\n User: User,\n folder: addressbook\n }\n });\n });\n }\n\n /**\n * subscribeToFolder - Callback of sgSubscribe directive\n */\n function subscribeToFolder(addressbookData) {\n console.debug('subscribeToFolder ' + addressbookData.owner + addressbookData.name);\n AddressBook.$subscribe(addressbookData.owner, addressbookData.name).then(function(data) {\n $mdToast.show(\n $mdToast.simple()\n .content(l('Successfully subscribed to address book'))\n .position('top right')\n .hideDelay(3000));\n });\n }\n\n function isDroppableFolder(srcFolder, dstFolder) {\n return (dstFolder.id != srcFolder.id) && (dstFolder.isOwned || dstFolder.acls.objectCreator);\n }\n\n /**\n * @see AddressBookController._selectedCardsOperation\n */\n function dragSelectedCards(srcFolder, dstFolder, mode) {\n var dstId, allCards, cards, ids, clearCardView, promise, success;\n\n dstId = dstFolder.id;\n clearCardView = false;\n allCards = srcFolder.$selectedCards();\n if (allCards.length === 0)\n allCards = [srcFolder.$selectedCard()];\n cards = _.filter(allCards, function(card) {\n return card.$isCard();\n });\n\n if (cards.length != allCards.length)\n $mdToast.show(\n $mdToast.simple()\n .content(l(\"Lists can't be moved or copied.\"))\n .position('top right')\n .hideDelay(2000));\n\n if (cards.length) {\n if (mode == 'copy') {\n promise = srcFolder.$copyCards(cards, dstId);\n success = l('%{0} card(s) copied', cards.length);\n }\n else {\n promise = srcFolder.$moveCards(cards, dstId);\n success = l('%{0} card(s) moved', cards.length);\n // Check if currently displayed card will be moved\n ids = _.map(cards, 'id');\n clearCardView = (srcFolder.selectedCard && ids.indexOf(srcFolder.selectedCard) >= 0);\n }\n\n // Show success toast when action succeeds\n promise.then(function() {\n if (clearCardView)\n $state.go('app.addressbook');\n $mdToast.show(\n $mdToast.simple()\n .content(success)\n .position('top right')\n .hideDelay(2000));\n });\n }\n }\n\n }\n\n angular\n .module('SOGo.ContactsUI')\n .controller('AddressBooksController', AddressBooksController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * Controller to view and edit a card\n * @ngInject\n */\n CardController.$inject = ['$scope', '$timeout', '$window', '$mdDialog', 'sgSettings', 'AddressBook', 'Card', 'Dialog', 'sgHotkeys', 'sgFocus', '$state', '$stateParams', 'stateCard'];\n function CardController($scope, $timeout, $window, $mdDialog, sgSettings, AddressBook, Card, Dialog, sgHotkeys, focus, $state, $stateParams, stateCard) {\n var vm = this, hotkeys = [];\n\n vm.card = stateCard;\n\n vm.currentFolder = AddressBook.selectedFolder;\n vm.allEmailTypes = Card.$EMAIL_TYPES;\n vm.allTelTypes = Card.$TEL_TYPES;\n vm.allUrlTypes = Card.$URL_TYPES;\n vm.allAddressTypes = Card.$ADDRESS_TYPES;\n vm.categories = {};\n vm.userFilterResults = [];\n vm.transformCategory = transformCategory;\n vm.addOrgUnit = addOrgUnit;\n vm.addBirthday = addBirthday;\n vm.addScreenName = addScreenName;\n vm.addEmail = addEmail;\n vm.addPhone = addPhone;\n vm.addUrl = addUrl;\n vm.addAddress = addAddress;\n vm.userFilter = userFilter;\n vm.save = save;\n vm.close = close;\n vm.reset = reset;\n vm.cancel = cancel;\n vm.confirmDelete = confirmDelete;\n vm.toggleRawSource = toggleRawSource;\n vm.showRawSource = false;\n\n\n _registerHotkeys(hotkeys);\n\n $scope.$on('$destroy', function() {\n // Deregister hotkeys\n _.forEach(hotkeys, function(key) {\n sgHotkeys.deregisterHotkey(key);\n });\n });\n\n\n function _registerHotkeys(keys) {\n keys.push(sgHotkeys.createHotkey({\n key: 'backspace',\n description: l('Delete'),\n callback: function($event) {\n if (vm.currentFolder.$selectedCount() === 0)\n confirmDelete();\n $event.preventDefault();\n }\n }));\n\n // Register the hotkeys\n _.forEach(keys, function(key) {\n sgHotkeys.registerHotkey(key);\n });\n }\n\n function transformCategory(input) {\n if (angular.isString(input))\n return { value: input };\n else\n return input;\n }\n function addOrgUnit() {\n var i = vm.card.$addOrgUnit('');\n focus('orgUnit_' + i);\n }\n function addBirthday() {\n vm.card.birthday = new Date();\n }\n function addScreenName() {\n vm.card.$addScreenName('');\n }\n function addEmail() {\n var i = vm.card.$addEmail('');\n focus('email_' + i);\n }\n function addPhone() {\n var i = vm.card.$addPhone('');\n focus('phone_' + i);\n }\n function addUrl() {\n var i = vm.card.$addUrl('', '');\n focus('url_' + i);\n }\n function addAddress() {\n var i = vm.card.$addAddress('', '', '', '', '', '', '', '');\n focus('address_' + i);\n }\n function userFilter($query, excludedCards) {\n if ($query.length < sgSettings.minimumSearchLength())\n return [];\n\n return AddressBook.selectedFolder.$filter($query, {dry: true, excludeLists: true}, excludedCards).then(function(cards) {\n return cards;\n });\n }\n function save(form) {\n if (form.$valid) {\n vm.card.$save()\n .then(function(data) {\n var i = _.indexOf(_.map(AddressBook.selectedFolder.$cards, 'id'), vm.card.id);\n if (i < 0) {\n // New card; reload contacts list and show addressbook in which the card has been created\n AddressBook.selectedFolder.$reload();\n }\n else {\n // Update contacts list with new version of the Card object\n AddressBook.selectedFolder.$cards[i] = angular.copy(vm.card);\n }\n $state.go('app.addressbook.card.view', { cardId: vm.card.id });\n });\n }\n }\n function close() {\n $state.go('app.addressbook').then(function() {\n vm.card = null;\n delete AddressBook.selectedFolder.selectedCard;\n });\n }\n function reset() {\n vm.card.$reset();\n }\n function cancel() {\n vm.card.$reset();\n if (vm.card.isNew) {\n // Cancelling the creation of a card\n vm.card = null;\n delete AddressBook.selectedFolder.selectedCard;\n $state.go('app.addressbook', { addressbookId: AddressBook.selectedFolder.id });\n }\n else {\n // Cancelling the edition of an existing card\n $state.go('app.addressbook.card.view', { cardId: vm.card.id });\n }\n }\n function confirmDelete() {\n var card = stateCard;\n\n Dialog.confirm(l('Warning'),\n l('Are you sure you want to delete the card of %{0}?', '<b>' + card.$fullname() + '</b>'),\n { ok: l('Delete') })\n .then(function() {\n // User confirmed the deletion\n AddressBook.selectedFolder.$deleteCards([card])\n .then(function() {\n close();\n }, function(data, status) {\n Dialog.alert(l('Warning'), l('An error occured while deleting the card \"%{0}\".',\n card.$fullname()));\n });\n });\n }\n\n function toggleRawSource($event) {\n if (!vm.showRawSource && !vm.rawSource) {\n Card.$$resource.post(vm.currentFolder.id + '/' + vm.card.id, \"raw\").then(function(data) {\n vm.rawSource = data;\n vm.showRawSource = true;\n });\n }\n else {\n vm.showRawSource = !vm.showRawSource;\n }\n }\n }\n\n angular\n .module('SOGo.ContactsUI')\n .controller('CardController', CardController);\n})();\n","/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n(function() {\n 'use strict';\n\n /**\n * @name sgAddress\n * @memberof ContactsUI\n * @desc Directive to format a postal address.\n * @ngInject\n */\n function sgAddress() {\n return {\n restrict: 'A',\n scope: { data: '=sgAddress' },\n controller: ['$scope', function($scope) {\n $scope.addressLines = function(data) {\n var lines = [],\n locality_region = [];\n if (data.street) lines.push(data.street);\n if (data.street2) lines.push(data.street2);\n if (data.locality) locality_region.push(data.locality);\n if (data.region) locality_region.push(data.region);\n if (locality_region.length > 0) lines.push(locality_region.join(', '));\n if (data.country) lines.push(data.country);\n if (data.postalcode) lines.push(data.postalcode);\n return lines.join('<br>');\n };\n }],\n template: '<address ng-bind-html=\"addressLines(data)\"></address>'\n };\n }\n \n angular\n .module('SOGo.Common')\n .directive('sgAddress', sgAddress);\n})();\n"]} |