arthurgouveia / prettyCheckable

A jQuery plugin to replace checkboxes and radios for custom images
http://arthurgouveia.com/prettyCheckable/
345 stars 98 forks source link

Implement graceful degradation #34

Closed markushausammann closed 10 years ago

markushausammann commented 11 years ago

At the moment, checkboxes and radios have to be written in a way that doesn't allow for degradation. If I switch prettycheckable off, I have no labels anymore, the styles go crazy, etc. The javascript should be rewritten in a way that it takes the normal labels from a proper form context. If I need to write too versions of all my forms I'm not gonna be able to use prettycheckable even though I really like it because it looks so much better.

arthurgouveia commented 11 years ago

Hello, @markushausammann.

I've been seeing you quite a lot here :)

You see: this is an open source project. I developed and opened the code so that people could use and improve as they wish. I'm not getting paid for it. I'm giving it to you for free. This is a collaborative thing.

So far (one year), even though a bunch of people have been using it, I only got 1 donation of US$10,00, which is less than a dolar per month. That being said, I have my personal problems, tasks & jobs to take care of, because that's where my money comes from. Which basically means that I won't be able to be doing what people ask me to do out of the blue. If prettyCheckable would have some, even though small, income, I would be using that money to pay for the hours I would work to improve the plugin.

You asked for this here, and I keep seeing a bunch of "should" and "want" from you, instead of "would be great if", "if you could", "please", etc.

Please take some time to realize what an open-source project means and stop bossing around. I'll be happy to help you, as I did with other people and already adjusted some things you asked.

Thanks a lot, and have a great day.

markushausammann commented 11 years ago

I'm sorry Arthur but you got it all wrong. I'm the contributor with the second largest number of commits to this project ;-) so I'm part of the project and if I write a ticket which contains 'should', this is just spec language. Now you see, this is an open source project which means you shouldn't take issues/tickets personally, they aren't. In no way am I bossing around, I'm providing issues so the community can act on them if they want (including me). I didn't ask for anything, I just wrote a ticket that states some facts for the record.

arthurgouveia commented 11 years ago

@markushausammann, even though that's your rank, you simply sent the project another PNG with all gray colors and the CSS to it. Don't make this such a big deal. As a matter of fact, we had a few issues because you didn't look at the project demo page or gh-pages repo, remember?

I'm taking it personally because you're putting too much personal material and too little code. Creating a bunch of issues helps me realize there's room for improvement, but by simply opening, you're not solving.

As a matter of fact, on the referred issue there was no answer from you. You're waiting for someone to fix the need you have on that particular problem.

Please read again all the issues and comments and you'll see the tone you've been using IS in fact quite bossy. Might not have been your intention, but I can't tell anything else out of your text.

I'm sure we can find a way to work together, as long as you understand what is happening here.

arthurgouveia commented 10 years ago

@markushausammann this is finally done. Let me know if this works out and close this issue :)

markushausammann commented 10 years ago

I'm gonna upgrade our project right, test and let you know how it went.

arthurgouveia commented 10 years ago

@markushausammann the sprite is now horizontally oriented. If you want to keep working with your current sprite, you only need to point it to the correct image path, set your width/height and position for each state.

If you have 1 image for each state, then you can simply rename them according to what you want or the plugin's current naming convention, then just compile the scss file and sprite. Should be all good.

Aside from that: you can't have a selector that returns multiple items and call the plugin. Make it a loop and call the plugin for each of your elements.

Let me know if I can be of any help.

markushausammann commented 10 years ago

Atm. I'm fighting with github authentication errors... I'll check back when that's solved.

markushausammann commented 10 years ago

OK, trying it now...

I'm using an easier (more jquery-ish) way of looping.

$(selectors).each(function() {
    $(this).prettyCheckable();
});

Maybe that's better for the docs.

arthurgouveia commented 10 years ago

Indeed it is, but it's also less effective and more costly so I try to avoid it as much as I can. On Nov 6, 2013 7:18 PM, "Markus" notifications@github.com wrote:

OK, trying it now...

I'm using an easier (more jquery-ish) way of looping.

$(selectors).each(function() { $(this).prettyCheckable(); });

Maybe that's better for the docs.

— Reply to this email directly or view it on GitHubhttps://github.com/arthurgouveia/prettyCheckable/issues/34#issuecomment-27919544 .

markushausammann commented 10 years ago

Yeah, just found this http://stackoverflow.com/questions/14808144/each-vs-each-vs-for-loop-in-jquery seems quite a big difference indeed.

markushausammann commented 10 years ago

Now about the topic of graceful degradation which this issue is about. If I understand it correctly, it's still necessary to add labels with the data-label attribute. If that is true, there is no way it's gonna degrade gracefully and therefore I can't close this issue. If the prettycheckable.js was able to read a semantically correct label and use it, then it would be gracefully degradable. I'm going to try this and if it works, I'll submit a pull request.

markushausammann commented 10 years ago

I wrote a solution that leaves the current functionality intact but adds the possibility to write degradable markup. See pull request: https://github.com/arthurgouveia/prettyCheckable/pull/59