function createUrlElement(url) {
  let urlCell = document.createElement('div');
  urlCell.setAttribute('class', 'log-url-value');
  let urlTd = document.createElement('td');
  urlTd.appendChild(urlCell);

  if (url.length <= URL_THRESHOLD) {
    urlCell.textContent = url;
  } else {
    urlCell.textContent = url.substring(0, URL_THRESHOLD - 3) + '...';
    let tooltip = document.createElement('span');
    tooltip.setAttribute('class', 'url-tooltip');
    tooltip.textContent = url;
    urlTd.appendChild(tooltip);
  }

  // Append copy to clipboard button.
  appendCopyToClipBoardButton(url, urlTd);
  return urlTd;
}
/**
 * Shorten long URL string so that it can be displayed nicely on mobile devices.
 * If |url| is longer than URL_THRESHOLD, then it will be shorten, and a tooltip
 * element will be added so that user can see the original URL.
 *
 * Add copy to clipboard button to it.
 *
 * @param {string} url The given URL string.
 * @return An DOM node with the original URL if the length is within THRESHOLD,
 * or the shorten URL with a tooltip element at the end of the string.
 */
Shorten long URL string so that it can be displayed nicely on mobile devices.
If |url| is longer than URL_THRESHOLD, then it will be shorten, and a tooltip
element will be added so that user can see the original URL.

Add copy to clipboard button to it.

@param {string} url The given URL string.
@return An DOM node with the original URL if the length is within THRESHOLD,
or the shorten URL with a tooltip element at the end of the string.
Shorten long URL string so that it can be displayed nicely on mobile devices . If |url| is longer than URL_THRESHOLD then it will be shorten and a tooltip element will be added so that user can see the original URL . Add copy to clipboard button to it . @param { string } url The given URL string . @return An DOM node with the original URL if the length is within THRESHOLD or the shorten URL with a tooltip element at the end of the string .
function createUrlElement(url) {
  let urlCell = document.createElement('div');
  urlCell.setAttribute('class', 'log-url-value');
  let urlTd = document.createElement('td');
  urlTd.appendChild(urlCell);
  if (url.length <= URL_THRESHOLD) {
    urlCell.textContent = url;
  } else {
    urlCell.textContent = url.substring(0, URL_THRESHOLD - 3) + '...';
    let tooltip = document.createElement('span');
    tooltip.setAttribute('class', 'url-tooltip');
    tooltip.textContent = url;
    urlTd.appendChild(tooltip);
  }
  appendCopyToClipBoardButton(url, urlTd);
  return urlTd;
}
function createUrlElement ( url ) { let urlCell = document . createElement ( 'div' ) ; urlCell . setAttribute ( 'class' , 'log-url-value' ) ; let urlTd = document . createElement ( 'td' ) ; urlTd . appendChild ( urlCell ) ; if ( url . length <= URL_THRESHOLD ) { urlCell . textContent = url ; } else { urlCell . textContent = url . substring ( 0 , URL_THRESHOLD - 3 ) + '...' ; let tooltip = document . createElement ( 'span' ) ; tooltip . setAttribute ( 'class' , 'url-tooltip' ) ; tooltip . textContent = url ; urlTd . appendChild ( tooltip ) ; } appendCopyToClipBoardButton ( url , urlTd ) ; return urlTd ; }
Shorten long URL string so that it can be displayed nicely on mobile devices.
Shorten long URL string so that it can be displayed nicely on mobile devices .
// Append copy to clipboard button.