Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header to code block #22

Open
laurentkempe opened this issue Mar 24, 2022 · 0 comments
Open

Add header to code block #22

laurentkempe opened this issue Mar 24, 2022 · 0 comments
Milestone

Comments

@laurentkempe
Copy link
Owner

From @meziantou

function copyCodeBlock(elt, id) {
    navigator.clipboard.writeText(document.getElementById(id).textContent)
        .then(() => {
            elt.disabled = true;
            var body = elt.innerHTML;
            elt.innerHTML = "copied";
            setTimeout(() => {
                elt.innerHTML = body;
                elt.disabled = false;
            }, 1000)
        });
}
@laurentkempe laurentkempe added this to the 1.1 milestone Mar 24, 2022
@laurentkempe laurentkempe changed the title Rework the copy to clipboard Add header to code block Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant