From: wolfgang Date: Wed, 8 Aug 2007 21:37:57 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1145 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=472f43e8a006804c1577babb654ba9f6fc555b1d;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1145 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/NEWS b/NEWS index 6df7a028..b4726756 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ - added support for limiting LDAP queries with the SOGoLDAPQueryLimit and the SOGoLDAPSizeLimit settings; - fixed a bug where folders starting with digits would not be displayed; -- improved IE7 and Safari support: priority menus, attendees selector. +- improved IE7 and Safari support: priority menus, attendees selector; +- added the ability to print messages from the mailer toolbar; 0.9.0-20070713 -------------- diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index e00c4c37..f253e9c3 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -128,3 +128,6 @@ "Operation failed" = "Operation failed"; "quotasFormat" = "Quotas: %{0} used on %{1} Kb; %{2}%"; + +"Please select a message to print." = "Please select a message to print."; +"Please select only one message to print." = "Please select only one message to print."; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index eb928182..1c604684 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -178,3 +178,6 @@ "Operation failed" = "L'opération a échoué."; "quotasFormat" = "Quotas: %{0} Ko utilisés sur %{1}; %{2}%"; + +"Please select a message to print." = "Veuillez sélectionner un message à imprimer."; +"Please select only one message to print." = "Veuillez ne sélectionner qu'un seul message à imprimer."; diff --git a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar index a54ae3a0..8df3661d 100644 --- a/UI/MailerUI/Toolbars/SOGoMailObject.toolbar +++ b/UI/MailerUI/Toolbars/SOGoMailObject.toolbar @@ -53,6 +53,7 @@ ), ( { link = "#"; + onclick = "return onPrintCurrentMessage(event);"; cssClass = "tbicon_print"; image = "tb-mail-print-flat-24x24.png"; label = "Print"; }, diff --git a/UI/WebServerResources/HTMLElement.js b/UI/WebServerResources/HTMLElement.js index 5cf668d6..f93d1fb8 100644 --- a/UI/WebServerResources/HTMLElement.js +++ b/UI/WebServerResources/HTMLElement.js @@ -125,8 +125,8 @@ Element.addMethods({ if (document.currentPopupMenu) hideMenu(document.currentPopupMenu); - var menuTop = event.pageY; - var menuLeft = event.pageX; + var menuTop = Event.pointerY(event); + var menuLeft = Event.pointerX(event); var heightDiff = (window.innerHeight - (menuTop + popup.offsetHeight)); if (heightDiff < 0) diff --git a/UI/WebServerResources/MailerUI.css b/UI/WebServerResources/MailerUI.css index 4d19b7ef..e4ecc897 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -182,7 +182,7 @@ TABLE.titletable padding-left: 6px; } -TABLE.titletable td.titlecell SELECT +TABLE.titletable TD.titlecell SELECT { display: -moz-popup; border-top: 1px solid #fff; @@ -222,7 +222,7 @@ span.mailer_datefield white-space: nowrap; } -td.mailer_readmailsubject +TD.mailer_readmailsubject { background-image: url(message-mail-read.png) !important; background-repeat: no-repeat !important; @@ -230,7 +230,7 @@ td.mailer_readmailsubject padding-left: 20px !important; } -td.mailer_unreadmailsubject +TD.mailer_unreadmailsubject { background-image: url(message-mail.png) !important; background-repeat: no-repeat !important; @@ -239,13 +239,13 @@ td.mailer_unreadmailsubject font-weight: bold !important; } -td.mailer_readmailsubject a +TD.mailer_readmailsubject a { color: black; text-decoration: none; } -td.mailer_unreadmailsubject a +TD.mailer_unreadmailsubject a { color: black; text-decoration: none; @@ -326,7 +326,7 @@ DIV.mailer_mailcontent bottom: 0px; } -td.mailer_fieldname +TD.mailer_fieldname { white-space: nowrap; padding: 0 1em; @@ -336,16 +336,17 @@ td.mailer_fieldname width: 6em; } -td.mailer_fieldvalue +TD.mailer_fieldvalue { + vertical-align: top; } -td.mailer_subjectfieldvalue +TD.mailer_subjectfieldvalue { font-weight: bold; } -td.mailer_fieldvalue a +TD.mailer_fieldvalue a { text-decoration: underline; vertical-align: top; @@ -405,7 +406,7 @@ div#attachment_upload padding: 4px; } -td.attachment_uplabel +TD.attachment_uplabel { width: 15%; text-align: left; @@ -499,8 +500,8 @@ TABLE#messageList TD.messageFlagColumn TD#subjectHeader, TABLE#messageList TD.tbtv_subject_headercell, -TABLE#messageList td.mailer_unreadmailsubject, -TABLE#messageList td.mailer_readmailsubject +TABLE#messageList TD.mailer_unreadmailsubject, +TABLE#messageList TD.mailer_readmailsubject { width: 40%; min-width: 40%; } @@ -545,3 +546,49 @@ DIV#rightDragHandle right: 0px; height: 5px; } + +@media print +{ + DIV#leftPanel, + DIV#verticalDragHandle, + DIV#filterPanel, + DIV#mailboxContent, + DIV.dragHandle + { display: none; } + + DIV#rightPanel + { position: static; + overflow: visible; + margin: 0px; } + + DIV#messageContent + { position: static; + border: 0px; + margin: 0px; + overflow: visible; } + + TABLE.mailer_fieldtable + { border: 0px; + font-family: serif; + height: auto; + overflow: visible; } + + TD.mailer_fieldname + { text-align: left; + width: auto; } + + TD.mailer_fieldvalue + { white-space: normal; } + + TD.mailer_fieldvalue A + { text-decoration: none; + white-space: nowrap; + color: #000; } + + A:visited + { color: #00f; } + + DIV.mailer_mailcontent + { position: static; + overflow: visible; } +} diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index dba1bfe4..c390268a 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -320,6 +320,20 @@ function onMenuDeleteMessage(event) { preventDefault(event); } +function onPrintCurrentMessage(event) { + var rowIds = $("messageList").getSelectedRowsId(); + if (rowIds.length == 0) { + window.alert(labels["Please select a message to print."].decodeEntities()); + } + else if (rowIds.length > 1) { + window.alert(labels["Please select only one message to print."].decodeEntities()); + } + else + window.print(); + + preventDefault(event); +} + function onMailboxTreeItemClick(event) { var topNode = $("mailboxTree"); var mailbox = this.parentNode.getAttribute("dataname"); diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index a9e6b37c..4eb2c9a4 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -264,4 +264,4 @@ function onSelectAllAttachments() { nodes[i].select(); } -window.addEventListener("load", initMailEditor, false); +addEvent(window, 'load', initMailEditor); diff --git a/UI/WebServerResources/UIxMailPopupView.js b/UI/WebServerResources/UIxMailPopupView.js new file mode 100644 index 00000000..14f04fec --- /dev/null +++ b/UI/WebServerResources/UIxMailPopupView.js @@ -0,0 +1,5 @@ +function onPrintCurrentMessage(event) { + window.print(); + + preventDefault(event); +} diff --git a/UI/WebServerResources/UIxMailToSelection.js b/UI/WebServerResources/UIxMailToSelection.js index e5e01a70..663573ec 100644 --- a/UI/WebServerResources/UIxMailToSelection.js +++ b/UI/WebServerResources/UIxMailToSelection.js @@ -105,10 +105,10 @@ function fancyAddRow(shouldEdit, text) { // select popup var rowNodes = row.childNodesWithTag("span"); - select = rowNodes[0].childNodesWithTag("select")[0]; + select = $(rowNodes[0]).childNodesWithTag("select")[0]; select.name = 'popup_' + currentIndex; // select.value = row.childNodesWithTag("span")[0].childNodesWithTag("select")[0].value; - input = rowNodes[1].childNodesWithTag("input")[0]; + input = $(rowNodes[1]).childNodesWithTag("input")[0]; input.name = 'addr_' + currentIndex; input.id = 'addr_' + currentIndex; input.value = text; diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index e1a0f2d3..908ef54d 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -690,3 +690,19 @@ INPUT.checkBox -moz-border-left-colors: #000 #fff; -moz-border-bottom-colors: #000 #fff; -moz-border-right-colors: #000 #fff; } + +@media print +{ + BODY + { position: static; + font-size: 25%; + height: auto; + overflow: visible; } + + DIV#logConsole, + DIV#linkBanner, + DIV#toolbar, + DIV.menu, + DIV.tabsContainer + { display: none; } +}