haml/haml — pull request #671 by remofritzsche (2013-04-25 11:17:04+00:00)
Title: Added new filter `jqready`

Added a new filter which wraps JavaScript-code in a jQuery-document-ready callback.

My thought behind this feature is that my guess is that most people using haml use it in conjunction with Rails, and most people using rails use it with jQuery nowadays. And speaking for me, almost all my inline javascript blocks look like this:

```javascript
:javascript
jQuery(document).ready(function() {
// js code goes here...
});
```

With jqready it's as simple as this:

```javascript
:jqready
// js code goes here...
```

I'm aware that this is not a feature that can be used by all haml-users (who are not using jQuery) and also brings some duplicate code with it (it's very similar to the javascript-filter). However, I think it might be of use for a lot of us and might reduce the amount of boilerplate code.