Show HN: Veneer, modal dialogs in 75 lines of JavaScript
adeel.github.com
Show HN: Veneer, modal dialogs in 75 lines of JavaScript
1–10 of 29 posts
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#2Heck, here is a modal dialog in one line.
var d = new dojo.Dialog({ title: "Pretty Awesome huh?", content: "And in just one line" }).show();
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#3I'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.
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#4Have I misunderstood your source?.. But when your first line of your README says that it depends on Mootools, which is shipping at like 40kb~, doesn't it kind of defeat the purpose of having a line count? 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();
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#5I like what you did here. It's common for new developers to rely heavily on complicated Lightbox scripts, because it seems daunting to implement one on their own. Your script would be good for a beginner to review. It covers the 80% case. You don't say anything about mobile support or browser support, a note on that might be helpful to add. I've got to say though, the underscores (while more readable) are not the "ho…
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#6Have I misunderstood your source?.. But when your first line of your README says that it depends on Mootools, which is shipping at like 40kb~, doesn't it kind of defeat the purpose of having a line count? 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();
Yeah, I did mention the line count in the title but the real point is that it doesn’t come with extra features that you’ll have to customize anyway. For example, there are a million ways to present next and previous buttons when you’re showing a group of dialogs, and if you want to use a different way than the one your library comes with, it’s going to be frustrating. I looked at five or six different libraries befor…
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#7Earlier quoted context omitted.
Yeah, I did mention the line count in the title but the real point is that it doesn’t come with extra features that you’ll have to customize anyway. For example, there are a million ways to present next and previous buttons when you’re showing a group of dialogs, and if you want to use a different way than the one your library comes with, it’s going to be frustrating. I looked at five or six different libraries befor…
I don't really understand what's the point of using your 75 line script for creating modal dialogs instead of the one line solution mentioned by chrisacky.
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#8Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#9I'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).
Re: Show HN: Veneer, modal dialogs in 75 lines of JavaScript
#103rd 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.