Fossil SCM
Add a copy button for the artifact hash on the /artifact page.
Commit
3aab0bfdc0175d622e20c027c6bfac7d5a37c063635cf39d23f4df74dc612ab4
Parent
b538d5eb79c377a…
1 file changed
+9
-3
+9
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2187,14 +2187,20 @@ | ||
| 2187 | 2187 | } |
| 2188 | 2188 | zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2189 | 2189 | if( isFile ){ |
| 2190 | 2190 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2191 | 2191 | style_submenu_element("Artifact", "%R/artifact/%S", zUuid); |
| 2192 | - }else if( g.perm.Setup ){ | |
| 2193 | - @ <h2>Artifact %s(zUuid) (%d(rid)):</h2> | |
| 2194 | 2192 | }else{ |
| 2195 | - @ <h2>Artifact %s(zUuid):</h2> | |
| 2193 | + style_copy_button(); | |
| 2194 | + @ <h2>Artifact | |
| 2195 | + @ <span class="copy-button" id="copy-artifacthash" | |
| 2196 | + @ data-copytarget="artifacthash" data-copylength="%d(hash_digits(1))"> | |
| 2197 | + if( g.perm.Setup ){ | |
| 2198 | + @ </span> <span id="artifacthash">%s(zUuid)</span> (%d(rid)):</h2> | |
| 2199 | + }else{ | |
| 2200 | + @ </span> <span id="artifacthash">%s(zUuid)</span>:</h2> | |
| 2201 | + } | |
| 2196 | 2202 | } |
| 2197 | 2203 | blob_zero(&downloadName); |
| 2198 | 2204 | asText = P("txt")!=0; |
| 2199 | 2205 | if( asText ) objdescFlags &= ~OBJDESC_BASE; |
| 2200 | 2206 | objType = object_description(rid, objdescFlags, &downloadName); |
| 2201 | 2207 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2187,14 +2187,20 @@ | |
| 2187 | } |
| 2188 | zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2189 | if( isFile ){ |
| 2190 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2191 | style_submenu_element("Artifact", "%R/artifact/%S", zUuid); |
| 2192 | }else if( g.perm.Setup ){ |
| 2193 | @ <h2>Artifact %s(zUuid) (%d(rid)):</h2> |
| 2194 | }else{ |
| 2195 | @ <h2>Artifact %s(zUuid):</h2> |
| 2196 | } |
| 2197 | blob_zero(&downloadName); |
| 2198 | asText = P("txt")!=0; |
| 2199 | if( asText ) objdescFlags &= ~OBJDESC_BASE; |
| 2200 | objType = object_description(rid, objdescFlags, &downloadName); |
| 2201 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2187,14 +2187,20 @@ | |
| 2187 | } |
| 2188 | zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2189 | if( isFile ){ |
| 2190 | @ <h2>Latest version of file '%h(zName)':</h2> |
| 2191 | style_submenu_element("Artifact", "%R/artifact/%S", zUuid); |
| 2192 | }else{ |
| 2193 | style_copy_button(); |
| 2194 | @ <h2>Artifact |
| 2195 | @ <span class="copy-button" id="copy-artifacthash" |
| 2196 | @ data-copytarget="artifacthash" data-copylength="%d(hash_digits(1))"> |
| 2197 | if( g.perm.Setup ){ |
| 2198 | @ </span> <span id="artifacthash">%s(zUuid)</span> (%d(rid)):</h2> |
| 2199 | }else{ |
| 2200 | @ </span> <span id="artifacthash">%s(zUuid)</span>:</h2> |
| 2201 | } |
| 2202 | } |
| 2203 | blob_zero(&downloadName); |
| 2204 | asText = P("txt")!=0; |
| 2205 | if( asText ) objdescFlags &= ~OBJDESC_BASE; |
| 2206 | objType = object_description(rid, objdescFlags, &downloadName); |
| 2207 |