Grade comments: mark suggestion tone with colored icon and left border
This commit is contained in:
@@ -106,8 +106,16 @@ function attachCommentAutocomplete(input) {
|
||||
list.innerHTML = '';
|
||||
items.forEach(function (item) {
|
||||
var count = parseInt(item.count || 0, 10) || 0;
|
||||
var tone = String(item.tone || 'neutral').toLowerCase();
|
||||
var toneKey = tone.indexOf('pos') === 0 ? 'pos' : (tone.indexOf('neg') === 0 ? 'neg' : 'neu');
|
||||
var row = document.createElement('div');
|
||||
row.className = 'ac-item';
|
||||
row.className = 'ac-item ac-' + toneKey;
|
||||
|
||||
var mark = document.createElement('span');
|
||||
mark.className = 'ac-tone ac-tone-' + toneKey;
|
||||
mark.textContent = toneKey === 'pos' ? '+' : (toneKey === 'neg' ? '—' : '○');
|
||||
mark.title = toneKey === 'pos' ? 'Позитивный' : (toneKey === 'neg' ? 'Негативный' : 'Нейтральный');
|
||||
row.appendChild(mark);
|
||||
|
||||
var text = document.createElement('span');
|
||||
text.className = 'ac-text';
|
||||
|
||||
Reference in New Issue
Block a user