diff --git a/UI/WebServerResources/js/Common/Common.app.js b/UI/WebServerResources/js/Common/Common.app.js index 78f1510b3..021d4b145 100644 --- a/UI/WebServerResources/js/Common/Common.app.js +++ b/UI/WebServerResources/js/Common/Common.app.js @@ -128,7 +128,8 @@ 'lg' : '(min-width: 1024px) and (max-width: 1279px)', 'gt-lg' : '(min-width: 1280px)' , 'xl' : '(min-width: 1920px)' , - 'print' : 'print' + 'print' : 'print', + toastPosition: 'bottom right' }) .config(configure) diff --git a/UI/WebServerResources/js/Common/navController.js b/UI/WebServerResources/js/Common/navController.js index 23185609e..1ac89732f 100644 --- a/UI/WebServerResources/js/Common/navController.js +++ b/UI/WebServerResources/js/Common/navController.js @@ -125,7 +125,7 @@ '' ].join(''), hideDelay: 5000, - position: 'top right' + position: sgConstant.toastPosition }); else $log.debug('untrap error'); diff --git a/UI/WebServerResources/js/Contacts/AddressBookController.js b/UI/WebServerResources/js/Contacts/AddressBookController.js index 5b571ba17..57ffed1e1 100644 --- a/UI/WebServerResources/js/Contacts/AddressBookController.js +++ b/UI/WebServerResources/js/Contacts/AddressBookController.js @@ -6,8 +6,8 @@ /** * @ngInject */ - AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'sgFocus', 'Dialog', 'sgSettings', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook']; - function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, focus, Dialog, Settings, sgHotkeys, stateAddressbooks, stateAddressbook) { + AddressBookController.$inject = ['$scope', '$q', '$window', '$state', '$timeout', '$mdDialog', '$mdToast', 'Account', 'Card', 'AddressBook', 'sgFocus', 'Dialog', 'sgConstant', 'sgHotkeys', 'stateAddressbooks', 'stateAddressbook']; + function AddressBookController($scope, $q, $window, $state, $timeout, $mdDialog, $mdToast, Account, Card, AddressBook, focus, Dialog, sgConstant, sgHotkeys, stateAddressbooks, stateAddressbook) { var vm = this, hotkeys = [], sortLabels; sortLabels = { @@ -261,7 +261,7 @@ $mdToast.show( $mdToast.simple() .textContent(l("Lists can't be moved or copied.")) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); if (cards.length) { @@ -284,7 +284,7 @@ $mdToast.show( $mdToast.simple() .textContent(success) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); }); } diff --git a/UI/WebServerResources/js/Contacts/AddressBooksController.js b/UI/WebServerResources/js/Contacts/AddressBooksController.js index fbc04fcce..0abbd2cd3 100644 --- a/UI/WebServerResources/js/Contacts/AddressBooksController.js +++ b/UI/WebServerResources/js/Contacts/AddressBooksController.js @@ -188,7 +188,7 @@ $mdToast.show( $mdToast.simple() .textContent(msg) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); }, onErrorItem: function(item, response, status, headers) { @@ -201,7 +201,7 @@ ' ', '' ].join(''), - position: 'top right', + position: Settings.toastPosition, hideDelay: 3000 }); } @@ -225,7 +225,7 @@ ' ', '' ].join(''), - position: 'top right', + position: Settings.toastPosition, hideDelay: 3000 }); @@ -336,7 +336,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Successfully subscribed to address book')) - .position('top right') + .position(Settings.toastPosition) .hideDelay(3000)); }); }; @@ -364,7 +364,7 @@ $mdToast.show( $mdToast.simple() .textContent(l("Lists can't be moved or copied.")) - .position('top right') + .position(Settings.toastPosition) .hideDelay(2000)); if (cards.length) { @@ -387,7 +387,7 @@ $mdToast.show( $mdToast.simple() .textContent(success) - .position('top right') + .position(Settings.toastPosition) .hideDelay(2000)); }); } diff --git a/UI/WebServerResources/js/Mailer/MailboxController.js b/UI/WebServerResources/js/Mailer/MailboxController.js index 7798392a0..528149b7a 100644 --- a/UI/WebServerResources/js/Mailer/MailboxController.js +++ b/UI/WebServerResources/js/Mailer/MailboxController.js @@ -6,8 +6,8 @@ /** * @ngInject */ - MailboxController.$inject = ['$window', '$scope', '$timeout', '$q', '$state', '$mdDialog', '$mdToast', 'stateAccounts', 'stateAccount', 'stateMailbox', 'sgHotkeys', 'encodeUriFilter', 'sgSettings', 'sgFocus', 'Dialog', 'Preferences', 'Account', 'Mailbox']; - function MailboxController($window, $scope, $timeout, $q, $state, $mdDialog, $mdToast, stateAccounts, stateAccount, stateMailbox, sgHotkeys, encodeUriFilter, sgSettings, focus, Dialog, Preferences, Account, Mailbox) { + MailboxController.$inject = ['$window', '$scope', '$timeout', '$q', '$state', '$mdDialog', '$mdToast', 'stateAccounts', 'stateAccount', 'stateMailbox', 'sgHotkeys', 'encodeUriFilter', 'sgConstant', 'sgSettings', 'sgFocus', 'Dialog', 'Preferences', 'Account', 'Mailbox']; + function MailboxController($window, $scope, $timeout, $q, $state, $mdDialog, $mdToast, stateAccounts, stateAccount, stateMailbox, sgHotkeys, encodeUriFilter, sgConstant, sgSettings, focus, Dialog, Preferences, Account, Mailbox) { var vm = this, defaultWindowTitle = angular.element($window.document).find('title').attr('sg-default') || "SOGo", hotkeys = [], @@ -490,7 +490,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('%{0} message(s) copied', vm.selectedFolder.selectedCount())) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); }); }; @@ -504,7 +504,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('%{0} message(s) moved', count)) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); if (Mailbox.$virtualMode) { // When performing an advanced search, we refresh the view if the selected message diff --git a/UI/WebServerResources/js/Mailer/MailboxesController.js b/UI/WebServerResources/js/Mailer/MailboxesController.js index 858e69c27..04cf860b7 100644 --- a/UI/WebServerResources/js/Mailer/MailboxesController.js +++ b/UI/WebServerResources/js/Mailer/MailboxesController.js @@ -299,7 +299,7 @@ $mdToast.show( $mdToast.simple() .textContent(success) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); }); }; diff --git a/UI/WebServerResources/js/Mailer/MessageController.js b/UI/WebServerResources/js/Mailer/MessageController.js index 0de37110f..05cb3be96 100644 --- a/UI/WebServerResources/js/Mailer/MessageController.js +++ b/UI/WebServerResources/js/Mailer/MessageController.js @@ -286,7 +286,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Successfully created card')) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(2000)); }); }); diff --git a/UI/WebServerResources/js/Mailer/MessageEditorController.js b/UI/WebServerResources/js/Mailer/MessageEditorController.js index b48370e76..179d48875 100644 --- a/UI/WebServerResources/js/Mailer/MessageEditorController.js +++ b/UI/WebServerResources/js/Mailer/MessageEditorController.js @@ -6,8 +6,8 @@ /** * @ngInject */ - MessageEditorController.$inject = ['$scope', '$window', '$stateParams', '$mdConstant', '$mdUtil', '$mdDialog', '$mdToast', 'FileUploader', 'stateParent', 'stateAccount', 'stateMessage', 'onCompletePromise', 'encodeUriFilter', '$timeout', 'sgFocus', 'Dialog', 'AddressBook', 'Card', 'Preferences']; - function MessageEditorController($scope, $window, $stateParams, $mdConstant, $mdUtil, $mdDialog, $mdToast, FileUploader, stateParent, stateAccount, stateMessage, onCompletePromise, encodeUriFilter, $timeout, focus, Dialog, AddressBook, Card, Preferences) { + MessageEditorController.$inject = ['$scope', '$window', '$stateParams', '$mdConstant', '$mdUtil', '$mdDialog', '$mdToast', 'FileUploader', 'stateParent', 'stateAccount', 'stateMessage', 'onCompletePromise', 'encodeUriFilter', '$timeout', 'sgConstant', 'sgFocus', 'Dialog', 'AddressBook', 'Card', 'Preferences']; + function MessageEditorController($scope, $window, $stateParams, $mdConstant, $mdUtil, $mdDialog, $mdToast, FileUploader, stateParent, stateAccount, stateMessage, onCompletePromise, encodeUriFilter, $timeout, sgConstant, focus, Dialog, AddressBook, Card, Preferences) { var vm = this; this.$onInit = function() { @@ -150,7 +150,7 @@ $mdToast.simple() .textContent(l('Error while uploading the file \"%{0}\":', item.file.name) + ' ' + (response.message? l(response.message) : '')) - .position('top right') + .position(sgConstant.toastPosition) .action(l('OK')) .hideDelay(false)); this.removeFromQueue(item); @@ -227,7 +227,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Your email has been saved')) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); } }); @@ -259,7 +259,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Your email has been sent')) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); // Let the user see the succesfull message before closing the dialog diff --git a/UI/WebServerResources/js/Mailer/sgMailboxListItem.directive.js b/UI/WebServerResources/js/Mailer/sgMailboxListItem.directive.js index a36a4015b..b95ccbb82 100644 --- a/UI/WebServerResources/js/Mailer/sgMailboxListItem.directive.js +++ b/UI/WebServerResources/js/Mailer/sgMailboxListItem.directive.js @@ -255,7 +255,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Folder compacted')) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); }); }; @@ -273,7 +273,7 @@ $mdToast.show( $mdToast.simple() .textContent(successMsg) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); }); }; diff --git a/UI/WebServerResources/js/Preferences/Preferences.service.js b/UI/WebServerResources/js/Preferences/Preferences.service.js index 6f5a9d141..4dfc36c5f 100644 --- a/UI/WebServerResources/js/Preferences/Preferences.service.js +++ b/UI/WebServerResources/js/Preferences/Preferences.service.js @@ -251,7 +251,7 @@ * @desc The factory we'll use to register with Angular * @returns the Preferences constructor */ - Preferences.$factory = ['$window', '$document', '$rootScope', '$q', '$timeout', '$log', '$state', '$mdDateLocale', '$mdToast', 'sgSettings', 'Gravatar', 'Resource', 'User', function($window, $document, $rootScope, $q, $timeout, $log, $state, $mdDateLocaleProvider, $mdToast, Settings, Gravatar, Resource, User) { + Preferences.$factory = ['$window', '$document', '$rootScope', '$q', '$timeout', '$log', '$state', '$mdDateLocale', '$mdToast', 'sgConstant', 'sgSettings', 'Gravatar', 'Resource', 'User', function($window, $document, $rootScope, $q, $timeout, $log, $state, $mdDateLocaleProvider, $mdToast, sgConstant, Settings, Gravatar, Resource, User) { angular.extend(Preferences, { $window: $window, $document: $document, @@ -265,7 +265,8 @@ $gravatar: Gravatar, $$resource: new Resource(Settings.activeUser('folderURL'), Settings.activeUser()), $resourcesURL: Settings.resourcesURL(), - $User: User + $User: User, + $sgConstant: sgConstant }); return new Preferences(); // return unique instance @@ -511,7 +512,7 @@ ' ', '' ].join(''), - position: 'top right', + position: Preferences.$sgConstant.toastPosition, hideDelay: 5000, controller: toastController, viewInboxMessage: _this.viewInboxMessage @@ -612,7 +613,7 @@ } _this.currentToast = _this.currentToast.then(function () { return Preferences.$toast.show({ - position: 'top right', + position: Preferences.$sgConstant.toastPosition, hideDelay: 0, template: [ '', diff --git a/UI/WebServerResources/js/Scheduler/CalendarsController.js b/UI/WebServerResources/js/Scheduler/CalendarsController.js index a1aa14932..ca6d09075 100644 --- a/UI/WebServerResources/js/Scheduler/CalendarsController.js +++ b/UI/WebServerResources/js/Scheduler/CalendarsController.js @@ -163,7 +163,7 @@ $mdToast.show( $mdToast.simple() .textContent(l('Successfully subscribed to calendar')) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); }); }; diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index f3b7e35ca..5a2238389 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -6,8 +6,8 @@ /** * @ngInject */ - ComponentController.$inject = ['$rootScope', '$scope', '$q', '$mdDialog', 'Preferences', 'Calendar', 'Component', 'AddressBook', 'Account', 'stateComponent']; - function ComponentController($rootScope, $scope, $q, $mdDialog, Preferences, Calendar, Component, AddressBook, Account, stateComponent) { + ComponentController.$inject = ['$rootScope', '$scope', '$q', '$mdDialog', 'sgConstant', 'Preferences', 'Calendar', 'Component', 'AddressBook', 'Account', 'stateComponent']; + function ComponentController($rootScope, $scope, $q, $mdDialog, sgConstant, Preferences, Calendar, Component, AddressBook, Account, stateComponent) { var vm = this, component; this.$onInit = function () { @@ -424,7 +424,7 @@ '' ].join(''), hideDelay: 5000, - position: 'top right' + position: sgConstant.toastPosition }); }).finally(function () { $timeout(scrollToStart); diff --git a/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js b/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js index 914325516..5cfbcf8d1 100644 --- a/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js +++ b/UI/WebServerResources/js/Scheduler/sgCalendarListItem.directive.js @@ -340,7 +340,7 @@ $mdToast.show( $mdToast.simple() .textContent(msg) - .position('top right') + .position(sgConstant.toastPosition) .hideDelay(3000)); }, onErrorItem: function(item, response, status, headers) { @@ -353,7 +353,7 @@ ' ', '' ].join(''), - position: 'top right', + position: sgConstant.toastPosition, hideDelay: 3000 }); } @@ -377,7 +377,7 @@ ' ', '' ].join(''), - position: 'top right', + position: sgConstant.toastPosition, hideDelay: 3000 });