comparison plugins/thunderbird_labels/tb_label.js @ 20:c3a974bdb435

a bit further on flag+parm
author Charlie Root
date Tue, 16 Jan 2018 13:09:08 -0500
parents 7a7f68b4358e
children 61316094e61d
comparison
equal deleted inserted replaced
19:49706603be30 20:c3a974bdb435
45 if (message.flags.tb_labels.length) { 45 if (message.flags.tb_labels.length) {
46 var spanobj = rowobj.find("td.subject span.tb_label_dots"); 46 var spanobj = rowobj.find("td.subject span.tb_label_dots");
47 message.flags.tb_labels.sort(function(a,b) {return a-b;}); 47 message.flags.tb_labels.sort(function(a,b) {return a-b;});
48 if (rcmail.env.tb_label_style=='bullets') { 48 if (rcmail.env.tb_label_style=='bullets') {
49 // bullets UI style 49 // bullets UI style
50 for (idx in message.flags.tb_labels) { 50 for (idx in message.flags.tb_labels) {
51 spanobj.append("<span class='label"+message.flags.tb_labels[idx]+"'>&#8226;</span>"); 51 spanobj.append("<span class='label"+message.flags.tb_labels[idx]+"'>&#8226;</span>");
52 } 52 }
53 } else { 53 } else {
54 // thunderbird UI style 54 // thunderbird UI style
55 for (idx in message.flags.tb_labels) { 55 for (idx in message.flags.tb_labels) {
56 rowobj.addClass('label' + message.flags.tb_labels[idx]); 56 rowobj.addClass('label' + message.flags.tb_labels[idx]);
57 } 57 }
58 } 58 }
59 } 59 }
60 }
61 if (message.flags && message.flags.tb_lparms) {
62 if (message.flags.tb_lparms.length) {
63 for (parm in message.flags.tb_lparms) {
64 col="dates"; // should look up parm.number somewhere FIXME
65 var tdobj = rowobj.find("td."+col);
66 tdobj.append("<span class='labelparm"+parm.number+"'>"+
67 parm.parm+"</span>");
68 }
69 }
60 } 70 }
61 } 71 }
62 72
63 /** 73 /**
64 * Shows the submenu of thunderbird labels 74 * Shows the submenu of thunderbird labels
83 93
84 function rcm_tb_label_flag_toggle(flag_uids, toggle_label_no, onoff) 94 function rcm_tb_label_flag_toggle(flag_uids, toggle_label_no, onoff)
85 { 95 {
86 var headers_table = $('table.headers-table'); 96 var headers_table = $('table.headers-table');
87 var preview_frame = $('#messagecontframe'); 97 var preview_frame = $('#messagecontframe');
98 var label_name = rcmail.env.tb_label_custom_labels[toggle_label_no];
88 // preview frame exists, simulate environment of single message view 99 // preview frame exists, simulate environment of single message view
89 if (preview_frame.length) 100 if (preview_frame.length)
90 { 101 {
91 tb_labels_for_message = preview_frame.get(0).contentWindow.tb_labels_for_message; 102 tb_labels_for_message = preview_frame.get(0).contentWindow.tb_labels_for_message;
92 headers_table = preview_frame.contents().find('table.headers-table'); 103 headers_table = preview_frame.contents().find('table.headers-table');
98 // for single message view 109 // for single message view
99 if (headers_table.length && flag_uids.length) { 110 if (headers_table.length && flag_uids.length) {
100 if (onoff == true) { 111 if (onoff == true) {
101 if (rcmail.env.tb_label_style=='bullets') { 112 if (rcmail.env.tb_label_style=='bullets') {
102 $('#labelbox').append("<span class='tb_label_span"+toggle_label_no+"'>" + 113 $('#labelbox').append("<span class='tb_label_span"+toggle_label_no+"'>" +
103 rcmail.env.tb_label_custom_labels[toggle_label_no] + "</span>"); 114 label_name + "</span>");
104 } else { 115 } else {
105 headers_table.addClass('label'+toggle_label_no); 116 headers_table.addClass('label'+toggle_label_no);
106 } 117 }
107 // add to flag list 118 // add to flag list
108 tb_labels_for_message.push(toggle_label_no); 119 tb_labels_for_message.push(toggle_label_no);