@@ -30,7 +30,7 @@ const pageTemplate = `<!doctype html> |
| 30 |
{{if eq .Kind "repo"}} |
30 |
{{if eq .Kind "repo"}} |
| 31 |
<div class="repo-overview-head"> |
31 |
<div class="repo-overview-head"> |
| 32 |
<div class="repo-title"><span class="repo-icon">{{icon "repo"}}</span><a href="{{.BaseURL}}">{{.RepoName}}</a><span class="visibility">Public</span></div> |
32 |
<div class="repo-title"><span class="repo-icon">{{icon "repo"}}</span><a href="{{.BaseURL}}">{{.RepoName}}</a><span class="visibility">Public</span></div> |
| 33 |
<a class="secondary-button fork-button" href="{{.GitHubImportURL}}" target="_blank" rel="noopener" title="Import this repository and its complete history into a new GitHub repository">{{icon "fork"}} Fork to GitHub</a> |
33 |
<a class="secondary-button fork-button" href="{{.GitHubImportURL}}" target="_blank" rel="noopener" data-copy="{{.CloneURL}}" data-copied-label="URL copied — paste on GitHub" aria-label="Copy clone URL and open GitHub Importer" title="Copies the clone URL, then opens GitHub Importer">{{icon "fork"}} <span data-copy-label>Import to GitHub</span></a> |
| 34 |
</div> |
34 |
</div> |
| 35 |
<div class="repo-grid"> |
35 |
<div class="repo-grid"> |
| 36 |
<section class="primary"> |
36 |
<section class="primary"> |
@@ -176,7 +176,8 @@ const pageTemplate = `<!doctype html> |
| 176 |
var copyIcon = one('[data-copy-icon]', button); |
176 |
var copyIcon = one('[data-copy-icon]', button); |
| 177 |
var copiedIcon = one('[data-copied-icon]', button); |
177 |
var copiedIcon = one('[data-copied-icon]', button); |
| 178 |
if (label && !label.dataset.original) label.dataset.original = label.textContent; |
178 |
if (label && !label.dataset.original) label.dataset.original = label.textContent; |
| 179 |
if (label) label.textContent = 'Copied!'; |
179 |
if (!button.dataset.originalAria) button.dataset.originalAria = button.getAttribute('aria-label') || ''; |
|
|
180 |
if (label) label.textContent = button.getAttribute('data-copied-label') || 'Copied!'; |
| 180 |
if (copyIcon) copyIcon.hidden = true; |
181 |
if (copyIcon) copyIcon.hidden = true; |
| 181 |
if (copiedIcon) copiedIcon.hidden = false; |
182 |
if (copiedIcon) copiedIcon.hidden = false; |
| 182 |
button.classList.add('is-copied'); |
183 |
button.classList.add('is-copied'); |
@@ -187,7 +188,8 @@ const pageTemplate = `<!doctype html> |
| 187 |
if (copyIcon) copyIcon.hidden = false; |
188 |
if (copyIcon) copyIcon.hidden = false; |
| 188 |
if (copiedIcon) copiedIcon.hidden = true; |
189 |
if (copiedIcon) copiedIcon.hidden = true; |
| 189 |
button.classList.remove('is-copied'); |
190 |
button.classList.remove('is-copied'); |
| 190 |
button.setAttribute('aria-label', 'Copy to clipboard'); |
191 |
if (button.dataset.originalAria) button.setAttribute('aria-label', button.dataset.originalAria); |
|
|
192 |
else button.removeAttribute('aria-label'); |
| 191 |
}, 1600); |
193 |
}, 1600); |
| 192 |
} |
194 |
} |
| 193 |
function copyText(value, button) { |
195 |
function copyText(value, button) { |