From 1a87599e8ab748b29cab9f6cf6b2188ca76f4714 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 2 Apr 2009 15:17:33 -0600 Subject: [PATCH] Add user defined flagging to dimp view --- imp/js/src/DimpBase.js | 23 ++++++++++++++++------- imp/lib/DIMP.php | 4 +++- imp/themes/screen-dimp.css | 5 +++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 41bc7eae6..e7bd95ffe 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -2208,13 +2208,22 @@ var DimpBase = { row.flag.each(function(a) { var ptr = DIMP.conf.flags[a]; - if (!ptr.elt) { - ptr.elt = new Element('DIV', { className: 'msgflags ' + ptr.c, title: ptr.l }); - } - r.addClassName(ptr.c); - f.appendChild(ptr.elt.cloneNode(false)); - if (ptr.b) { - bg = ptr.b; + if (ptr.p) { + if (!ptr.elt) { + // Until text-overflow is supported on all browsers, + // need to truncate label text ourselves. + ptr.elt = new Element('SPAN', { className: ptr.c, title: ptr.l }).setStyle({ background: ptr.b }).update(ptr.l.truncate(10)); + } + r.down('.msgSubject').insert({ top: ptr.elt.cloneNode(true) }); + } else { + if (!ptr.elt) { + ptr.elt = new Element('DIV', { className: 'msgflags ' + ptr.c, title: ptr.l }); + } + r.addClassName(ptr.c); + f.appendChild(ptr.elt.cloneNode(false)); + if (ptr.b) { + bg = ptr.b; + } } }); diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 58ce01789..84de294aa 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -155,7 +155,9 @@ class DIMP $flags[$val['flag']] = array_filter(array( 'b' => isset($val['b']) ? $val['b'] : null, 'c' => $val['c'], - 'l' => $val['l'] + 'l' => $val['l'], + // Indicate if this is a user *P*ref flag + 'p' => intval($val['t'] == 'imapp') )); } diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 375dd254c..5df7eba06 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -1009,6 +1009,11 @@ span.dimpactionDrafts { width: 15px; border: 1px black solid; } +div.msgRow div.msgSubject span.flagUser { + border: 1px black solid; + font-size: 90%; + margin-right: 3px; +} /* Thread images */ span.threadImg { -- 2.11.0