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 | <span v-else class="i-lucide:copy" /> |
155 | <span v-else class="i-lucide:copy" /> |
| 156 | </button> |
156 | </button> |
| 157 | </template> |
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 | <button |
167 | <button |
| 159 | class="ext-btn ext-btn-toggle" |
168 | class="ext-btn ext-btn-toggle" |
| 160 | type="button" |
169 | type="button" |
docs/.vitepress/theme/components/extrepo/SiteCell.vue
+38 −1
| @@ -1,11 +1,22 @@ |
| 1 | <script setup lang="ts"> |
1 | <script setup lang="ts"> |
| |
2 | import { ref } from 'vue' |
| 2 | import { langFlagClass, ratingIcon, ratingTitle } from './helpers' |
3 | import { langFlagClass, ratingIcon, ratingTitle } from './helpers' |
| 3 | import LazyIcon from './LazyIcon.vue' |
4 | import LazyIcon from './LazyIcon.vue' |
| 4 | import type { RepoSite } from './types' |
5 | import type { RepoSite } from './types' |
| 5 | |
6 | |
| 6 | defineProps<{ |
7 | const props = defineProps<{ |
| 7 | site: RepoSite & { repoName?: string } |
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 | </script> |
20 | </script> |
| 10 | |
21 | |
| 11 | <template> |
22 | <template> |
| @@ -29,6 +40,10 @@ defineProps<{ |
| 29 | <a v-if="site.installUrl" class="ext-site-install-btn" :href="site.installUrl" :title="`Install ${site.name}`"> |
40 | <a v-if="site.installUrl" class="ext-site-install-btn" :href="site.installUrl" :title="`Install ${site.name}`"> |
| 30 | <span class="i-lucide:download" /> |
41 | <span class="i-lucide:download" /> |
| 31 | </a> |
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 | </div> |
47 | </div> |
| 33 | </template> |
48 | </template> |
| 34 | |
49 | |
| @@ -147,4 +162,26 @@ defineProps<{ |
| 147 | .ext-site-install-btn span { |
162 | .ext-site-install-btn span { |
| 148 | font-size: 15px; |
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 | </style> |
187 | </style> |
docs/ext/extensionRepos.data.ts
+1 −1
| @@ -511,7 +511,7 @@ function groupSoraLibrary(indexUrl: string, authors: SoraLibraryAuthor[]): { aut |
| 511 | for (const typeKey of SORA_TYPE_ORDER) { |
511 | for (const typeKey of SORA_TYPE_ORDER) { |
| 512 | const modules = entry.types[typeKey] |
512 | const modules = entry.types[typeKey] |
| 513 | if (!modules?.length) continue |
513 | if (!modules?.length) continue |
| 514 | const typeIndexUrl = `${indexUrl}#${entry.author}#${typeKey}` |
514 | const typeIndexUrl = new URL(`${entry.author}/${typeKey}.json`, indexUrl).toString() |
| 515 | sitesByType[typeIndexUrl] = { sites: toRepoDataSoraModules(modules) } |
515 | sitesByType[typeIndexUrl] = { sites: toRepoDataSoraModules(modules) } |
| 516 | types.push({ label: SORA_TYPE_LABELS[typeKey] ?? typeKey, indexUrl: typeIndexUrl }) |
516 | types.push({ label: SORA_TYPE_LABELS[typeKey] ?? typeKey, indexUrl: typeIndexUrl }) |
| 517 | } |
517 | } |