next-site: click install card to copy repo URL instead of a separate button
This commit is contained in:
parent
064e9a6e44
commit
0d6da1879f
1 changed files with 17 additions and 4 deletions
|
|
@ -31,18 +31,31 @@ export function renderDetailPage(
|
|||
${featuresHtml}
|
||||
<div class="card-meta" style="margin: 18px 0 26px;">${escapeHtml(plugin.author)} · v${escapeHtml(version ?? '?')}</div>
|
||||
|
||||
<div class="card" style="max-width:560px;margin-bottom:24px;">
|
||||
<div class="card" id="install-card" style="max-width:560px;margin-bottom:24px;cursor:pointer;">
|
||||
<div class="card-name" style="font-size:15px;">Install</div>
|
||||
<div class="card-desc">In Revenge Next, add this repository by URL:</div>
|
||||
<div class="card-desc" id="install-desc">In Revenge Next, add this repository by URL - click to copy:</div>
|
||||
<div style="background:#0b0c10;border:1px solid rgba(255,255,255,0.1);border-radius:8px;padding:10px 12px;margin-top:10px;font-family:ui-monospace,monospace;font-size:12.5px;color:#b6acff;word-break:break-all;">${escapeHtml(repoUrl)}</div>
|
||||
</div>
|
||||
|
||||
<div style="display:flex;gap:12px;">
|
||||
<a class="btn" href="${escapeHtml(repoUrl)}">Add repository</a>
|
||||
<a class="btn-ghost" href="${SOURCE_URL}" target="_blank" rel="noopener">View source</a>
|
||||
<a class="btn-ghost" href="${ISSUES_URL}" target="_blank" rel="noopener">Report an issue</a>
|
||||
</div>
|
||||
</div>`
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('install-card').addEventListener('click', async () => {
|
||||
const desc = document.getElementById('install-desc')
|
||||
try {
|
||||
await navigator.clipboard.writeText(${JSON.stringify(repoUrl)})
|
||||
desc.textContent = 'Copied to clipboard!'
|
||||
} catch {
|
||||
desc.textContent = 'Could not copy - select the URL below manually.'
|
||||
}
|
||||
setTimeout(() => {
|
||||
desc.textContent = 'In Revenge Next, add this repository by URL - click to copy:'
|
||||
}, 2000)
|
||||
})
|
||||
</script>`
|
||||
|
||||
return htmlShell({
|
||||
title: `${plugin.name} - Revenge Next`,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue