Add copyToClipboard()

pull/7/head
mdPlusPlus 2 years ago
parent 2220b9d886
commit 40e81afd57

@ -583,7 +583,9 @@
" <td>" . $content["description"] . "</td>" . PHP_EOL .
" <td class=\"td_users\">" . $active_users . "</td>" . PHP_EOL .
" <td><a href=\"" . $preview_link . "\">" . $preview_link . "</a></td>" . PHP_EOL .
" <td class=\"td_join_url\">" . substr($join_link, 0, 32) . "...<button>Copy</button></td>" . PHP_EOL .
" <td class=\"td_join_url\">" . substr($join_link, 0, 32) . "..." . PHP_EOL .
" <button class=\"copy_button\" onclick=\"copyToClipboard('" . $join_link . "')\">Copy</button>" . PHP_EOL .
" </td>" . PHP_EOL .
" </tr>" . PHP_EOL;
$table_lines[] = $line;
}

@ -0,0 +1,3 @@
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
}

@ -12,5 +12,7 @@
#th_join_url { width:18%; }
.td_join_url { font-family: monospace; }
.copy_button { }
#td_summary { text-align: center; }
#td_last_checked { text-align: center; }

Loading…
Cancel
Save