mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-02 12:26:59 +01:00
Sort assets alphabetically, highlight in the list
This commit is contained in:
parent
cd47f3b238
commit
cc077732c4
@ -109,7 +109,7 @@ function downloadAssetsList(url) {
|
|||||||
</div>`);
|
</div>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const i in availableAssets[assetType]) {
|
for (const i in availableAssets[assetType].sort((a, b) => a?.name && b?.name && a['name'].localeCompare(b['name']))) {
|
||||||
const asset = availableAssets[assetType][i];
|
const asset = availableAssets[assetType][i];
|
||||||
const elemId = `assets_install_${assetType}_${i}`;
|
const elemId = `assets_install_${assetType}_${i}`;
|
||||||
let element = $('<div />', { id: elemId, class: 'asset-download-button right_menu_button' });
|
let element = $('<div />', { id: elemId, class: 'asset-download-button right_menu_button' });
|
||||||
@ -200,6 +200,9 @@ function downloadAssetsList(url) {
|
|||||||
</div>`);
|
</div>`);
|
||||||
|
|
||||||
if (assetType === 'character') {
|
if (assetType === 'character') {
|
||||||
|
if (asset.highlight) {
|
||||||
|
assetBlock.find('.asset-name').append('<i class="fa-solid fa-sm fa-trophy"></i>');
|
||||||
|
}
|
||||||
assetBlock.find('.asset-name').prepend(`<div class="avatar"><img src="${asset['url']}" alt="${displayName}"></div>`);
|
assetBlock.find('.asset-name').prepend(`<div class="avatar"><img src="${asset['url']}" alt="${displayName}"></div>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user