From: Michael M Slusarz Date: Sun, 18 Jan 2009 03:04:19 +0000 (-0700) Subject: Finish Event cleanup for compose screen. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=923522b28625a77b720cab3aa49ef2c740901d3a;p=horde.git Finish Event cleanup for compose screen. Also, improved the compose attachment view code. --- diff --git a/imp/js/src/compose-dimp.js b/imp/js/src/compose-dimp.js index 9b643dcbe..d10c7c225 100644 --- a/imp/js/src/compose-dimp.js +++ b/imp/js/src/compose-dimp.js @@ -499,6 +499,10 @@ var DimpCompose = { div.insert(input); $('attach_list').insert(div); + if (type != 'application/octet-stream') { + span.addClassName('attachName'); + } + this.resizeMsgArea(); }, @@ -635,7 +639,7 @@ var DimpCompose = { return; } - var elt = e.element(), id, tmp; + var elt = orig = e.element(), atc_num, id; while (Object.isElement(elt)) { id = elt.readAttribute('id'); @@ -659,20 +663,24 @@ var DimpCompose = { case 'htmlcheckbox': this.toggleHtmlCheckbox(); break; - } - /* - if (DIMP.conf_compose.abook_url) { - $('sendto', 'sendcc', 'sendbcc').each(function(a) { - C({ d: a.down('TD.label SPAN').addClassName('composeAddrbook'), f: DC.openAddressbook.bind(DC) }); - }); - } + case 'sendcc': + case 'sendbcc': + case 'sendto': + if (orig.match('TD.label SPAN')) { + this.openAddressbook(); + } + break; - C({ d: input, f: this.removeAttach.bind(this, [ input.up() ]) }); - if (type != 'application/octet-stream') { - C({ d: span.addClassName('attachName'), f: function() { view(DimpCore.addURLParam(DIMP.conf.URI_VIEW, { composeCache: $F('composeCache'), actionID: 'compose_attach_preview', id: atc_num }), $F('composeCache') + '|' + atc_num) } }); - } - */ + case 'attach_list': + if (orig.match('INPUT')) { + this.removeAttach([ orig.up() ]); + } else if (orig.match('SPAN.attachName')) { + atc_num = orig.next().readAttribute('atc_id'); + DimpCore.popupWindow(DimpCore.addURLParam(DIMP.conf.URI_VIEW, { composeCache: $F('composeCache'), actionID: 'compose_attach_preview', id: atc_num }), $F('composeCache') + '|' + atc_num); + } + break; + } elt = elt.up(); } @@ -741,6 +749,13 @@ document.observe('dom:loaded', function() { $('submit_frame').writeAttribute({ position: 'absolute', width: '1px', height: '1px' }).setStyle({ left: '-999px' }).show(); } + /* Add addressbook link formatting. */ + if (DIMP.conf_compose.abook_url) { + $('sendto', 'sendcc', 'sendbcc').each(function(a) { + a.down('TD.label SPAN').addClassName('composeAddrbook'); + }); + } + /* Mouse click handler. */ document.observe('click', DC._clickHandler.bindAsEventListener(DC)); diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 7acdd3686..7e099dcbf 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -867,9 +867,8 @@ div.spellcheck { } #attach_list input { background: none; - border: none; + border: 1px solid #ccc; font-weight: bold; - text-decoration: underline; } #attach_list div { background: transparent url("graphics/attachment.png") left 2px no-repeat; @@ -877,12 +876,12 @@ div.spellcheck { padding-left: 20px; } -#attachName span { +span.attachName { text-decoration: underline; cursor: pointer; } -#attachName span:hover { - font-weight: bold; +span.attachName:hover { + color: red; } /* Context Menus */