Fossil

Check-in [46f91da1]
Login

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

Overview
Comment:Demonstration of the copybtn.js module beyond tooltips: add a copy button near the full-length hash of check-ins on the /info page, to copy only the hash prefix when clicked.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | copybtn.js-demonstration
Files: files | file ages | folders
SHA3-256: 46f91da1a8d867c6dfa19a694dfed7dfe522d9f6d84f6442c989a98a33151c1a
User & Date: florian 2019-05-31 16:36:00
Context
2019-06-01
00:52
Use the longer hash prefix for the click-to-copy. check-in: 21965553 user: drh tags: copybtn.js-demonstration
2019-05-31
16:36
Demonstration of the copybtn.js module beyond tooltips: add a copy button near the full-length hash of check-ins on the /info page, to copy only the hash prefix when clicked. check-in: 46f91da1 user: florian tags: copybtn.js-demonstration
15:34
Auto-init HTML-defined buttons during the "DOMContentLoaded" event, so no more Javascript code required, apart from loading the copybtn.js module. check-in: 148b0135 user: florian tags: tooltip-copyhash
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

650
651
652
653
654
655
656






657
658
659
660
661
662
663
...
791
792
793
794
795
796
797
798



799
800
801
802
803
804
805
  const char *zParent; /* UUID of the parent check-in (if any) */
  const char *zRe;     /* regex parameter */
  ReCompiled *pRe = 0; /* regex */
  const char *zW;      /* URL param for ignoring whitespace */
  const char *zPage = "vinfo";  /* Page that shows diffs */
  const char *zPageHide = "ci"; /* Page that hides diffs */







  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  zName = P("name");
  rid = name_to_rid_www("name");
  if( rid==0 ){
    style_header("Check-in Information Error");
    @ No such object: %h(g.argv[2])
................................................................................
    @   <td>
    @     %z(href("%R/tree?ci=%!S",zUuid))files</a>
    @   | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
    @   | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
    @   </td>
    @ </tr>

    @ <tr><th>%s(hname_alg(nUuid)):</th><td>%.32s(zUuid)<wbr>%s(zUuid+32)



    if( g.perm.Setup ){
      @ (Record ID: %d(rid))
    }
    @ </td></tr>
    @ <tr><th>User&nbsp;&amp;&nbsp;Date:</th><td>
    hyperlink_to_user(zUser,zDate," on ");
    hyperlink_to_date(zDate, "</td></tr>");







>
>
>
>
>
>







 







|
>
>
>







650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
...
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
  const char *zParent; /* UUID of the parent check-in (if any) */
  const char *zRe;     /* regex parameter */
  ReCompiled *pRe = 0; /* regex */
  const char *zW;      /* URL param for ignoring whitespace */
  const char *zPage = "vinfo";  /* Page that shows diffs */
  const char *zPageHide = "ci"; /* Page that hides diffs */

/* Preprocessor definitions copied from src\printf.c. */
#ifndef FOSSIL_HASH_DIGITS
# define FOSSIL_HASH_DIGITS 10
#endif
  int nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS);

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  zName = P("name");
  rid = name_to_rid_www("name");
  if( rid==0 ){
    style_header("Check-in Information Error");
    @ No such object: %h(g.argv[2])
................................................................................
    @   <td>
    @     %z(href("%R/tree?ci=%!S",zUuid))files</a>
    @   | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
    @   | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
    @   </td>
    @ </tr>

    @ <tr><th>%s(hname_alg(nUuid)):</th><td>
    @ <span class="copy-button" id="copy-fullhash" data-copytarget="fullhash"
    @ data-copylength="%d(nDigitHuman)"></span>
    @ <span id="fullhash">%.32s(zUuid)<wbr>%s(zUuid+32)</span>
    if( g.perm.Setup ){
      @ (Record ID: %d(rid))
    }
    @ </td></tr>
    @ <tr><th>User&nbsp;&amp;&nbsp;Date:</th><td>
    hyperlink_to_user(zUser,zDate," on ");
    hyperlink_to_date(zDate, "</td></tr>");