From c0b2f2e1518ca3ccf46ff3daaf35972ff05b5a07 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 19 May 2008 18:35:21 +0000 Subject: [PATCH] if we have javascript available, use that to toggle more/less links. This is faster (instantaneous) and saves a full reload of the page on the server. If no JS keep old behaviour. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13157 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- templates/default/css/default.css | 7 ++++++ templates/default/js/default.js | 14 ++++++++++++ templates/default/read_recipient_list.tpl | 26 +++++++++++++++-------- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/templates/default/css/default.css b/templates/default/css/default.css index caffe3a7..1a89b89d 100644 --- a/templates/default/css/default.css +++ b/templates/default/css/default.css @@ -1078,3 +1078,10 @@ div.viewText td.spacer { padding: 1em; font-size: x-large; } + +#recpt_tail_to, #recpt_tail_cc { + display: none; +} +#toggle_to, #toggle_cc { + font-size: smaller; +} diff --git a/templates/default/js/default.js b/templates/default/js/default.js index 4c7b9e89..2c045a36 100644 --- a/templates/default/js/default.js +++ b/templates/default/js/default.js @@ -289,3 +289,17 @@ function printThis() parent.frames['right'].focus(); parent.frames['right'].print(); } + +/* JS implementation of more/less links in To/CC. Could later be extended + * show/hide other interface items */ +function showhide (item, txtmore, txtless) { + var oTemp=document.getElementById("recpt_tail_" + item); + var oClick=document.getElementById("toggle_" + item); + if (oTemp.style.display=="inline") { + oTemp.style.display="none"; + oClick.innerHTML=txtmore; + } else { + oTemp.style.display="inline"; + oClick.innerHTML=txtless; + } +} diff --git a/templates/default/read_recipient_list.tpl b/templates/default/read_recipient_list.tpl index 99a1c524..a50b7f28 100644 --- a/templates/default/read_recipient_list.tpl +++ b/templates/default/read_recipient_list.tpl @@ -31,25 +31,33 @@ extract($t); /** Begin template **/ $count = 0; +echo ""; + foreach ($recipients as $r) { $count++; - if ($count > 3 && !$show_more) - continue; + echo $r['Full']; if ($count != count($recipients)) { echo ", \n "; } + if (!$show_more && $count == 3) { + echo ""; + } } +echo "\n"; + if (count($recipients) > 3) { - if ($show_more) { - ?> - () - () - " . + ($show_more ? _("less") : _("more") ) . + ")"; } -- 2.25.1