# HG changeset patch # User Charlie Root # Date 1516126148 18000 # Node ID c3a974bdb435763a484964bc7b3d36d7b5844fc1 # Parent 49706603be30ef4efc47fb9937ac04d30f669d2f a bit further on flag+parm diff -r 49706603be30 -r c3a974bdb435 plugins/thunderbird_labels/tb_label.js --- a/plugins/thunderbird_labels/tb_label.js Mon Jan 15 10:29:29 2018 -0500 +++ b/plugins/thunderbird_labels/tb_label.js Tue Jan 16 13:09:08 2018 -0500 @@ -47,16 +47,26 @@ message.flags.tb_labels.sort(function(a,b) {return a-b;}); if (rcmail.env.tb_label_style=='bullets') { // bullets UI style - for (idx in message.flags.tb_labels) { - spanobj.append(""+ + parm.parm+""); + } + } } } @@ -85,6 +95,7 @@ { var headers_table = $('table.headers-table'); var preview_frame = $('#messagecontframe'); + var label_name = rcmail.env.tb_label_custom_labels[toggle_label_no]; // preview frame exists, simulate environment of single message view if (preview_frame.length) { @@ -100,7 +111,7 @@ if (onoff == true) { if (rcmail.env.tb_label_style=='bullets') { $('#labelbox').append("" + - rcmail.env.tb_label_custom_labels[toggle_label_no] + ""); + label_name + ""); } else { headers_table.addClass('label'+toggle_label_no); } diff -r 49706603be30 -r c3a974bdb435 plugins/thunderbird_labels/thunderbird_labels.php --- a/plugins/thunderbird_labels/thunderbird_labels.php Mon Jan 15 10:29:29 2018 -0500 +++ b/plugins/thunderbird_labels/thunderbird_labels.php Tue Jan 16 13:09:08 2018 -0500 @@ -330,7 +330,7 @@ { #rcube::write_log($this->name, print_r($message->flags, true)); $message->list_flags['extra_flags']['tb_labels'] = array(); # always set extra_flags, needed for javascript later! - if (is_array($message->flags)) + $message->list_flags['extra_flags']['tb_parms'] = array(); foreach ($message->flags as $flagname => $flagvalue) { $flag = is_numeric("$flagvalue")? $flagname:$flagvalue;// for compatibility with < 0.5.4 @@ -339,7 +339,15 @@ { $flag_no = preg_replace('/^\$?label/', '', $flag); rcube::write_log($this->name, "Flag:".$flag." Flag_no:".$flag_no); - $message->list_flags['extra_flags']['tb_labels'][] = (int)$flag_no; + if ($ppos = strpos($flag_no,'_') > -1) { + // We have a flag parameter value... + $message->list_flags['extra_flags']['tb_lparms'][]=array( + 'number' => substr($flag_no,0,$ppos), + 'parm' => substr($flag_no,$ppos+1)); + } + else { + $message->list_flags['extra_flags']['tb_labels'][] = (int)$flag_no; + } } } } diff -r 49706603be30 -r c3a974bdb435 skins/larry/mail.css --- a/skins/larry/mail.css Mon Jan 15 10:29:29 2018 -0500 +++ b/skins/larry/mail.css Tue Jan 16 13:09:08 2018 -0500 @@ -264,9 +264,12 @@ } .messagelist tr > .date { - width: 155px; + width: 100px; } +.messagelist tr > .dates { + width: 100px; +} .messagelist tr > .folder { width: 135px; } diff -r 49706603be30 -r c3a974bdb435 skins/larry/templates/mail.html --- a/skins/larry/templates/mail.html Mon Jan 15 10:29:29 2018 -0500 +++ b/skins/larry/templates/mail.html Tue Jan 16 13:09:08 2018 -0500 @@ -216,6 +216,7 @@
"); - } - } else { - // thunderbird UI style - for (idx in message.flags.tb_labels) { - rowobj.addClass('label' + message.flags.tb_labels[idx]); - } - } - } + for (idx in message.flags.tb_labels) { + spanobj.append(" "); + } + } else { + // thunderbird UI style + for (idx in message.flags.tb_labels) { + rowobj.addClass('label' + message.flags.tb_labels[idx]); + } + } + } + } + if (message.flags && message.flags.tb_lparms) { + if (message.flags.tb_lparms.length) { + for (parm in message.flags.tb_lparms) { + col="dates"; // should look up parm.number somewhere FIXME + var tdobj = rowobj.find("td."+col); + tdobj.append("