diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d09d6d..4a55893d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Display data length and index length for materialized views - Link routines from syntax highlighting - Autofocus added field in alter table +- Executed SQL commands: Add button for copy to clipboard - MySQL 5.0-: Do not load partitioning info in alter table (bug #1099) - MariaDB: Parse COLLATE in routine definition (bug #1104) - PostgreSQL: Show structure of inherited tables diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 16da0335..ccc68654 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -668,7 +668,7 @@ class Adminer { } $history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"] $sql_id = "sql-" . count($history[$_GET["db"]]); - $return = "" . lang('SQL command') . "\n"; + $return = "" . lang('SQL command') . " 🗐\n"; if (!$failed && ($warnings = driver()->warnings())) { $id = "warnings-" . count($history[$_GET["db"]]); $return = "" . lang('Warnings') . ", $return\n"; diff --git a/adminer/static/editing.js b/adminer/static/editing.js index ac76a8d6..c1baf84b 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -93,6 +93,13 @@ function messagesPrint(parent) { for (const el of qsa('.toggle', parent)) { el.onclick = partial(toggle, el.getAttribute('href').substr(1)); } + for (const el of qsa('.copy', parent)) { + el.onclick = () => { + navigator.clipboard.writeText(qs('code', el.parentElement).innerText).then(el.textContent = '✓'); + setTimeout(() => el.textContent = '🗐', 1000); + return false; + }; + } }