Fossil

Check-in [b19a9826]
Login

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

Overview
Comment:More consistent naming scheme for IDs of copy buttons and their target elements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | copybtn.js-tweaks
Files: files | file ages | folders
SHA3-256: b19a9826082cf84cdcbaab6d50792c70cf7b8f1f423e61e0e5ff8739a2b6fdca
User & Date: florian 2019-06-05 07:17:00
Context
2019-06-05
07:23
Automatically set the element ID for dynamically created copy buttons to "copy-IDTARGET" (analogous to the TH1 copybtn function). check-in: 42972005 user: florian tags: copybtn.js-tweaks
07:17
More consistent naming scheme for IDs of copy buttons and their target elements. check-in: b19a9826 user: florian tags: copybtn.js-tweaks
2019-06-03
13:30
Merge all the recent tool-tip experiments into trunk. check-in: 6908832c user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.js.

628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
      }
      tooltipObj.style.borderColor =
         tooltipObj.style.color = s.getPropertyValue('color')
      tooltipObj.style.visibility = "hidden"
      tooltipObj.innerHTML = html
      tooltipObj.appendChild(document.createTextNode(' '));
      tooltipObj.appendChild(
        makeCopyButton("tooltip-copybtn","tooltip-link",0));
      tooltipObj.style.display = "inline"
      tooltipObj.style.position = "absolute"
      var x = tooltipInfo.posX + 4 + window.pageXOffset
                   - absoluteX(tooltipObj.offsetParent)
      tooltipObj.style.left = x+"px"
      var y = tooltipInfo.posY + window.pageYOffset
                   - tooltipObj.clientHeight - 4







|







628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
      }
      tooltipObj.style.borderColor =
         tooltipObj.style.color = s.getPropertyValue('color')
      tooltipObj.style.visibility = "hidden"
      tooltipObj.innerHTML = html
      tooltipObj.appendChild(document.createTextNode(' '));
      tooltipObj.appendChild(
        makeCopyButton("copy-tooltip-link","tooltip-link",0));
      tooltipObj.style.display = "inline"
      tooltipObj.style.position = "absolute"
      var x = tooltipInfo.posX + 4 + window.pageXOffset
                   - absoluteX(tooltipObj.offsetParent)
      tooltipObj.style.left = x+"px"
      var y = tooltipInfo.posY + window.pageYOffset
                   - tooltipObj.clientHeight - 4

Changes to src/info.c.

761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
...
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
....
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
    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-br0"
        @      data-copytarget="br0" data-copylength="0">
        @  </span>&nbsp;<span
        @  id="br0">%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);
................................................................................
    @     %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(hash_digits(1))">
    @ </span>&nbsp;<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>");
................................................................................
  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 ){







|
|
|
|







 







|
|
|







 







|
|

|

|







761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
...
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
....
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
    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-name-br"
        @      data-copytarget="name-br" data-copylength="0">
        @  </span>&nbsp;<span id="name-br"><!--
        @  -->%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);
................................................................................
    @     %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-hash-ci"
    @   data-copytarget="hash-ci" data-copylength="%d(hash_digits(1))">
    @ </span>&nbsp;<span id="hash-ci">%.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>");
................................................................................
  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-hash-ar"
    @   data-copytarget="hash-ar" data-copylength="%d(hash_digits(1))">
    if( g.perm.Setup ){
      @ </span>&nbsp;<span id="hash-ar">%s(zUuid)</span> (%d(rid)):</h2>
    }else{
      @ </span>&nbsp;<span id="hash-ar">%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 ){

Changes to src/tktsetup.c.

445
446
447
448
449
450
451
452
453
454
455
456
457
458
459

static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
@ <th1>
@ if {[info exists tkt_uuid]} {
@   html "<td class='tktDspValue' colspan='3'>"
@   copybtn tkt_uuid $tkt_uuid 1
@   if {[hascap s]} {
@     html " ($tkt_id)"
@   }
@   html "</td></tr>\n"
@ } else {
@   if {[hascap s]} {
@     html "<td class='tktDspValue' colspan='3'>Deleted "







|







445
446
447
448
449
450
451
452
453
454
455
456
457
458
459

static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
@ <th1>
@ if {[info exists tkt_uuid]} {
@   html "<td class='tktDspValue' colspan='3'>"
@   copybtn hash-tk $tkt_uuid 1
@   if {[hascap s]} {
@     html " ($tkt_id)"
@   }
@   html "</td></tr>\n"
@ } else {
@   if {[hascap s]} {
@     html "<td class='tktDspValue' colspan='3'>Deleted "