Fossil

Check-in [3b5e74c4]
Login

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

Overview
Comment:Cherry-pick [ac199e7a8a]: Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tooltip-copyhash
Files: files | file ages | folders
SHA3-256: 3b5e74c4ca657d331c864171046b8e09606fb29808d698ed874c4b4ac2dffbf5
User & Date: florian 2019-05-28 12:32:00
Wiki:tooltip-copyhash
Context
2019-05-29
12:39
Introduce the "copy-button" CSS class with the SVG icon as the background image, to simplify the Javascript part. check-in: b0795ff6 user: florian tags: tooltip-copyhash
2019-05-28
12:32
Cherry-pick [ac199e7a8a]: Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE. check-in: 3b5e74c4 user: florian tags: tooltip-copyhash
12:16
Explicitly query the client mouse coordinates, to fix the positioning of tooltips for nodes in IE. Leaf check-in: ac199e7a user: florian tags: tooltip-experiments
08:35
Tune the SVG image data URI for IE: remove the (invalid) encoding tag, and URL-encode the smaller than and greater than signs. check-in: c0333891 user: florian tags: tooltip-copyhash
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.js.

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
...
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
    }
    /* The tooltip is either not visible, or the mouse is over a different
    ** element, so clear the dwell timer, and record the new element id and
    ** mouse position. */
    stopDwellTimer();
    if(ix >= 0){
      tooltipInfo.ixHover = ix;
      tooltipInfo.posX = e.x;
      tooltipInfo.posY = e.y;
      stopCloseTimer();
      if(tooltipInfo.dwellTimeout>0){
        tooltipInfo.idTimer = setTimeout(function() {
          tooltipInfo.idTimer = 0;
          stopCloseTimer();
          showGraphTooltip();
        },tooltipInfo.dwellTimeout);
................................................................................
    }
  };
  function nodeHover(e){
    /* Invoked by mousemove events over a graph node */
    e.stopPropagation()
    if(tooltipInfo.ixHover==-2) return
    tooltipInfo.ixHover = -2
    tooltipInfo.posX = e.x
    tooltipInfo.posY = e.y
    tooltipInfo.nodeHover = this
    stopCloseTimer();
    if(tooltipInfo.dwellTimeout>0){
      tooltipInfo.idTimer = setTimeout(function() {
        tooltipInfo.idTimer = 0;
        stopCloseTimer();
        showGraphTooltip();
................................................................................
    window.location.href = tx.baseUrl+"/info/"+p.h
    e.stopPropagation()
  }
  function findTxIndex(e){
    /* Look at all the graph elements.  If any graph elements that is near
    ** the click-point "e" and has a "data-ix" attribute, then return
    ** the value of that attribute.  Otherwise return -1 */
    var x = e.x + window.pageXOffset - absoluteX(canvasDiv);
    var y = e.y + window.pageYOffset - absoluteY(canvasDiv);
    var aNode = canvasDiv.childNodes
    var nNode = aNode.length;
    var i;
    for(i=0;i<nNode;i++){
      var n = aNode[i]
      if( !n.hasAttribute("data-ix") ) continue;
      if( x<n.offsetLeft-5 ) continue;
................................................................................
    var dest = tx.baseUrl + "/timeline?r=" + encodeURIComponent(br)
    dest += tx.fileDiff ? "&m&cf=" : "&m&c="
    dest += encodeURIComponent(tx.rowinfo[ix].h)
    return dest
  }
  function clickOnGraph(e){
    tooltipInfo.ixHover = findTxIndex(e);
    tooltipInfo.posX = e.x;
    tooltipInfo.posY = e.y;
    showGraphTooltip();
  }
  function showGraphTooltip(){
    var html = null
    var ix = -1
    if( tooltipInfo.ixHover==-2 ){
      ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow







|
|







 







|
|







 







|
|







 







|
|







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
...
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
    }
    /* The tooltip is either not visible, or the mouse is over a different
    ** element, so clear the dwell timer, and record the new element id and
    ** mouse position. */
    stopDwellTimer();
    if(ix >= 0){
      tooltipInfo.ixHover = ix;
      tooltipInfo.posX = e.clientX;
      tooltipInfo.posY = e.clientY;
      stopCloseTimer();
      if(tooltipInfo.dwellTimeout>0){
        tooltipInfo.idTimer = setTimeout(function() {
          tooltipInfo.idTimer = 0;
          stopCloseTimer();
          showGraphTooltip();
        },tooltipInfo.dwellTimeout);
................................................................................
    }
  };
  function nodeHover(e){
    /* Invoked by mousemove events over a graph node */
    e.stopPropagation()
    if(tooltipInfo.ixHover==-2) return
    tooltipInfo.ixHover = -2
    tooltipInfo.posX = e.clientX
    tooltipInfo.posY = e.clientY
    tooltipInfo.nodeHover = this
    stopCloseTimer();
    if(tooltipInfo.dwellTimeout>0){
      tooltipInfo.idTimer = setTimeout(function() {
        tooltipInfo.idTimer = 0;
        stopCloseTimer();
        showGraphTooltip();
................................................................................
    window.location.href = tx.baseUrl+"/info/"+p.h
    e.stopPropagation()
  }
  function findTxIndex(e){
    /* Look at all the graph elements.  If any graph elements that is near
    ** the click-point "e" and has a "data-ix" attribute, then return
    ** the value of that attribute.  Otherwise return -1 */
    var x = e.clientX + window.pageXOffset - absoluteX(canvasDiv);
    var y = e.clientY + window.pageYOffset - absoluteY(canvasDiv);
    var aNode = canvasDiv.childNodes
    var nNode = aNode.length;
    var i;
    for(i=0;i<nNode;i++){
      var n = aNode[i]
      if( !n.hasAttribute("data-ix") ) continue;
      if( x<n.offsetLeft-5 ) continue;
................................................................................
    var dest = tx.baseUrl + "/timeline?r=" + encodeURIComponent(br)
    dest += tx.fileDiff ? "&m&cf=" : "&m&c="
    dest += encodeURIComponent(tx.rowinfo[ix].h)
    return dest
  }
  function clickOnGraph(e){
    tooltipInfo.ixHover = findTxIndex(e);
    tooltipInfo.posX = e.clientX;
    tooltipInfo.posY = e.clientY;
    showGraphTooltip();
  }
  function showGraphTooltip(){
    var html = null
    var ix = -1
    if( tooltipInfo.ixHover==-2 ){
      ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow