-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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 ZeroClipboard to docs #12690
Add ZeroClipboard to docs #12690
Conversation
We don't really need the minified js file since we minify everything ourselves :) |
Re: minified version—the fewer lines added to the source, the happier I am :). |
LGTM. The previous button approach wasn't so bad either :) |
@mdo: I have rebased this branch locally against the latest master and I split the |
@XhmikosR Yeah, if you'd like. I still need input on the JS stuff—it feels like it should be different. |
Branch updated :) About JS, it seems to work fine so far for me. Maybe @fat can chime in... |
BTW, any news on when @fat will be back? It's kind of a bummer that our main JS guy hasn't been available for the last couple of months. |
@mdo: I still don't get any error message without Flash installed... |
var htmlBridge = $('#global-zeroclipboard-html-bridge') | ||
|
||
// Handlers for ZeroClipboard | ||
zeroClipboard.on('load', function(client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't client
unused here and in line 137 and 147?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
@XhmikosR I never hooked anything up for that, and I don't know that we need it. I think the only thing that should happen is if you have Flash, you shouldn't see the copy button. No false hopes that way :). |
@XhmikosR I also tried to test the noflash case. But I did not get the error message in tooltip. I traced in the ZeroclibBoard plugin. For noflash case the browser still think like flash available. The exact line in the plugin is https://github.com/zeroclipboard/zeroclipboard/blob/master/ZeroClipboard.js#L447 I tested in Firefox without flash. The following code returns a valid object even though flash not available. navigator.mimeTypes["application/x-shockwave-flash"] Looks like this is issue with plugin. If someone confirm this we can report to zeroclipboard. |
@soundarapandian: I'm not sure who's to blame here at all; I just saw that code which seemed to me that it is for checking if flash player is installed... |
$('.highlight').each(function() { | ||
var highlight = $(this) | ||
var previous = highlight.prev() | ||
var btnHtml = '<div class="zero-clipboard"><span class="btn-clipboard">Copy</span></div>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change this to $btn =$('<div class="zero-clipboard"><span class="btn-clipboard">Copy</span></div>')
that way you can just append the class below
sorry @hnrch02 was just a busy couple of months, trying to be a bit better |
Who am I that you'd have to apologize to me—totally understandable and I'm glad that you're back! 🍻 |
still need to change btnHtml -> btn |
Well, I say that just above :P |
Rebased. |
Ah, that last merge @mdo basically reverted my rebase :/ |
@mdo: I managed to clean up the branch. Instead of merging from master, better rebase before the final merge. :) |
@fat Can we get a final thumbs-up on this? |
Hmm. It seems more changes are needed for ZeroClipboard 2.0.0 which is out. |
So... will someone try to update for ZeroClipboard 2.x, will we merge this as it is or ditch it? Personally, I'd like this to be merged since I find it a very useful addition. |
Yup, I'll get on the v2 thing soon. |
@mdo: cool, thanks! |
Actually, 2.0.3 seems to not support IE < 9. So I guess we should stick with 1.3.x. |
@XhmikosR Do we honestly care, so long as it doesn't fail in a way that breaks the page? |
Unless the changes are sufficient to warrant it, I have no problem staying with the old version until we drop IE9 in v4 (though, maybe we don't do that anymore, I dunno). |
We're already a bit inconsistent on account of the Customizer, but whatever. |
💚 |
Supersedes #12013.
This takes the work done by @soundarapandian, reorganizes it, replaces the ZeroClipboard script with the minified version, and restyles the copy button.
Definitely want @fat to peep this before it makes it's way into our docs.