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) {
155155 <span v-else class="i-lucide:copy" />
156156 </button>
157157 </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>
158167 <button
159168 class="ext-btn ext-btn-toggle"
160169 type="button"
docs/.vitepress/theme/components/extrepo/SiteCell.vue +38 −1
@@ -1,11 +1,22 @@
11<script setup lang="ts">
2import { ref } from 'vue'
23import { langFlagClass, ratingIcon, ratingTitle } from './helpers'
34import LazyIcon from './LazyIcon.vue'
45import type { RepoSite } from './types'
56
6defineProps<{
7const props = defineProps<{
78 site: RepoSite & { repoName?: string }
89}>()
10
11const copied = ref(false)
12
13async 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}
920</script>
1021
1122<template>
@@ -29,6 +40,10 @@ defineProps<{
2940 <a v-if="site.installUrl" class="ext-site-install-btn" :href="site.installUrl" :title="`Install ${site.name}`">
3041 <span class="i-lucide:download" />
3142 </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>
3247 </div>
3348</template>
3449
@@ -147,4 +162,26 @@ defineProps<{
147162.ext-site-install-btn span {
148163 font-size: 15px;
149164}
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}
150187</style>
docs/ext/extensionRepos.data.ts +1 −1
@@ -511,7 +511,7 @@ function groupSoraLibrary(indexUrl: string, authors: SoraLibraryAuthor[]): { aut
511511 for (const typeKey of SORA_TYPE_ORDER) {
512512 const modules = entry.types[typeKey]
513513 if (!modules?.length) continue
514 const typeIndexUrl = `${indexUrl}#${entry.author}#${typeKey}`
514 const typeIndexUrl = new URL(`${entry.author}/${typeKey}.json`, indexUrl).toString()
515515 sitesByType[typeIndexUrl] = { sites: toRepoDataSoraModules(modules) }
516516 types.push({ label: SORA_TYPE_LABELS[typeKey] ?? typeKey, indexUrl: typeIndexUrl })
517517 }