Show HN: Veneer, modal dialogs in 75 lines of JavaScript
adeel.github.com
adeel.github.com
Heck, here is a modal dialog in one line.
var d = new dojo.Dialog({ title: "Pretty Awesome huh?", content: "And in just one line" }).show();
I'm all for constructive criticism, but many of the posts in this thread are purely negative.
We have a responsibility to foster a community that creates, shares, and improves the state of the web for all of us. That won't happen through vicious infighting.
3rd example would be just
$('.stuff').colorbox({ rel: 'stuff' })
When you're creating one of these everyday you really don't want to setup the events and logic everytime.I'm not bitching in any way on the existing jQuery plugins. I used (and keep using them) again and over again.. but for good javascript developers, simple plugins easily hackable is most often than not the easiest way to get the thing done.
For instance, Django provides a good authentication system.. and then lot of different ways to customize it. It's good.. but it happened to me lots of time to hack my own solution as what I wanted to do wasn't part of their initial "configuration" thingy. Some django plugins were created for that, but then again, they were hard to hack as 80% of the code base was to handle all the possible "configurations". So, basically, sometime the easiest way to get something done is just to find a snippet of code that does the minimum and code the missing part.. instead of using a huge plugin that does everything but still need to be hacked (Which is way harder the more the plugin is complex).
I've got to say though, the underscores (while more readable) are not the "house style" for JavaScript (at least, not the native functions of the language), where everyThingIsCamelCase.
A 75 line modal dialog library (+mootools) isn't a huge achievement by itself -- I usually write my own dialog modals until I need a feature or compatibility that is more easily attainable using one of the more well-written options out there.
Veneer tries to minimize leakiness by doing the absolute minimum while making it simple to add anything you need (as in my third example).
A library that does more than you want, without addressing your specific (and probably custom) application needs seems inevitable. I don't think that's a bad thing and I don't see how this library is any more insulated from that problem.