07.01.08 - 09:34am
http://github.com/sproutit/sproutcore/wikis/sproutcore-s-modern-model-layer
http://github.com/sproutit/sproutcore/wikis/sproutcore-s-modern-model-layer-part-2
http://github.com/sproutit/sproutcore/wikis/sproutcore-s-modern-model-layer-part-3
Those links (if you haven't checked 'em out) provide some nice insight into how the SproutCore team is thinking about javascript models. It's an interesting pattern of separation.
Basically:
In a model you use MyModel.get('blah') and MyModel.set('blah') and then (it uses ruby helpers) in a view you do something like this:
PLAIN TEXT
RUBY:
<%= progress_view :progress_bar_id,
[...]
Category: AJAX, General Web work - technical, User Experience | Tags: | Be the First to Comment »
05.31.08 - 05:36pm
Take a look at the new and improved Motionbox EventHandler (now on GitHub):
http://github.com/tobowers/motionbox-eventhandler/tree/master
New and improved compatibility (and requirement) for Prototype 1.6
Better extension of custom events and better ie6 and ie7 cleanup to work around a Prototype bug (which looks like it'll be fixed).
Category: General Web work - technical | Tags: | Be the First to Comment »
04.30.08 - 05:15pm
YUI has yet another nice writeup on unobtrusive rollovers.
I wanted to take a sec and show you how cleanly we've implemented it using our bubbling library: the Motionbox EventHandler.
PLAIN TEXT
JavaScript:
var handleMouseover = function (evt) {
var el = evt.element();
var movingFrom = evt.relatedTarget;
var isMouseover [...]
Category: General Web work - technical | Tags: | Be the First to Comment »
04.29.08 - 04:35pm
This is an oldy-but-goody.
If you have an expensive function in javascript that will always return the same results... make it do its dirty-work only once:
PLAIN TEXT
JavaScript:
var foo = function() {
var t = new Date();
foo = function() {
return t;
};
return foo();
};
From: http://peter.michaux.ca/article/3556
Category: General Web work - technical | Tags: | Be the First to Comment »
04.22.08 - 10:07am
http://www.37signals.com/svn/posts/966-urgency-is-poisonous
When a few days extra turns into a few weeks extra then there’s a problem, but what really has to be done by Friday that can’t wait for Monday or Tuesday? If your deliveries are that critical to the hour or day, maybe you’re setting up false priorities and dangerous expectations.
Sometimes I think we all [...]
Category: General, General Web work - technical, User Experience | Tags: | Be the First to Comment »
04.18.08 - 02:18pm
If you're like us and you want to have multiple separated sass files (where the resulting css gets bundled at build time) but want to maintain constants for use across the whole site in one other file, this monkey patch is for you.
Just add a file to your /lib directory (for rails) and require it [...]
Category: General Web work - technical | Tags: | Be the First to Comment »
04.16.08 - 09:37am
Ruby, Rails, Web2.0 » Blog Archive » Live Validation - Easy Client-side Javascript Validation
My library of choice is livevalidation, which has a Rails companion too - if you are using Rails form helpers and standard validation on your models, you don’t have to touch anything just install livevalidation (=drop it to your javascripts folder, it’s [...]
Category: General Web work - technical, User Experience | Tags: | Be the First to Comment »
04.16.08 - 09:09am
You might notice that blur, focus and change events do not necessarily bubble. At Motionbox we use the following hack to subscribe to all form fields at dom ready and then fire custom events so you maintain the same interface to events as everything else.
We do two things in the JS that won't work [...]
Category: AJAX, General Web work - technical | Tags: | Be the First to Comment »
04.14.08 - 03:52pm
http://openid-provider.appspot.com/
This lets your users use their Google ID to log into any OpenID consumer. It seems that the google accounts page is supporting this now someone has implemented OpenID using Google's new AppEngine. That means Yahoo, AOL, Google all support OpenID... with pledged support from Microsoft. Why bother implementing your own system [...]
Category: General Web work - technical, User Experience | Tags: | Be the First to Comment »
04.11.08 - 04:41pm
Sometimes you just have to like convenience. Using our EventHandler I was just able to write the following code:
PLAIN TEXT
JavaScript:
MOBX.HighlightTextField = (function() {
var highlightText = function (evt) {
var el = evt.element();
el.focus();
el.select();
};
MOBX.EventHandler.subscribe(".highlight_on_click", "click", [...]
Category: AJAX, General Web work - technical | Tags: | Be the First to Comment »