mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-10 04:49:46 +00:00
fix(mail(js)): use different email separator keys depending on locale
Fixes #3513 Fixes #4042 Fixes #5308 Fixes #5309
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
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) {
|
||||
MessageEditorController.$inject = ['$scope', '$window', '$stateParams', '$mdUtil', '$mdDialog', '$mdToast', 'FileUploader', 'stateParent', 'stateAccount', 'stateMessage', 'onCompletePromise', 'encodeUriFilter', '$timeout', 'sgConstant', 'sgFocus', 'Dialog', 'AddressBook', 'Card', 'Preferences'];
|
||||
function MessageEditorController($scope, $window, $stateParams, $mdUtil, $mdDialog, $mdToast, FileUploader, stateParent, stateAccount, stateMessage, onCompletePromise, encodeUriFilter, $timeout, sgConstant, focus, Dialog, AddressBook, Card, Preferences) {
|
||||
var vm = this;
|
||||
|
||||
this.$onInit = function() {
|
||||
@@ -24,12 +24,7 @@
|
||||
this.fromIdentity = stateMessage.editable.from;
|
||||
this.identitySearchText = '';
|
||||
this.message = stateMessage;
|
||||
this.recipientSeparatorKeys = [
|
||||
$mdConstant.KEY_CODE.ENTER,
|
||||
$mdConstant.KEY_CODE.TAB,
|
||||
$mdConstant.KEY_CODE.COMMA,
|
||||
$mdConstant.KEY_CODE.SEMICOLON
|
||||
];
|
||||
this.recipientSeparatorKeys = Preferences.defaults.emailSeparatorKeys;
|
||||
this.sendState = false;
|
||||
this.toggleFullscreen = toggleFullscreen;
|
||||
this.firstFocus = true;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
AccountDialogController.$inject = ['$timeout', '$window', '$mdConstant', '$mdDialog', 'FileUploader', 'Dialog', 'sgSettings', 'defaults', 'account', 'accountId', 'mailCustomFromEnabled'];
|
||||
function AccountDialogController($timeout, $window, $mdConstant, $mdDialog, FileUploader, Dialog, Settings, defaults, account, accountId, mailCustomFromEnabled) {
|
||||
AccountDialogController.$inject = ['$timeout', '$window', '$mdDialog', 'FileUploader', 'Dialog', 'sgSettings', 'defaults', 'account', 'accountId', 'mailCustomFromEnabled'];
|
||||
function AccountDialogController($timeout, $window, $mdDialog, FileUploader, Dialog, Settings, defaults, account, accountId, mailCustomFromEnabled) {
|
||||
var vm = this, usesSSO = $window.usesCASAuthentication || $window.usesSAML2Authentication;
|
||||
|
||||
this.defaultPort = 143;
|
||||
@@ -17,12 +17,6 @@
|
||||
this.accountId = accountId;
|
||||
this.hostnameRE = usesSSO && accountId > 0 ? /^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/ : /./;
|
||||
this.addressesSearchText = '';
|
||||
this.emailSeparatorKeys = [
|
||||
$mdConstant.KEY_CODE.ENTER,
|
||||
$mdConstant.KEY_CODE.TAB,
|
||||
$mdConstant.KEY_CODE.COMMA,
|
||||
$mdConstant.KEY_CODE.SEMICOLON
|
||||
];
|
||||
this.ckConfig = {
|
||||
'autoGrow_minHeight': 70,
|
||||
'toolbar': [['Bold', 'Italic', '-', 'Link',
|
||||
|
||||
@@ -163,14 +163,36 @@
|
||||
else
|
||||
data.SOGoContactsCategories = _.compact(data.SOGoContactsCategories);
|
||||
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13, // $mdConstant.KEY_CODE.ENTER,
|
||||
186, // $mdConstant.KEY_CODE.SEMICOLON
|
||||
188 // $mdConstant.KEY_CODE.COMMA,
|
||||
];
|
||||
if (data.LocaleCode) {
|
||||
data.ckLocaleCode = data.LocaleCode.replace('_', '-').toLowerCase();
|
||||
// Exceptions
|
||||
switch (data.LocaleCode) {
|
||||
case 'it':
|
||||
// The Italian keyboard layout has the same keycode (186) for '@' and ';'; we remove the semicolon.
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13, // $mdConstant.KEY_CODE.ENTER,
|
||||
188 // $mdConstant.KEY_CODE.COMMA,
|
||||
];
|
||||
break;
|
||||
case 'ru':
|
||||
// The Russian keyboard layout has the same keycode (186) for 'Ж' and ';'; we remove the semicolon.
|
||||
// It also has the same keycode (188) for 'Б' and ','; we remove the comma.
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13 // $mdConstant.KEY_CODE.ENTER,
|
||||
];
|
||||
break;
|
||||
case 'sr_ME':
|
||||
case 'sr_RS':
|
||||
data.ckLocaleCode = 'sr-latn';
|
||||
break;
|
||||
default:
|
||||
data.ckLocaleCode = data.LocaleCode.replace('_', '-').toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
PreferencesController.$inject = ['$q', '$window', '$state', '$mdConstant', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', 'sgSettings', 'sgFocus', 'Dialog', 'User', 'Account', 'Preferences', 'Authentication'];
|
||||
function PreferencesController($q, $window, $state, $mdConstant, $mdMedia, $mdSidenav, $mdDialog, $mdToast, sgSettings, focus, Dialog, User, Account, Preferences, Authentication) {
|
||||
PreferencesController.$inject = ['$q', '$window', '$state', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', 'sgSettings', 'sgFocus', 'Dialog', 'User', 'Account', 'Preferences', 'Authentication'];
|
||||
function PreferencesController($q, $window, $state, $mdMedia, $mdSidenav, $mdDialog, $mdToast, sgSettings, focus, Dialog, User, Account, Preferences, Authentication) {
|
||||
var vm = this, mailboxes = [], today = new Date().beginOfDay();
|
||||
|
||||
this.$onInit = function() {
|
||||
@@ -18,12 +18,7 @@
|
||||
this.timeZonesSearchText = '';
|
||||
this.addressesSearchText = '';
|
||||
this.mailLabelKeyRE = new RegExp(/^(?!^_\$)[^(){} %*\"\\\\]*?$/);
|
||||
this.emailSeparatorKeys = [
|
||||
$mdConstant.KEY_CODE.ENTER,
|
||||
$mdConstant.KEY_CODE.TAB,
|
||||
$mdConstant.KEY_CODE.COMMA,
|
||||
$mdConstant.KEY_CODE.SEMICOLON
|
||||
];
|
||||
this.emailSeparatorKeys = Preferences.defaults.emailSeparatorKeys;
|
||||
if (Preferences.defaults.SOGoMailAutoMarkAsReadMode == 'delay')
|
||||
this.mailAutoMarkAsReadDelay = Math.max(1, this.preferences.defaults.SOGoMailAutoMarkAsReadDelay);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user