mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-03 16:04:41 +01:00
website: Added click-to-copy functionality for specific code blocks with success alert. (#5804)
Some checks failed
Build and deploy docs / Xonsh docs to gh-pages (push) Has been cancelled
CI Tests / Test Python 3.10 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.11 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.12 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.13 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.10 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.11 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.12 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.13 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.10 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.11 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.12 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.13 windows-latest (push) Has been cancelled
Some checks failed
Build and deploy docs / Xonsh docs to gh-pages (push) Has been cancelled
CI Tests / Test Python 3.10 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.11 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.12 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.13 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.10 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.11 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.12 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.13 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.10 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.11 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.12 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.13 windows-latest (push) Has been cancelled
* Added Copy Functionality. Implemented click-to-copy functionality for specific code areas, displaying an alert upon successful copy. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
34b3f3cfbe
commit
bbd652c06d
1 changed files with 14 additions and 0 deletions
14
docs/_templates/index.html
vendored
14
docs/_templates/index.html
vendored
|
@ -679,6 +679,20 @@ chmod +x xonsh-x86_64.AppImage
|
|||
<script src="_static/landing2/js/custom.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
const code = document.querySelectorAll(".code");
|
||||
code.forEach((element) => {
|
||||
element.addEventListener("click", () => {
|
||||
let textes = element.innerText;
|
||||
navigator.clipboard.writeText(textes)
|
||||
.then(() => {
|
||||
alert("Code copied!");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Code didnt copy", error);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
var tagsToReplace = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
|
|
Loading…
Add table
Reference in a new issue