by the way, love it, the coment box only apearing when you scroll down is orgasmic

Ismael said on May 03, 2006

Why did you choose to use objects as namespaces instead of something closer to OOP ? (same encapsulation features, plus more benefits!)

Jonathan Snook said on May 03, 2006

Ian: Object.extend copies all properties and methods of one object onto another. I usually use it to handle parameters but it could also be used to handle inheritence.

Function.prototype.bind is used specifically to bind an object to a function call so that the this keyword refers to the bound object. When you get into handling events or using function calls for loops, it's extremely useful.

Ismael: I didn't need a constructor or the need to create further snook objects. It's essentially just a holder for method calls. The alternative would be to do something like is detailed on Dustin's site but I don't have a need for private members. In the end, my code is simpler.

To everybody else: yeah, gotta fix those widgets in column collapse mode. I had changed how I was positioning stuff and didn't update the CSS for both modes. My bad. :)

Marko MIhelcic said on May 03, 2006

I love the way youve hidden the "Post a comment" great idea, also heh I can't pick the one I like best the White /lightgreen or the black/darkgreen :) - both are very cool!

Geek King Widow said on May 03, 2006

I like the white/light green is too hard on my eyes..

The lightbulb is very cute..

Microwidgets are cool...

Edward said on May 03, 2006

I am adoring this little comment idea. This is just awesome.

Quite often, designers implement the contrast stylesheet to look hideous to an awful degree. You make both the default and the contrast look beautiful.

Note on the collapse widget: on 800x600, you actually can't even see it! :o That and it seems to jerkily scroll horizontally.

As far as design goes though, you nailed this one. Any possibility of posting a screenshot of your old design? I'd like to be able to refer back to that one, it was quite excellent.

EJ said on May 03, 2006

I am thoroughly impressed and check your site frequently for new approaches / methodology / inspiration. I've been hooked since I first laid eyes on your work. Keep up the fantastic job! We can ALL learn something from you.

Dustin Diaz said on May 03, 2006

I share your feelings with cleaning up the code. Often times I think we forget that people actually look at our code under the hood more often than we think. Thus we can talk all we want on our blogs about clean code and efficient way to get things done and global variables are bad, bla bla bla, but until we do it ourselves - it isn't much of a testament.

All that said, I think you've gave me the push I needed to do my own JavaScript reboot.

Also, thanks for the link love on the namespacing deal.

As for private methods, there is rarely a need for them at all if you're the one writing all the code for your own site. But lest we forget that people look at our code - and may very well indeed copy it and paste it onto their site. It may cause you to question some of the functions and think "does this function really need to be public?" - The code may be simpler in the end, but is it logical? Eitherway, you're doing some excellent work and props to you for already taking the initative to clean up your JavaScript. You're already leaps and bounds ahead of my reworkings.

WD Milner said on May 03, 2006

Call me blind or something but only after reading some of the comments and this article did I realize what those dark, almost inviible characters were, let alone that they were clickable. At least it has made the content more readable.

I think you are moving away from useability and accessibility into cutesy code for the sake of "I can do it" rather than "should I do it" and "does it add value" despite its innovativeness.

One bug I noticed, at least here, is that you can have the light contrast content (why not change the rest as well - if someone wants/need the lighter for content they surely need it for the rest as well) or collapse the width but not both. If you collapse the width you lose the light contrast, if you try to put the light content back you lose the column collapse.

Also when you collapse the columns, the top bar with the menu and search box does not re-center with the rest of the page.

Jonathan Snook said on May 03, 2006

WD: Although probably worthy of a post on its own, it's clear that the whole light vs dark issue is certainly a matter of preference. Some like it, some don't.

In any case, one of the goals that I had defined for the redesign (in the last post) was to have fun with the technology. (Or as you call it, cutesy code) Also, if you refer to my about page you'll read that "It's also a testing ground for me to try out things." I've made no claims of creating the most usable or accessible site. However, I think all features that I've added are helpful — if not as evident. But that's more a design issue than a code issue.

I am aware of that preferences aren't being saved for the column collapser. This is due to a bug I introduced last night and haven't had time to fix (maybe tonight). As for the top bar and search box not realigning, what browser are you using? I haven't run into this issue.

Should the contrast tool change the contrast for the entire page? Yes and when I have time, that'll be done. It was added near the end of development to appease those who might find the black too dark. But as you've so keenly made case-in-point, you can't please everyone.

Jonathan Snook said on May 03, 2006

Just a quick update that the settings should now be retained properly for both the contrast and column switchers.

WD Milner said on May 04, 2006

Thumbs up, the contrast/columns work perfectly.

Re: resize top bar. I'm using Firefox. if I refresh the page after collapsing the column or resize the browser screen it does realign but if I just collapse the column it kind of overhands on the left. You can see what I mean here ...

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.