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) {
184 const url = isValidUrl(asset['url']) ? asset['url'] : '';184 const url = isValidUrl(asset['url']) ? asset['url'] : '';
185 const title = assetType === 'extension' ? `Extension repo/guide: ${url}` : 'Preview in browser';185 const title = assetType === 'extension' ? `Extension repo/guide: ${url}` : 'Preview in browser';
186 const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';186 const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
187 const toolTag = assetType === 'extension' && asset['tool'];
187188
188 const assetBlock = $('<i></i>')189 const assetBlock = $('<i></i>')
189 .append(element)190 .append(element)
@@ -193,12 +194,20 @@ function downloadAssetsList(url) {
193 <a class="asset_preview" href="${url}" target="_blank" title="${title}">194 <a class="asset_preview" href="${url}" target="_blank" title="${title}">
194 <i class="fa-solid fa-sm ${previewIcon}"></i>195 <i class="fa-solid fa-sm ${previewIcon}"></i>
195 </a>196 </a>
197 ${toolTag ? '<span class="tag" title="Adds a function tool"><i class="fa-solid fa-sm fa-wrench"></i> Tool</span>' : ''}
196 </span>198 </span>
197 <small class="asset-description">199 <small class="asset-description">
198 ${description}200 ${description}
199 </small>201 </small>
200 </div>`);202 </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
202 if (assetType === 'character') {211 if (assetType === 'character') {
203 if (asset.highlight) {212 if (asset.highlight) {
204 assetBlock.find('.asset-name').append('<i class="fa-solid fa-sm fa-trophy"></i>');213 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 @@
164 gap: 5px;164 gap: 5px;
165 align-items: center;165 align-items: center;
166}166}
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}