mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #88] Add "copy to clipboard" function to example code snippets #52
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cuu508 on GitHub (Sep 28, 2016).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/88
For the example code snippets (bash, python, ruby, etc.), it would be great to have a "copy" buttons next to each.
The snippets are in several places on the site:
The project is already using clipboard.js for ping addresses.
@eddieosmanbasic commented on GitHub (Sep 30, 2016):
Hello,
I'm new to contributing to open source projects, and using GitHub in general. I was wondering if this button needs to be written in Python considering the fact that the website uses Django?
@cuu508 commented on GitHub (Sep 30, 2016):
Hi @eddieosmanbasic – no, this would be done entirely on client side, using JS.
If you log into healthchecks.io and look at the list of your checks, there is a "copy" link next to each ping URL. It works, it uses clipboard.js under the hood. This issue is about extending the same functionality to more places on the site.
A quick note: clipboard.js and similar libraries do not work on OSX. There, we fall back to simply not showing the "copy" link/button.
@cdax commented on GitHub (Sep 30, 2016):
Hi @cuu508, I've been thinking about how this should look from a UI/UX perspective. There are cases where the same tab can have multiple independent code snippets. For example, have a look at the Bash tab:

here, you can't have a single floating "Copy" button for the whole tab since the
curlsnippet is independent of thewgetsnippet.One solution might be to break down independent snippets into separate Bootstrap panels. I should be able to finish working on this over the weekend once we've reach some agreement around how this should look.
@cuu508 commented on GitHub (Sep 30, 2016):
Yes, here, copying the whole snippet, comments and all, is not very useful.
I think I would prefer to still have a single "Bash" tab, but split this snippet in two parts:
front/snippets/curl.txtandfront/snippets/wget.txt.The comments could also be moved from the snippet to the parent template.
@cuu508 commented on GitHub (Oct 1, 2016):
PR from @cdax received and merged.