Fossil

Check-in [3aab0bfd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a copy button for the artifact hash on the /artifact page.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | copybtn.js-demonstration
Files: files | file ages | folders
SHA3-256: 3aab0bfdc0175d622e20c027c6bfac7d5a37c063635cf39d23f4df74dc612ab4
User & Date: florian 2019-06-02 12:03:00
Context
2019-06-02
12:36
Cherry-pick [6a54cf2939]: Trim leading and trailing white space from the text to be copied to clipboard (do this in Javascript, so no need to care about the extra white space when generating HTML elements). check-in: 698245db user: florian tags: copybtn.js-demonstration
12:03
Add a copy button for the artifact hash on the /artifact page. check-in: 3aab0bfd user: florian tags: copybtn.js-demonstration
11:49
Add a copy button near the branch name on the /info page, to have a way to copy the branch name without opening a tooltip. check-in: b538d5eb user: florian tags: copybtn.js-demonstration
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

2185
2186
2187
2188
2189
2190
2191





2192
2193

2194
2195


2196
2197
2198
2199
2200
2201
2202
    url_add_parameter(&url, "verbose", "1");
    objdescFlags |= OBJDESC_DETAIL;
  }
  zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
  if( isFile ){
    @ <h2>Latest version of file '%h(zName)':</h2>
    style_submenu_element("Artifact", "%R/artifact/%S", zUuid);





  }else if( g.perm.Setup ){
    @ <h2>Artifact %s(zUuid) (%d(rid)):</h2>

  }else{
    @ <h2>Artifact %s(zUuid):</h2>


  }
  blob_zero(&downloadName);
  asText = P("txt")!=0;
  if( asText ) objdescFlags &= ~OBJDESC_BASE;
  objType = object_description(rid, objdescFlags, &downloadName);
  if( !descOnly && P("download")!=0 ){
    cgi_redirectf("%R/raw/%T?name=%s", blob_str(&downloadName),







>
>
>
>
>
|
<
>
|
<
>
>







2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197

2198
2199

2200
2201
2202
2203
2204
2205
2206
2207
2208
    url_add_parameter(&url, "verbose", "1");
    objdescFlags |= OBJDESC_DETAIL;
  }
  zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
  if( isFile ){
    @ <h2>Latest version of file '%h(zName)':</h2>
    style_submenu_element("Artifact", "%R/artifact/%S", zUuid);
  }else{
    style_copy_button();
    @ <h2>Artifact
    @ <span class="copy-button" id="copy-artifacthash"
    @   data-copytarget="artifacthash" data-copylength="%d(hash_digits(1))">
    if( g.perm.Setup ){

      @ </span>&nbsp;<span id="artifacthash">%s(zUuid)</span> (%d(rid)):</h2>
    }else{

      @ </span>&nbsp;<span id="artifacthash">%s(zUuid)</span>:</h2>
    }
  }
  blob_zero(&downloadName);
  asText = P("txt")!=0;
  if( asText ) objdescFlags &= ~OBJDESC_BASE;
  objType = object_description(rid, objdescFlags, &downloadName);
  if( !descOnly && P("download")!=0 ){
    cgi_redirectf("%R/raw/%T?name=%s", blob_str(&downloadName),