mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-04 21:08:51 +00:00
New SOGoMailComposeWindow default
This commit is contained in:
@@ -133,6 +133,9 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
||||
- (void) setAnimationMode: (NSString *) newValue;
|
||||
- (NSString *) animationMode;
|
||||
|
||||
- (void) setMailComposeWindow: (NSString *) newValue;
|
||||
- (NSString *) mailComposeWindow;
|
||||
|
||||
- (void) setMailComposeMessageType: (NSString *) newValue;
|
||||
- (NSString *) mailComposeMessageType;
|
||||
|
||||
|
||||
@@ -542,6 +542,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
||||
return [self stringForKey: @"SOGoAnimationMode"];
|
||||
}
|
||||
|
||||
- (void) setMailComposeWindow: (NSString *) newValue
|
||||
{
|
||||
[self setObject: newValue forKey: @"SOGoMailComposeWindow"];
|
||||
}
|
||||
|
||||
- (NSString *) mailComposeWindow
|
||||
{
|
||||
return [self stringForKey: @"SOGoMailComposeWindow"];
|
||||
}
|
||||
|
||||
- (void) setMailComposeMessageType: (NSString *) newValue
|
||||
{
|
||||
[self setObject: newValue forKey: @"SOGoMailComposeMessageType"];
|
||||
|
||||
@@ -151,6 +151,9 @@
|
||||
"Show subscribed mailboxes only" = "Show subscribed mailboxes only";
|
||||
"Synchronize only default mail folders (EAS)" = "Synchronize only default mail folders (EAS)";
|
||||
"Sort messages by threads" = "Sort messages by threads";
|
||||
"Always show mail composer" = "Always show mail composer";
|
||||
"Inside current window" = "Inside current window";
|
||||
"In a popup window" = "In a popup window";
|
||||
"When sending mail, add unknown recipients to my" = "When sending mail, add unknown recipients to my";
|
||||
"Address Book" = "Address Book";
|
||||
"Forward messages" = "Forward messages";
|
||||
|
||||
@@ -274,6 +274,9 @@ static SoProduct *preferencesProduct = nil;
|
||||
//
|
||||
// Default Mail preferences
|
||||
//
|
||||
if (![[defaults source] objectForKey: @"SOGoMailComposeWindow"])
|
||||
[[defaults source] setObject: [defaults mailComposeWindow] forKey: @"SOGoMailComposeWindow"];
|
||||
|
||||
if (![[defaults source] objectForKey: @"SOGoSelectedAddressBook"])
|
||||
[[defaults source] setObject: [defaults selectedAddressBook] forKey: @"SOGoSelectedAddressBook"];
|
||||
|
||||
|
||||
@@ -322,6 +322,7 @@
|
||||
|
||||
<md-fab-speed-dial
|
||||
class="md-scale sg-fab-bottom-center"
|
||||
ng-if="::!mailbox.composeWindowEnabled()"
|
||||
ng-cloak="ng-cloak"
|
||||
ng-class="{ 'sg-sidenav-close': leftIsClose, 'sg-center-close': centerIsClose }"
|
||||
md-direction="up">
|
||||
@@ -344,6 +345,16 @@
|
||||
</md-fab-actions>
|
||||
</md-fab-speed-dial>
|
||||
|
||||
<md-button
|
||||
class="md-fab md-accent sg-fab-bottom-center"
|
||||
var:aria-label="Write a new message"
|
||||
ng-if="::mailbox.composeWindowEnabled()"
|
||||
ng-class="{ 'sg-sidenav-close': leftIsClose, 'sg-center-close': centerIsClose }"
|
||||
ng-click="mailbox.newMessage($event)">
|
||||
<md-tooltip md-direction="left"><var:string label:value="Write a new message"/></md-tooltip>
|
||||
<md-icon>edit</md-icon>
|
||||
</md-button>
|
||||
|
||||
<div id="detailView" class="view-detail"
|
||||
layout="column" layout-align="start center"
|
||||
ng-class="{ 'sg-close': !mailbox.service.selectedFolder.hasSelectedMessage() }"
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</md-button>
|
||||
<md-button class="sg-icon-button hide show-gt-md" label:aria-label="'Open in New Mail Window'.asSafeJSString"
|
||||
ng-hide="::isPopup"
|
||||
ng-click="viewer.openPopup()">
|
||||
ng-click="viewer.openInPopup()">
|
||||
<md-tooltip md-direction="bottom"><var:string label:value="Open in New Mail Window"/></md-tooltip>
|
||||
<md-icon>open_in_new</md-icon>
|
||||
</md-button>
|
||||
|
||||
@@ -566,6 +566,29 @@
|
||||
</md-checkbox>
|
||||
</div>
|
||||
|
||||
<div class="hide-xs" layout="row" layout-align="start center" flex="50">
|
||||
<md-checkbox
|
||||
class="md-align-top-left"
|
||||
ng-model="app.preferences.defaults.SOGoMailComposeWindowEnabled"
|
||||
label:aria-label="Always show mail composer">
|
||||
<!-- SOGoMailComposeWindow -->
|
||||
</md-checkbox>
|
||||
|
||||
<md-input-container class="md-block hide-xs" flex="50">
|
||||
<label><var:string label:value="Always open mail composer"/></label>
|
||||
<md-select
|
||||
ng-disabled="!app.preferences.defaults.SOGoMailComposeWindowEnabled"
|
||||
ng-model="app.preferences.defaults.SOGoMailComposeWindow">
|
||||
<md-option value="inline">
|
||||
<var:string label:value="Inside current window"/>
|
||||
</md-option>
|
||||
<md-option value="popup">
|
||||
<var:string label:value="In a popup window"/>
|
||||
</md-option>
|
||||
</md-select>
|
||||
</md-input-container>
|
||||
</div>
|
||||
|
||||
<div layout="row" layout-align="start center" flex="50" flex-xs="100">
|
||||
<md-checkbox
|
||||
class="md-align-top-left"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
MailboxController.$inject = ['$window', '$scope', '$timeout', '$q', '$state', '$mdDialog', '$mdToast', 'stateAccounts', 'stateAccount', 'stateMailbox', 'sgHotkeys', 'encodeUriFilter', 'sgSettings', 'sgFocus', 'Dialog', 'Account', 'Mailbox'];
|
||||
function MailboxController($window, $scope, $timeout, $q, $state, $mdDialog, $mdToast, stateAccounts, stateAccount, stateMailbox, sgHotkeys, encodeUriFilter, sgSettings, focus, Dialog, Account, Mailbox) {
|
||||
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) {
|
||||
var vm = this,
|
||||
defaultWindowTitle = angular.element($window.document).find('title').attr('sg-default') || "SOGo",
|
||||
hotkeys = [];
|
||||
@@ -146,11 +146,15 @@
|
||||
});
|
||||
};
|
||||
|
||||
this.composeWindowEnabled = function() {
|
||||
return Preferences.defaults.SOGoMailComposeWindowEnabled;
|
||||
};
|
||||
|
||||
this.newMessage = function($event, inPopup) {
|
||||
var message;
|
||||
|
||||
if (vm.messageDialog === null) {
|
||||
if (inPopup)
|
||||
if (inPopup || Preferences.defaults.SOGoMailComposeWindow == 'popup')
|
||||
_newMessageInPopup();
|
||||
else {
|
||||
message = vm.account.$newMessage();
|
||||
|
||||
@@ -72,9 +72,8 @@
|
||||
url: '/edit',
|
||||
views: {
|
||||
'message@': {
|
||||
templateUrl: 'UIxMailEditor', // UI/Templates/MailerUI/UIxMailEditor.wox
|
||||
controller: 'MessageEditorController',
|
||||
controllerAs: 'editor'
|
||||
template: '<ui-view/>',
|
||||
controller: 'MessageEditorControllerPopup'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
@@ -84,10 +83,9 @@
|
||||
.state('mail.account.mailbox.message.action', {
|
||||
url: '/{actionName:(?:reply|replyall|forward)}',
|
||||
views: {
|
||||
message: {
|
||||
templateUrl: 'UIxMailEditor', // UI/Templates/MailerUI/UIxMailEditor.wox
|
||||
controller: 'MessageEditorController',
|
||||
controllerAs: 'editor'
|
||||
'message@': {
|
||||
template: '<ui-view/>',
|
||||
controller: 'MessageEditorControllerPopup'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
MessageController.$inject = ['$window', '$scope', '$state', '$mdMedia', '$mdDialog', 'sgConstant', 'stateAccounts', 'stateAccount', 'stateMailbox', 'stateMessage', 'sgHotkeys', 'encodeUriFilter', 'sgSettings', 'ImageGallery', 'sgFocus', 'Dialog', 'Calendar', 'Component', 'Account', 'Mailbox', 'Message'];
|
||||
function MessageController($window, $scope, $state, $mdMedia, $mdDialog, sgConstant, stateAccounts, stateAccount, stateMailbox, stateMessage, sgHotkeys, encodeUriFilter, sgSettings, ImageGallery, focus, Dialog, Calendar, Component, Account, Mailbox, Message) {
|
||||
MessageController.$inject = ['$window', '$scope', '$state', '$mdMedia', '$mdDialog', 'sgConstant', 'stateAccounts', 'stateAccount', 'stateMailbox', 'stateMessage', 'sgHotkeys', 'encodeUriFilter', 'sgSettings', 'ImageGallery', 'sgFocus', 'Dialog', 'Preferences', 'Calendar', 'Component', 'Account', 'Mailbox', 'Message'];
|
||||
function MessageController($window, $scope, $state, $mdMedia, $mdDialog, sgConstant, stateAccounts, stateAccount, stateMailbox, stateMessage, sgHotkeys, encodeUriFilter, sgSettings, ImageGallery, focus, Dialog, Preferences, Calendar, Component, Account, Mailbox, Message) {
|
||||
var vm = this, popupWindow = null, hotkeys = [];
|
||||
|
||||
this.$onInit = function() {
|
||||
@@ -284,6 +284,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
this._showMailEditorInPopup = function(action) {
|
||||
if (!sgSettings.isPopup &&
|
||||
Preferences.defaults.SOGoMailComposeWindow == 'popup') {
|
||||
this.openInPopup(action);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
this.close = function() {
|
||||
$state.go('mail.account.mailbox').then(function() {
|
||||
vm.message = null;
|
||||
@@ -292,27 +301,32 @@
|
||||
};
|
||||
|
||||
this.reply = function($event) {
|
||||
var message = this.message.$reply();
|
||||
_showMailEditor($event, message);
|
||||
if (!this._showMailEditorInPopup('reply')) {
|
||||
_showMailEditor($event, this.message.$reply());
|
||||
}
|
||||
};
|
||||
|
||||
this.replyAll = function($event) {
|
||||
var message = this.message.$replyAll();
|
||||
_showMailEditor($event, message);
|
||||
if (!this._showMailEditorInPopup('replyall')) {
|
||||
_showMailEditor($event, this.message.$replyAll());
|
||||
}
|
||||
};
|
||||
|
||||
this.forward = function($event) {
|
||||
var message = this.message.$forward();
|
||||
_showMailEditor($event, message);
|
||||
if (!this._showMailEditorInPopup('forward')) {
|
||||
_showMailEditor($event, this.message.$forward());
|
||||
}
|
||||
};
|
||||
|
||||
this.edit = function($event) {
|
||||
this.message.$editableContent().then(function() {
|
||||
_showMailEditor($event, vm.message);
|
||||
});
|
||||
if (!this._showMailEditorInPopup('edit')) {
|
||||
this.message.$editableContent().then(function() {
|
||||
_showMailEditor($event, vm.message);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.openPopup = function() {
|
||||
this.openInPopup = function(action) {
|
||||
var url = [sgSettings.baseURL(),
|
||||
'UIxMailPopupView#!/Mail',
|
||||
this.message.accountId,
|
||||
@@ -321,6 +335,7 @@
|
||||
this.message.uid]
|
||||
.join('/'),
|
||||
wId = this.message.$absolutePath();
|
||||
if (action) url += '/' + action;
|
||||
popupWindow = $window.open(url, wId,
|
||||
["width=680",
|
||||
"height=520",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
// Mail editor autosave is a number of minutes or 0 if disabled
|
||||
data.SOGoMailAutoSave = parseInt(data.SOGoMailAutoSave) || 0;
|
||||
|
||||
data.SOGoMailComposeWindowEnabled = angular.isDefined(data.SOGoMailComposeWindow);
|
||||
|
||||
// Specify a base font size for HTML messages when SOGoMailComposeFontSize is not zero
|
||||
data.SOGoMailComposeFontSizeEnabled = parseInt(data.SOGoMailComposeFontSize) > 0;
|
||||
|
||||
@@ -286,6 +288,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
if (!preferences.defaults.SOGoMailComposeWindowEnabled)
|
||||
delete preferences.defaults.SOGoMailComposeWindow;
|
||||
delete preferences.defaults.SOGoMailComposeWindowEnabled;
|
||||
|
||||
if (!preferences.defaults.SOGoMailComposeFontSizeEnabled)
|
||||
preferences.defaults.SOGoMailComposeFontSize = 0;
|
||||
delete preferences.defaults.SOGoMailComposeFontSizeEnabled;
|
||||
|
||||
Reference in New Issue
Block a user