Grade comments: mark suggestion tone with colored icon and left border

This commit is contained in:
2026-09-29 17:55:34 +03:00
parent c0c150b4b9
commit c395a92b7f
2 changed files with 23 additions and 2 deletions

View File

@@ -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';