Add user defined flagging to dimp view
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Apr 2009 21:17:33 +0000 (15:17 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Apr 2009 21:17:33 +0000 (15:17 -0600)
imp/js/src/DimpBase.js
imp/lib/DIMP.php
imp/themes/screen-dimp.css

index 41bc7ea..e7bd95f 100644 (file)
@@ -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;
+                }
             }
         });
 
index 58ce017..84de294 100644 (file)
@@ -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')
             ));
         }
 
index 375dd25..5df7eba 100644 (file)
@@ -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 {