client/locations-list-map.js
// copies the direct URL for a given entry to clipboard
copies the direct URL for a given entry to clipboard
copies the direct URL for a given entry to clipboard
function copyLinkToClipboard(rowId, callback) {
  const url = new FtmUrl(window.location.href);
  url.searchparams.id = rowId;
  const linkToCopy = url.toString();
  if (!navigator.clipboard) {
    const textArea = document.createElement('textarea');
    Object.assign(textArea.style, {
      position: 'fixed',
      top: 0,
      left: 0,
      width: '2em',
      height: '2em',
      padding: 0,
      border: 'none',
      outline: 'none',
      boxShadow: 'none',
      background: 'transparent',
    });
    textArea.value = linkToCopy;
    document.body.appendChild(textArea);
    textArea.focus();
    textArea.select();
    try {
      document.execCommand('copy');
    } catch (err) {
      console.log('error: could not copy');
    }
    document.body.removeChild(textArea);
    callback();
    return;
  }
  navigator.clipboard.writeText(linkToCopy).then(callback, (err) => { console.log(`could not copy: ${err}`); });
}
function copyLinkToClipboard ( rowId , callback ) { const url = new FtmUrl ( window . location . href ) ; url . searchparams . id = rowId ; const linkToCopy = url . toString ( ) ; if ( ! navigator . clipboard ) { const textArea = document . createElement ( 'textarea' ) ; Object . assign ( textArea . style , { position : 'fixed' , top : 0 , left : 0 , width : '2em' , height : '2em' , padding : 0 , border : 'none' , outline : 'none' , boxShadow : 'none' , background : 'transparent' , } ) ; textArea . value = linkToCopy ; document . body . appendChild ( textArea ) ; textArea . focus ( ) ; textArea . select ( ) ; try { document . execCommand ( 'copy' ) ; } catch ( err ) { console . log ( 'error: could not copy' ) ; } document . body . removeChild ( textArea ) ; callback ( ) ; return ; } navigator . clipboard . writeText ( linkToCopy ) . then ( callback , ( err ) => { console . log ( ` ${ err } ` ) ; } ) ; }
copies the direct URL for a given entry to clipboard
copies the direct URL for a given entry to clipboard