Commit bf834e9100
bf834e9100b0f3b809ace35fcdfe1103fca2726e
parent: 8f36a0b628
Unsigned
Duck <57977673+woducku@users.noreply.github.com> · 2026-07-14 05:06 UTC
copy button
Layout: unified · split
docs/.vitepress/theme/components/extrepo/RepoRow.vue
+9
| @@ -155,6 +155,15 @@ function variantSites(variant: RepoVariant) { |
| 155 | 155 | <span v-else class="i-lucide:copy" /> |
| 156 | 156 | </button> |
| 157 | 157 | </template> |
| 158 | <button |
| 159 | v-else-if="mangayomiCopyValue(variant)" |
| 160 | class="ext-btn ext-btn-copy" |
| 161 | type="button" |
| 162 | @click="copyVariantUrl(variant)" |
| 163 | > |
| 164 | <span v-if="copiedLabel === variant.label" class="i-lucide:check" /> |
| 165 | <span v-else class="i-lucide:copy" /> |
| 166 | </button> |
| 158 | 167 | <button |
| 159 | 168 | class="ext-btn ext-btn-toggle" |
| 160 | 169 | type="button" |
docs/.vitepress/theme/components/extrepo/SiteCell.vue
+38 −1
| @@ -1,11 +1,22 @@ |
| 1 | 1 | <script setup lang="ts"> |
| 2 | import { ref } from 'vue' |
| 2 | 3 | import { langFlagClass, ratingIcon, ratingTitle } from './helpers' |
| 3 | 4 | import LazyIcon from './LazyIcon.vue' |
| 4 | 5 | import type { RepoSite } from './types' |
| 5 | 6 | |
| 6 | | defineProps<{ |
| 7 | const props = defineProps<{ |
| 7 | 8 | site: RepoSite & { repoName?: string } |
| 8 | 9 | }>() |
| 10 | |
| 11 | const copied = ref(false) |
| 12 | |
| 13 | async function copyInstallUrl() { |
| 14 | const value = props.site.installUrl?.replace(/^sora:\/\/module\?url=/, '') |
| 15 | if (!value) return |
| 16 | await navigator.clipboard.writeText(value) |
| 17 | copied.value = true |
| 18 | setTimeout(() => { copied.value = false }, 1500) |
| 19 | } |
| 9 | 20 | </script> |
| 10 | 21 | |
| 11 | 22 | <template> |
| @@ -29,6 +40,10 @@ defineProps<{ |
| 29 | 40 | <a v-if="site.installUrl" class="ext-site-install-btn" :href="site.installUrl" :title="`Install ${site.name}`"> |
| 30 | 41 | <span class="i-lucide:download" /> |
| 31 | 42 | </a> |
| 43 | <button v-if="site.installUrl" class="ext-site-copy-btn" type="button" :title="`Copy ${site.name} url`" @click="copyInstallUrl"> |
| 44 | <span v-if="copied" class="i-lucide:check" /> |
| 45 | <span v-else class="i-lucide:copy" /> |
| 46 | </button> |
| 32 | 47 | </div> |
| 33 | 48 | </template> |
| 34 | 49 | |
| @@ -147,4 +162,26 @@ defineProps<{ |
| 147 | 162 | .ext-site-install-btn span { |
| 148 | 163 | font-size: 15px; |
| 149 | 164 | } |
| 165 | |
| 166 | .ext-site-copy-btn { |
| 167 | flex-shrink: 0; |
| 168 | display: flex; |
| 169 | align-items: center; |
| 170 | justify-content: center; |
| 171 | width: 32px; |
| 172 | border-radius: 8px; |
| 173 | border: 1px solid var(--vp-c-divider); |
| 174 | background-color: var(--vp-c-bg); |
| 175 | color: var(--vp-c-text-1); |
| 176 | cursor: pointer; |
| 177 | transition: border-color 0.2s, background-color 0.2s; |
| 178 | } |
| 179 | |
| 180 | .ext-site-copy-btn:hover { |
| 181 | border-color: var(--vp-c-brand-1); |
| 182 | } |
| 183 | |
| 184 | .ext-site-copy-btn span { |
| 185 | font-size: 15px; |
| 186 | } |
| 150 | 187 | </style> |
docs/ext/extensionRepos.data.ts
+1 −1
| @@ -511,7 +511,7 @@ function groupSoraLibrary(indexUrl: string, authors: SoraLibraryAuthor[]): { aut |
| 511 | 511 | for (const typeKey of SORA_TYPE_ORDER) { |
| 512 | 512 | const modules = entry.types[typeKey] |
| 513 | 513 | if (!modules?.length) continue |
| 514 | | const typeIndexUrl = `${indexUrl}#${entry.author}#${typeKey}` |
| 514 | const typeIndexUrl = new URL(`${entry.author}/${typeKey}.json`, indexUrl).toString() |
| 515 | 515 | sitesByType[typeIndexUrl] = { sites: toRepoDataSoraModules(modules) } |
| 516 | 516 | types.push({ label: SORA_TYPE_LABELS[typeKey] ?? typeKey, indexUrl: typeIndexUrl }) |
| 517 | 517 | } |