From 1a85c7a672b790232ee7f0b27b8a6a05945d6570 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Tue, 23 Oct 2007 22:04:15 +0000 Subject: [PATCH] Look improvements. Can identify unread message and switch from a message to another via the tree. Signed-off-by: Florent Bruneau git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@280 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/spool.inc.php | 48 +++++++++++++++++++++----------- banana/templates/banana-message.inc.tpl | 2 +- css/style.css | 19 +++++++++++++ img/T2.gif | Bin 0 -> 113 bytes img/T2r.gif | Bin 0 -> 113 bytes img/f2.gif | Bin 0 -> 121 bytes img/f2r.gif | Bin 0 -> 121 bytes img/h2.gif | Bin 0 -> 105 bytes img/h2r.gif | Bin 0 -> 105 bytes img/l2.gif | Bin 0 -> 119 bytes img/l2r.gif | Bin 0 -> 119 bytes img/t2.gif | Bin 0 -> 115 bytes img/t2r.gif | Bin 0 -> 115 bytes 13 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 img/T2.gif create mode 100644 img/T2r.gif create mode 100644 img/f2.gif create mode 100644 img/f2r.gif create mode 100644 img/h2.gif create mode 100644 img/h2r.gif create mode 100644 img/l2.gif create mode 100644 img/l2r.gif create mode 100644 img/t2.gif create mode 100644 img/t2r.gif diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 2ce0755..6ce1751 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -9,7 +9,7 @@ require_once dirname(__FILE__) . '/banana.inc.php'; -define('BANANA_SPOOL_VERSION', '0.6'); +define('BANANA_SPOOL_VERSION', '0.5.1'); /** Class spoolhead * class used in thread overviews @@ -542,30 +542,46 @@ class BananaSpool public function _buildTree($id, BananaSpoolHead &$head, $current) { - $style = 'color:' . $head->color . '; text-decoration: none'; + static $t_e, $u_h, $u_ht, $u_vt, $u_l, $u_f, $r_h, $r_ht, $r_vt, $r_l, $r_f; + if (!isset($spfx_f)) { + $t_e = Banana::$page->makeImg(Array('img' => 'e', 'alt' => ' ', 'height' => 18, 'width' => 14)); + $u_h = Banana::$page->makeImg(Array('img' => 'h2', 'alt' => '-', 'height' => 18, 'width' => 14)); + $u_ht = Banana::$page->makeImg(Array('img' => 'T2', 'alt' => '+', 'height' => 18, 'width' => 14)); + $u_vt = Banana::$page->makeImg(Array('img' => 't2', 'alt' => '`', 'height' => 18, 'width' => 14)); + $u_l = Banana::$page->makeImg(Array('img' => 'l2', 'alt' => '|', 'height' => 18, 'width' => 14)); + $u_f = Banana::$page->makeImg(Array('img' => 'f2', 'alt' => 't', 'height' => 18, 'width' => 14)); + $r_h = Banana::$page->makeImg(Array('img' => 'h2r', 'alt' => '-', 'height' => 18, 'width' => 14)); + $r_ht = Banana::$page->makeImg(Array('img' => 'T2r', 'alt' => '+', 'height' => 18, 'width' => 14)); + $r_vt = Banana::$page->makeImg(Array('img' => 't2r', 'alt' => '`', 'height' => 18, 'width' => 14)); + $r_l = Banana::$page->makeImg(Array('img' => 'l2r', 'alt' => '|', 'height' => 18, 'width' => 14)); + $r_f = Banana::$page->makeImg(Array('img' => 'f2r', 'alt' => 't', 'height' => 18, 'width' => 14)); + } + $style = 'background-color:' . $head->color . '; text-decoration: none'; $prof = 1; - if ($id == $current) { - $text = "0"; - } else { - $text = Banana::$page->makeLink(Array('group' => $this->group, 'artid' => $id, - 'text' => 'o', 'popup' => $head->from, - 'style' => $style)); - } + $text = '' . + '' . + ''; $array = array($text); foreach ($head->children as $key=>&$child) { - list($tpr, $tree) = $this->_buildTree($child, $this->overview[$child], $current); + $msg =& $this->overview[$child]; + list($tpr, $tree) = $this->_buildTree($child, $msg, $current); $last = $key == count($head->children) - 1; foreach ($tree as $kt=>&$line) { - if ($kt == 0 && $key == 0) { - $array[0] .= '--' . $line; + if ($kt == 0 && $key == 0 && !$last) { + $array[0] .= ($msg->isread ? $r_ht : $u_ht) . $line; + } else if($kt == 0 && $key == 0) { + $array[0] .= ($msg->isread ? $r_h : $u_h) . $line; } else if ($kt == 0 && $last) { - $array[] = ' !-' . $line; + $array[] = $t_e . ($msg->isread ? $r_vt : $u_vt) . $line; } else if ($kt == 0) { - $array[] = ' |-' . $line; + $array[] = $t_e . ($msg->isread ? $r_f : $u_f) . $line; } else if ($last) { - $array[] = ' ' . $line; + $array[] = $t_e . $t_e . $line; } else { - $array[] = ' | ' . $line; + $array[] = $t_e . ($msg->isread ? $r_l : $u_l) . $line; } } if ($tpr > $prof) { diff --git a/banana/templates/banana-message.inc.tpl b/banana/templates/banana-message.inc.tpl index 161ccda..94d7fa7 100644 --- a/banana/templates/banana-message.inc.tpl +++ b/banana/templates/banana-message.inc.tpl @@ -1,4 +1,4 @@ -
+
 {$spool->buildTree($artid)|smarty:nodefaults}
 
diff --git a/css/style.css b/css/style.css index 7654978..98f6b67 100644 --- a/css/style.css +++ b/css/style.css @@ -72,6 +72,25 @@ background-color: #fff; } +.banana pre.thread_tree { + overflow: scroll; +} + +.banana .thread_tree input { + width: 14px; + height: 14px; + padding: 2px 0; + margin: 0; +} + +.banana .thread_tree img { + margin: 0; + padding: 0; + width: 14px; + height: 18px; +} + + /** MISC **/ .banana .center { text-align: center; padding: 1em; } diff --git a/img/T2.gif b/img/T2.gif new file mode 100644 index 0000000000000000000000000000000000000000..346556655a8a06cd107b64696b03c179cd18cbdd GIT binary patch literal 113 zcmZ?wbhEHb4 bf<|9T=A^J4E2U=dl=#!AefL%{3xhQPKvo!h literal 0 HcmV?d00001 diff --git a/img/T2r.gif b/img/T2r.gif new file mode 100644 index 0000000000000000000000000000000000000000..df32793ce29af66904b9fe70cac36f6e6a3cf0b0 GIT binary patch literal 113 zcmZ?wbhEHbIbM;<}*Jpo= cCTR4fWKIg(u~KUGPKiH_+IMdSvoKf#0EtBy`v3p{ literal 0 HcmV?d00001 diff --git a/img/f2.gif b/img/f2.gif new file mode 100644 index 0000000000000000000000000000000000000000..a056c87610c08680cb723fa590dd19d8c92ce9ef GIT binary patch literal 121 zcmZ?wbhEHb95S^m)j=jF)>&J01jg%I{*Lx literal 0 HcmV?d00001 diff --git a/img/f2r.gif b/img/f2r.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc6048bbdbbc9336d21d3becdc7da4ab2af66e44 GIT binary patch literal 121 zcmZ?wbhEHbOk2KUt@MdWH*X)?%ys+g^jGHd%WV_%m>8@9<)kDd literal 0 HcmV?d00001 diff --git a/img/h2.gif b/img/h2.gif new file mode 100644 index 0000000000000000000000000000000000000000..16fbff85c8ea1b192dc6e0d94e1194485712273a GIT binary patch literal 105 zcmZ?wbhEHbT9>3=v gxkzN%@)>p6?u*t-ZQi_lsss16-@LykaWGf|0MqarJOBUy literal 0 HcmV?d00001 diff --git a/img/t2.gif b/img/t2.gif new file mode 100644 index 0000000000000000000000000000000000000000..f66bc3cad31a8594b7292c8642288ec61847e347 GIT binary patch literal 115 zcmZ?wbhEHb!#LriIw%eUCJ$}zU ba*@ciTVYHuXKsCUeO*cJ{fc$*f(+IGl(8Ey literal 0 HcmV?d00001 diff --git a/img/t2r.gif b/img/t2r.gif new file mode 100644 index 0000000000000000000000000000000000000000..d767daed4e6c3229cccc62426ac7012749ce6db9 GIT binary patch literal 115 zcmZ?wbhEHb!gygF|+u6>T9>3=v bxkzN%tuUsSGq=9FzOE$qe#N?YK?Z98a*-Ms literal 0 HcmV?d00001 -- 2.1.4