Fossil

Check-in [c887a1bb]
Login

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

Overview
Comment:More consistent naming of variables in the newly added Javascript part.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tooltip-copyhash
Files: files | file ages | folders
SHA3-256: c887a1bb007457d2c4d92ed2b0630ba9e457b2f9c85a12a3effe2737fef1fd66
User & Date: florian 2019-05-29 12:55:00
Wiki:tooltip-copyhash
Context
2019-05-29
14:02
Move the "Copy Button" functionality to a separate Javascript module, to be loaded and used independently from the timeline graph module. check-in: f6fcbf29 user: florian tags: tooltip-copyhash
12:55
More consistent naming of variables in the newly added Javascript part. check-in: c887a1bb user: florian tags: tooltip-copyhash
12:47
Give a visual feedback when the copy icon is clicked. check-in: 3783706f user: florian tags: tooltip-copyhash
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.js.

755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
** HTML snippet for statically created buttons:
**    <span class="copy-button" id="idButton" data-copytarget="idTarget"></span>
**
** Note: <idTarget> can be set statically or dynamically, this function does not
** overwrite "data-copytarget" attributes with empty values.
*/
function makeCopyButton(idButton,idTarget){
  var button = document.getElementById(idButton);
  if( !button ){
    button = document.createElement("span");
    button.className = "copy-button";
    button.id = idButton;
  }
  button.style.transition = "";
  button.style.opacity = 1;
  if( idTarget ) button.setAttribute("data-copytarget",idTarget);
  button.onclick = clickCopyButton;
  return button;
}
/* The onclick handler for the "Copy Text" button. */
var lockCopyText = false;
function clickCopyButton(e){
  e.preventDefault();   /* Mandatory for <a> and <button>. */
  e.stopPropagation();
  if( lockCopyText ) return;







|
|
|
|
|

|
|
|
|
|







755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
** HTML snippet for statically created buttons:
**    <span class="copy-button" id="idButton" data-copytarget="idTarget"></span>
**
** Note: <idTarget> can be set statically or dynamically, this function does not
** overwrite "data-copytarget" attributes with empty values.
*/
function makeCopyButton(idButton,idTarget){
  var elButton = document.getElementById(idButton);
  if( !elButton ){
    elButton = document.createElement("span");
    elButton.className = "copy-button";
    elButton.id = idButton;
  }
  elButton.style.transition = "";
  elButton.style.opacity = 1;
  if( idTarget ) elButton.setAttribute("data-copytarget",idTarget);
  elButton.onclick = clickCopyButton;
  return elButton;
}
/* The onclick handler for the "Copy Text" button. */
var lockCopyText = false;
function clickCopyButton(e){
  e.preventDefault();   /* Mandatory for <a> and <button>. */
  e.stopPropagation();
  if( lockCopyText ) return;