From 11a4d395133b82f4d621ffe6ce9a6c89d48ed3df Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 24 Nov 2014 10:08:29 +0000 Subject: [PATCH] missing commits from combined account and identity/signature selection r49527: Fix compose resizehandler: resize based on subtraction of header height from window height and allocate it to mail body r49524: first step for a combined account and identity/signature selector --- mail/inc/class.mail_hooks.inc.php | 2 +- mail/js/app.js | 58 ++++--- mail/templates/default/compose.xet | 251 ++++++++++++++--------------- mail/templates/pixelegg/app.css | 83 ++-------- mail/templates/pixelegg/app.less | 25 +-- 5 files changed, 179 insertions(+), 240 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index 873461b337..6b85b52366 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -533,7 +533,7 @@ class mail_hooks $profileID = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = $mail_bo->profileID; } catch (Exception $e) { //error_log(__METHOD__."()" . $e->getMessage()); - $profileID = emailadmin_bo::getUserDefaultAccID(); + $profileID = emailadmin_account::get_default_acc_id(); } $preferences =& $mail_bo->mailPreferences; diff --git a/mail/js/app.js b/mail/js/app.js index 7846e22f39..e40213092c 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -65,7 +65,7 @@ app.classes.mail = AppJS.extend( */ init: function() { this._super.apply(this,arguments); - if (!this.egw.is_popup()) + if (!this.egw.is_popup()) // Turn on client side, persistent cache // egw.data system runs encapsulated below etemplate, so this must be // done before the nextmatch is created. @@ -166,7 +166,7 @@ app.classes.mail = AppJS.extend( case 'mail.display': this.mail_isMainWindow = false; this.mail_display(); - + // Register attachments for drag this.register_for_drag( this.et2.getArrayMgr("content").getEntry('mail_id'), @@ -751,9 +751,9 @@ app.classes.mail = AppJS.extend( var _id = this.mail_fetchCurrentlyFocussed(selected); dataElem = jQuery.extend(dataElem, egw.dataGetUIDdata(_id)); } - + var $preview_iframe = jQuery('#mail-index_mailPreviewContainer'); - + // Re calculate the position of preview iframe according to its visible sibilings var set_prev_iframe_top = function () { @@ -767,12 +767,12 @@ app.classes.mail = AppJS.extend( lastEl = lastEl.prev(); } var offset = iframeTop - (lastEl.offset().top + lastEl.height()) || 130; // fallback to 130 px if can not calculate new top - + // preview iframe parent has position absolute, therefore need to calculate the top via position $preview_iframe.css ('top', $preview_iframe.position().top - offset + 10); }, 50); - } - + }; + if (attachmentArea && typeof _id != 'undefined' && _id !='' && typeof dataElem !== 'undefined') { // If there is content to show recalculate the size @@ -1486,7 +1486,7 @@ app.classes.mail = AppJS.extend( // Tell server egw.json('mail.mail_ui.ajax_deleteMessages',[_msg,(typeof _action == 'undefined'?'no':_action)]) .sendRequest(true); - + if (_msg['all']) this.egw.refresh(this.egw.lang("deleted %1 messages in %2",(_msg['all']?egw.lang('all'):_msg['msg'].length),(displayname?displayname:egw.lang('current folder'))),'mail');//,ids,'delete'); this.egw.message(this.egw.lang("deleted %1 messages in %2",(_msg['all']?egw.lang('all'):_msg['msg'].length),(displayname?displayname:egw.lang('current Folder')))); }, @@ -3633,6 +3633,10 @@ app.classes.mail = AppJS.extend( folder:{ widget:{}, jQClass: '.mailComposeJQueryFolder' + }, + replyto:{ + widget:{}, + jQClass: '.mailComposeJQueryReplyto' }}; for(var widget in widgets) @@ -3660,33 +3664,31 @@ app.classes.mail = AppJS.extend( { var bodyH = egw_getWindowInnerHeight(); var textArea = this.et2.getWidgetById('mail_plaintext'); - var toolbar = jQuery('.mailSignature'); + var headerSec = jQuery('.mailComposeHeaderSection'); var content = this.et2.getArrayMgr('content').data; if (typeof textArea != 'undefined' && textArea != null) { - var textAreaH = textArea.node.clientHeight; if (textArea.getParent().disabled) { textArea = this.et2.getWidgetById('mail_htmltext'); - textAreaH = parseInt(textArea.getParent().node.clientHeight); } // Tolerate values base on plain text or html, in order to calculate freespaces var textAreaDelta = textArea.id == "mail_htmltext"?20:40; var delta = content.attachments? 68: textAreaDelta; - - var freeSpace = (bodyH - Math.round(toolbar.height() + toolbar.offset().top) - delta); + + var bodySize = (bodyH - Math.round(headerSec.height() + headerSec.offset().top) - delta); if (textArea.id != "mail_htmltext") { - textArea.set_height(textAreaH + freeSpace); + textArea.set_height(bodySize); } else if (typeof textArea != 'undefined' && textArea.id == 'mail_htmltext' && typeof textArea.getParent().node.children[1] != 'undefined') { - jQuery(textArea.getParent().node.children[1].children[1].children[1]).css('height',textAreaH + (freeSpace - 90)); + jQuery(textArea.getParent().node.children[1].children[1].children[1]).css('height',bodySize -90); } else { - textArea.set_height(textAreaH + (freeSpace - 90)); + textArea.set_height(bodySize - 90); } } }, @@ -3700,7 +3702,7 @@ app.classes.mail = AppJS.extend( */ compose_fieldExpander: function(event,widget) { - var expWidgets = {cc:{},bcc:{},folder:{}}; + var expWidgets = {cc:{},bcc:{},folder:{},replyto:{}}; for (var name in expWidgets) { expWidgets[name] = this.et2.getWidgetById(name+'_expander'); @@ -3730,11 +3732,19 @@ app.classes.mail = AppJS.extend( { expWidgets.folder.set_disabled(true); } + break; + case 'replyto_expander': + jQuery(".mailComposeJQueryReplyto").show(); + if (typeof expWidgets.replyto !='undefined') + { + expWidgets.replyto.set_disabled(true); + } + break; } } else if (typeof widget == "undefined") { - var widgets = {cc:{},bcc:{},folder:{}}; + var widgets = {cc:{},bcc:{},folder:{},replyto:{}}; for(var widget in widgets) { @@ -3764,6 +3774,14 @@ app.classes.mail = AppJS.extend( { expWidgets.folder.set_disabled(true); } + break; + case 'replyto': + jQuery(".mailComposeJQueryReplyto").show(); + if (typeof expWidgets.replyto != 'undefiend') + { + expWidgets.replyto.set_disabled(true); + } + break; } } } @@ -3987,11 +4005,11 @@ app.classes.mail = AppJS.extend( } }).draggable('disable'); window.setTimeout(function(){ - + if(dragItem && dragItem.data() && typeof dragItem.data()['uiDraggable'] !== 'undefined') dragItem.draggable('enable'); },100); } - + }, /** diff --git a/mail/templates/default/compose.xet b/mail/templates/default/compose.xet index 925cf928a0..298c29add1 100644 --- a/mail/templates/default/compose.xet +++ b/mail/templates/default/compose.xet @@ -2,141 +2,134 @@ diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index a7a3b1d063..06dce5310f 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -1308,7 +1308,6 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje /*Von*/ /*An*/ /*Kopie*/ - /*Blindkopie*/ /*Betreff*/ /*HTML Box*/ } @@ -1348,7 +1347,13 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje height: 30px; } #mail-compose .mailComposeHeaders span#mail-compose_cc_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander { +#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander, +#mail-compose .mailComposeHeaders span#mail-compose_bcc_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander, +#mail-compose .mailComposeHeaders span#mail-compose_folder_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander, +#mail-compose .mailComposeHeaders span#mail-compose_replyto_expander, +#mail-compose .mailComposeHeadersSection span#mail-compose_replyto_expander { /*.border_normal;*/ /*.box_shadow_standard_light;*/ /*.rounded (3px);*/ @@ -1368,81 +1373,19 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje transition-timing-function: linear; background-color: #b4b4b4; float: left; - width: 47px; + width: 55px; margin: 3px; font-size: 8px; margin-left: 12px; } #mail-compose .mailComposeHeaders span#mail-compose_cc_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander:hover { - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - background-color: #189800; - color: #ffffff; -} -#mail-compose .mailComposeHeaders span#mail-compose_bcc_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander { - /*.border_normal;*/ - /*.box_shadow_standard_light;*/ - /*.rounded (3px);*/ - color: #000000; - -webkit-appearance: none; - -webkit-transition-property: background-color; - -moz-transition-property: background-color; - -o-transition-property: background-color; - transition-property: background-color; - -webkit-transition-duration: 0.5s; - -moz-transition-duration: 0.5s; - -o-transition-duration: 0.5s; - transition-duration: 0.5s; - -webkit-transition-timing-function: linear; - -moz-transition-timing-function: linear; - -o-transition-timing-function: linear; - transition-timing-function: linear; - background-color: #b4b4b4; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; -} +#mail-compose .mailComposeHeadersSection span#mail-compose_cc_expander:hover, #mail-compose .mailComposeHeaders span#mail-compose_bcc_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander:hover { - -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); - background-color: #189800; - color: #ffffff; -} -#mail-compose .mailComposeHeaders span#mail-compose_folder_expander, -#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander { - /*.border_normal;*/ - /*.box_shadow_standard_light;*/ - /*.rounded (3px);*/ - color: #000000; - -webkit-appearance: none; - -webkit-transition-property: background-color; - -moz-transition-property: background-color; - -o-transition-property: background-color; - transition-property: background-color; - -webkit-transition-duration: 0.5s; - -moz-transition-duration: 0.5s; - -o-transition-duration: 0.5s; - transition-duration: 0.5s; - -webkit-transition-timing-function: linear; - -moz-transition-timing-function: linear; - -o-transition-timing-function: linear; - transition-timing-function: linear; - background-color: #b4b4b4; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; -} +#mail-compose .mailComposeHeadersSection span#mail-compose_bcc_expander:hover, #mail-compose .mailComposeHeaders span#mail-compose_folder_expander:hover, -#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander:hover { +#mail-compose .mailComposeHeadersSection span#mail-compose_folder_expander:hover, +#mail-compose .mailComposeHeaders span#mail-compose_replyto_expander:hover, +#mail-compose .mailComposeHeadersSection span#mail-compose_replyto_expander:hover { -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); diff --git a/mail/templates/pixelegg/app.less b/mail/templates/pixelegg/app.less index e3337135b2..9dc81ac8fd 100755 --- a/mail/templates/pixelegg/app.less +++ b/mail/templates/pixelegg/app.less @@ -589,29 +589,14 @@ div#mail-index{ /*An*/ /*Kopie*/ - span#mail-compose_cc_expander{ - .Complete_Button_normal; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; - &:hover {.box_shadow_standard_light_hover; background-color:@color_positive_action; color: @gray_0;} - } + span#mail-compose_cc_expander, /*Blindkopie*/ - span#mail-compose_bcc_expander{ - .Complete_Button_normal; - float: left; - width: 47px; - margin: 3px; - font-size: 8px; - margin-left: 12px; - &:hover {.box_shadow_standard_light_hover; background-color:@color_positive_action;color: @gray_0;} - } - span#mail-compose_folder_expander{ + span#mail-compose_bcc_expander, + span#mail-compose_folder_expander, + span#mail-compose_replyto_expander{ .Complete_Button_normal; float: left; - width: 47px; + width: 55px; margin: 3px; font-size: 8px; margin-left: 12px;