Indicates extensions that add tools in the list
| @@ -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']; | ||
| 187 | 188 | ||
| 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>`); |
| 201 | 203 | ||
| 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>'); |
| @@ -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 | } | ||