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

Prism toolbar #286

Closed
vdecree opened this issue Jul 5, 2014 · 16 comments
Closed

Prism toolbar #286

vdecree opened this issue Jul 5, 2014 · 16 comments

Comments

@vdecree
Copy link

vdecree commented Jul 5, 2014

Hi there,

Does prism still use prism toolbar plugin so that you can easily get the 'copy to clipboard' button to appear? I've been trying but it doesn't seem to work.

Regards
M

@LeaVerou
Copy link
Member

LeaVerou commented Jul 5, 2014

There never was such a plugin. I only remember some pull requests. Any more info?

@geoffreymcgill
Copy link

The following Copy to Clipboard sample should be helpful to anyone wanting to implement this functionality within their Prism code sample.

https://gist.github.com/geoffreymcgill/d118939d1d358d2ed5e8

This sample is adapted from a sample originally posted by Philip Lawrence.

Hope this helps.

@vkbansal
Copy link
Contributor

@geoffreymcgill Thanks for the link! I was working on something similar.

@LeaVerou Will it make sense to have a plugin that depends on third party tools in the official repo?

@LeaVerou
Copy link
Member

Sure, that’s what plugins are for. (of course it’s always better to not depend on 3rd party tools, but we’re not going to reinvent the wheel for no reason — we reinvent the wheel only when it results in shorter/more elegant/otherwise better code :) ).

@mAAdhaTTah
Copy link
Member

I'm definitely in need of that, @vkbansal; was going to look at tackling it myself but probably not for a while.

@vkbansal
Copy link
Contributor

@mAAdhaTTah can you tell what features are commonly required in a toolbar?

@mAAdhaTTah
Copy link
Member

I mostly need "copy to clipboard," but leaving it open for hooking into would also be great, as I also will need to add an edit button that will take you to the backend (if possible).

@LeaVerou
Copy link
Member

Is this still only solvable with Flash or does the Clipboard API support this now?

@Golmote
Copy link
Contributor

Golmote commented Jan 20, 2015

AFAIK, still only Flash. And ZeroClipboard (used in the above example) is the reference for this.

EDIT: This is what Github uses, for example.

@santo007
Copy link

@Golmote @mAAdhaTTah @vkbansal
Get the plugin from the public repository i have created Prism-toolbar

@vkbansal
Copy link
Contributor

@santo007 nice!

@uranusjr
Copy link
Contributor

For this particular use-case only copy to clipboard is needed, and surprisingly (at least to me) support for it seems pretty decent. It’s mostly only unsupported on mobile browsers, so maybe a Flash-free solution is reasonable?

@Golmote
Copy link
Contributor

Golmote commented Jan 24, 2015

@uranusjr I'm still pretty sure we can't use it to make a "Copy to clipboard" button, but please show me I'm wrong.

@uranusjr
Copy link
Contributor

Yes, you’re right, I misread the support description. Sorry for the mess-up.

@loganfranken
Copy link
Contributor

While there is some discussion above of an extensive toolbar, it looks like this issue is mostly about the "Copy to Clipboard" feature: this is also discussed in #280.

I think this a cool feature to pursue, but maybe we should close either this issue or #280 to simplify things?

@Golmote
Copy link
Contributor

Golmote commented Jun 20, 2015

Alright, let's recap.

For the plugin by Philip Lawrence, see http://dev.misterphilip.com/prism/plugins/toolbar/.
For the repo created by santo007, see https://github.com/santo007/prism-toolbar.
For the "Copy to Clipboard" feature request, see #280.

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

9 participants