Fossil SCM

Also use the now global hash_digits() function in src/info.c, and set the copy length limit to FOSSIL_HASH_DIGITS_URL for consistency with the copy buttons on the tooltips.

florian 2019-06-01 07:07 copybtn.js-demonstration
Commit 710229e713b81fed2134695a144db4597ed56a1d6ee142bb95b55f73fadfb964
1 file changed +1 -7
+1 -7
--- src/info.c
+++ src/info.c
@@ -652,16 +652,10 @@
652652
ReCompiled *pRe = 0; /* regex */
653653
const char *zW; /* URL param for ignoring whitespace */
654654
const char *zPage = "vinfo"; /* Page that shows diffs */
655655
const char *zPageHide = "ci"; /* Page that hides diffs */
656656
657
-/* Preprocessor definitions copied from src\printf.c. */
658
-#ifndef FOSSIL_HASH_DIGITS
659
-# define FOSSIL_HASH_DIGITS 10
660
-#endif
661
- int nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS);
662
-
663657
login_check_credentials();
664658
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
665659
zName = P("name");
666660
rid = name_to_rid_www("name");
667661
if( rid==0 ){
@@ -801,11 +795,11 @@
801795
@ </td>
802796
@ </tr>
803797
804798
@ <tr><th>%s(hname_alg(nUuid)):</th><td>
805799
@ <span class="copy-button" id="copy-fullhash" data-copytarget="fullhash"
806
- @ data-copylength="%d(nDigitHuman)"></span>
800
+ @ data-copylength="%d(hash_digits(1))"></span>
807801
@ <span id="fullhash">%.32s(zUuid)<wbr>%s(zUuid+32)</span>
808802
if( g.perm.Setup ){
809803
@ (Record ID: %d(rid))
810804
}
811805
@ </td></tr>
812806
--- src/info.c
+++ src/info.c
@@ -652,16 +652,10 @@
652 ReCompiled *pRe = 0; /* regex */
653 const char *zW; /* URL param for ignoring whitespace */
654 const char *zPage = "vinfo"; /* Page that shows diffs */
655 const char *zPageHide = "ci"; /* Page that hides diffs */
656
657 /* Preprocessor definitions copied from src\printf.c. */
658 #ifndef FOSSIL_HASH_DIGITS
659 # define FOSSIL_HASH_DIGITS 10
660 #endif
661 int nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS);
662
663 login_check_credentials();
664 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
665 zName = P("name");
666 rid = name_to_rid_www("name");
667 if( rid==0 ){
@@ -801,11 +795,11 @@
801 @ </td>
802 @ </tr>
803
804 @ <tr><th>%s(hname_alg(nUuid)):</th><td>
805 @ <span class="copy-button" id="copy-fullhash" data-copytarget="fullhash"
806 @ data-copylength="%d(nDigitHuman)"></span>
807 @ <span id="fullhash">%.32s(zUuid)<wbr>%s(zUuid+32)</span>
808 if( g.perm.Setup ){
809 @ (Record ID: %d(rid))
810 }
811 @ </td></tr>
812
--- src/info.c
+++ src/info.c
@@ -652,16 +652,10 @@
652 ReCompiled *pRe = 0; /* regex */
653 const char *zW; /* URL param for ignoring whitespace */
654 const char *zPage = "vinfo"; /* Page that shows diffs */
655 const char *zPageHide = "ci"; /* Page that hides diffs */
656
 
 
 
 
 
 
657 login_check_credentials();
658 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
659 zName = P("name");
660 rid = name_to_rid_www("name");
661 if( rid==0 ){
@@ -801,11 +795,11 @@
795 @ </td>
796 @ </tr>
797
798 @ <tr><th>%s(hname_alg(nUuid)):</th><td>
799 @ <span class="copy-button" id="copy-fullhash" data-copytarget="fullhash"
800 @ data-copylength="%d(hash_digits(1))"></span>
801 @ <span id="fullhash">%.32s(zUuid)<wbr>%s(zUuid+32)</span>
802 if( g.perm.Setup ){
803 @ (Record ID: %d(rid))
804 }
805 @ </td></tr>
806

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button