Fossil

Check-in [b538d5eb]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | copybtn.js-demonstration
Files: files | file ages | folders
SHA3-256: b538d5eb79c377a932c1985604b31f7515a881d4a0b8072c19b2017d82b92039
User & Date: florian 2019-06-02 11:49:00
Context
2019-06-02
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
11:31
Add a TH1 command to output text with a copy button, and modify the default View Ticket Page template to include a copy button for the ticket hash (UUID). check-in: 68405c3f user: florian tags: copybtn.js-demonstration
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

761
762
763
764
765
766
767



768
769
770
771
772
773
774
775
    db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
                   " WHERE rid=%d AND tagtype>0 "
                   "   AND tag.tagid=tagxref.tagid "
                   "   AND +tag.tagname GLOB 'sym-*'", rid);
    while( db_step(&q2)==SQLITE_ROW ){
      const char *zTagName = db_column_text(&q2, 0);
      if( fossil_strcmp(zTagName,zBrName)==0 ){



        @  | %z(href("%R/timeline?r=%T&unhide",zTagName))%h(zTagName)</a>
        if( wiki_tagid2("branch",zTagName)!=0 ){
          blob_appendf(&wiki_read_links, " | %z%h</a>",
              href("%R/wiki?name=branch/%h",zTagName), zTagName);
        }else if( g.perm.Write && g.perm.WrWiki ){
          blob_appendf(&wiki_add_links, " | %z%h</a>",
              href("%R/wikiedit?name=branch/%h",zTagName), zTagName);
        }







>
>
>
|







761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
    db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
                   " WHERE rid=%d AND tagtype>0 "
                   "   AND tag.tagid=tagxref.tagid "
                   "   AND +tag.tagname GLOB 'sym-*'", rid);
    while( db_step(&q2)==SQLITE_ROW ){
      const char *zTagName = db_column_text(&q2, 0);
      if( fossil_strcmp(zTagName,zBrName)==0 ){
        @  | <span class="copy-button" id="copy-brname"
        @      data-copytarget="brname" data-copylength="0">
        @  </span>&nbsp;<span id="brname">
        @    %z(href("%R/timeline?r=%T&unhide",zTagName))%h(zTagName)</a></span>
        if( wiki_tagid2("branch",zTagName)!=0 ){
          blob_appendf(&wiki_read_links, " | %z%h</a>",
              href("%R/wiki?name=branch/%h",zTagName), zTagName);
        }else if( g.perm.Write && g.perm.WrWiki ){
          blob_appendf(&wiki_add_links, " | %z%h</a>",
              href("%R/wikiedit?name=branch/%h",zTagName), zTagName);
        }