Indicates extensions that add tools in the list

f7ec2e47d65acddb8f18c75ab1535e2852559fc3

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +18 -0Showing whitespace changes
public/scripts/extensions/assets/index.js+9 -0
@@ -184,6 +184,7 @@ function downloadAssetsList(url) {
184184 const url = isValidUrl(asset['url']) ? asset['url'] : '';
185185 const title = assetType === 'extension' ? `Extension repo/guide: ${url}` : 'Preview in browser';
186186 const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
187+ const toolTag = assetType === 'extension' && asset['tool'];
187188
188189 const assetBlock = $('<i></i>')
189190 .append(element)
@@ -193,12 +194,20 @@ function downloadAssetsList(url) {
193194 <a class="asset_preview" href="${url}" target="_blank" title="${title}">
194195 <i class="fa-solid fa-sm ${previewIcon}"></i>
195196 </a>
197+ ${toolTag ? '<span class="tag" title="Adds a function tool"><i class="fa-solid fa-sm fa-wrench"></i> Tool</span>' : ''}
196198 </span>
197199 <small class="asset-description">
198200 ${description}
199201 </small>
200202 </div>`);
201203
204+ assetBlock.find('.tag').on('click', function (e) {
205+ const a = document.createElement('a');
206+ a.href = 'https://docs.sillytavern.app/for-contributors/function-calling/';
207+ a.target = '_blank';
208+ a.click();
209+ });
210+
202211 if (assetType === 'character') {
203212 if (asset.highlight) {
204213 assetBlock.find('.asset-name').append('<i class="fa-solid fa-sm fa-trophy"></i>');
public/scripts/extensions/assets/style.css+9 -0
@@ -164,3 +164,12 @@
164164 gap: 5px;
165165 align-items: center;
166166}
167+
168+.asset-name .tag {
169+ gap: 5px;
170+ align-items: baseline;
171+ font-size: calc(var(--mainFontSize)* 0.8);
172+ cursor: pointer;
173+ opacity: 0.9;
174+ margin-left: 2px;
175+}