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

Added support for Checkboxes and radio boxes #159

Closed
wants to merge 3 commits into from

Conversation

Finalfantasykid
Copy link

It isn't the prettiest thing, but it is working well enough for my needs, and I thought I'd share.

@MaXL-ru
Copy link

MaXL-ru commented Apr 19, 2013

Thanks ! ;-)

@thedanheller
Copy link

thanks a lot

@yonas
Copy link

yonas commented Oct 6, 2013

Thanks!

@brcontainer
Copy link
Contributor

I recommend an update:

if (el.type === "checkbox" || el.type === "radio"){
    valueWrap.style.fontSize = "10px";
    valueWrap.style.lineHeight = "10px";
    renderRect(stack.ctx, bounds.left-2, bounds.top-1, 13, 13, "#888888");
    renderRect(stack.ctx, bounds.left-1, bounds.top, 11, 11, "#dddddd");
    if(el.type === "checkbox"){
        textValue = el.checked ? "\u2714" : "";
    } else if (el.type === "radio"){
        textValue = el.checked ? "\u25cf" : "";
    }
}

So no need to be in UTF.

@niklasvh please add the main code (if possible), think you should add from line 908 in file Parse.js.
Forgive me if I made any mistake

-Cleanup up some '==' statements to '===' to obey by jsLint rules
-Updated the Gruntfile to work with the latest grunt version
@Finalfantasykid
Copy link
Author

@brcontainer Thanks, I've updated the code to reflect those changes

@pcottle
Copy link

pcottle commented Nov 8, 2013

This is awesome! Thanks @Finalfantasykid. Excited to see this get merged

@muhammedbasilsk
Copy link

Awesome 👍 !!!

sjamaan pushed a commit to CodeYellowBV/html2canvas that referenced this pull request Jun 20, 2014
@sjamaan
Copy link

sjamaan commented Jun 20, 2014

I don't know if this is the "correct" way to do it (I don't see a way in GitHub to "amend" a pull request), but I've created a new pull request at #406. It would be great if this nice addition could finally be merged; it works fine for me.

@lenichols
Copy link

How do you implement the checkbox fix. I added the code but to no avail... they still don't show up.

@Finalfantasykid
Copy link
Author

You might have better luck with sjamaan's version since his also contains the latest changes as well as mine. He also built his version so you can use this one https://raw.githubusercontent.com/CodeYellowBV/html2canvas/master/build/html2canvas.js

@usmonster
Copy link
Contributor

@Finalfantasykid, @niklasvh Can this be closed since it's superseded by #406?

@niklasvh niklasvh closed this Sep 1, 2014
@niklasvh
Copy link
Owner

niklasvh commented Sep 1, 2014

Added this for 0.5 milestone

@niklasvh
Copy link
Owner

niklasvh commented Dec 6, 2014

Implemented in 0.5 893ce74

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

Successfully merging this pull request may close these issues.

None yet