Changeset 3763174 for mxchat-basic/trunk/js/content-selector.js
- Timestamp:
- 10/24/2026 11:12:46 AM (6 days ago)
- File:
-
- 1 edited
-
mxchat-basic/trunk/js/content-selector.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mxchat-basic/trunk/js/content-selector.js
r3751971 r3763174 265 265 } 266 266 267 function showWords(id, words ) {267 function showWords(id, words, excerpt) { 268 268 const item = allItems.find(function(i) { return i.id === id; }); 269 269 if (item) { … … 272 272 } 273 273 const shown = item ? item.word_count : words; 274 const $row = $contentList.find('.mxchat-kb-content-item[data-id="' + id + '"]'); 274 275 if (shown !== null && shown !== undefined) { 275 $contentList.find('.mxchat-kb-content-item[data-id="' + id + '"] .mxchat-kb-content-words').text(shown + ' words'); 276 $row.find('.mxchat-kb-content-words').text(shown + ' words'); 277 } 278 // The excerpt read from the same text as the count (plan 4e8976), shown as text. 279 if (typeof excerpt === 'string') { 280 if (item) { item.excerpt = excerpt; } 281 $row.find('.mxchat-kb-content-excerpt').text(decodeEntities(excerpt)); 276 282 } 277 283 } … … 309 315 return; 310 316 } 317 const excerpts = (response.data && response.data.excerpts) || {}; 311 318 // Ids the server had no time for go back to the front of the queue. 312 319 const missed = []; 313 320 batch.forEach(function(id) { 314 if (Object.prototype.hasOwnProperty.call(counts, id)) { showWords(id, counts[id]); } else { missed.push(id); } 321 if (Object.prototype.hasOwnProperty.call(counts, id)) { 322 showWords(id, counts[id], Object.prototype.hasOwnProperty.call(excerpts, id) ? excerpts[id] : undefined); 323 } else { 324 missed.push(id); 325 } 315 326 }); 316 327 if (missed.length === batch.length) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)