Indicates extensions that add tools in the list
This commit is contained in:
parent
a4256ccf57
commit
f7ec2e47d6
|
@ -184,6 +184,7 @@ function downloadAssetsList(url) {
|
||||||
const url = isValidUrl(asset['url']) ? asset['url'] : '';
|
const url = isValidUrl(asset['url']) ? asset['url'] : '';
|
||||||
const title = assetType === 'extension' ? `Extension repo/guide: ${url}` : 'Preview in browser';
|
const title = assetType === 'extension' ? `Extension repo/guide: ${url}` : 'Preview in browser';
|
||||||
const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
|
const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
|
||||||
|
const toolTag = assetType === 'extension' && asset['tool'];
|
||||||
|
|
||||||
const assetBlock = $('<i></i>')
|
const assetBlock = $('<i></i>')
|
||||||
.append(element)
|
.append(element)
|
||||||
|
@ -193,12 +194,20 @@ function downloadAssetsList(url) {
|
||||||
<a class="asset_preview" href="${url}" target="_blank" title="${title}">
|
<a class="asset_preview" href="${url}" target="_blank" title="${title}">
|
||||||
<i class="fa-solid fa-sm ${previewIcon}"></i>
|
<i class="fa-solid fa-sm ${previewIcon}"></i>
|
||||||
</a>
|
</a>
|
||||||
|
${toolTag ? '<span class="tag" title="Adds a function tool"><i class="fa-solid fa-sm fa-wrench"></i> Tool</span>' : ''}
|
||||||
</span>
|
</span>
|
||||||
<small class="asset-description">
|
<small class="asset-description">
|
||||||
${description}
|
${description}
|
||||||
</small>
|
</small>
|
||||||
</div>`);
|
</div>`);
|
||||||
|
|
||||||
|
assetBlock.find('.tag').on('click', function (e) {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = 'https://docs.sillytavern.app/for-contributors/function-calling/';
|
||||||
|
a.target = '_blank';
|
||||||
|
a.click();
|
||||||
|
});
|
||||||
|
|
||||||
if (assetType === 'character') {
|
if (assetType === 'character') {
|
||||||
if (asset.highlight) {
|
if (asset.highlight) {
|
||||||
assetBlock.find('.asset-name').append('<i class="fa-solid fa-sm fa-trophy"></i>');
|
assetBlock.find('.asset-name').append('<i class="fa-solid fa-sm fa-trophy"></i>');
|
||||||
|
|
|
@ -164,3 +164,12 @@
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.asset-name .tag {
|
||||||
|
gap: 5px;
|
||||||
|
align-items: baseline;
|
||||||
|
font-size: calc(var(--mainFontSize)* 0.8);
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue