Plugin Directory


Ignore:
Timestamp:
10/24/2026 11:12:46 AM (6 days ago)
Author:
mxchat
Message:

Release 3.2.27 - security hardening, lead auto-delete, xAI image generation, Complianz consent for embedded chats, transcript, model, sync and layout fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mxchat-basic/trunk/js/content-selector.js

    r3751971 r3763174  
    265265}
    266266
    267 function showWords(id, words) {
     267function showWords(id, words, excerpt) {
    268268    const item = allItems.find(function(i) { return i.id === id; });
    269269    if (item) {
    … …  
    272272    }
    273273    const shown = item ? item.word_count : words;
     274    const $row = $contentList.find('.mxchat-kb-content-item[data-id="' + id + '"]');
    274275    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));
    276282    }
    277283}
    … …  
    309315            return;
    310316        }
     317        const excerpts = (response.data && response.data.excerpts) || {};
    311318        // Ids the server had no time for go back to the front of the queue.
    312319        const missed = [];
    313320        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            }
    315326        });
    316327        if (missed.length === batch.length) {
Note: See TracChangeset for help on using the changeset viewer.