bebraw
10/16/2010 - 5:03 AM

rightplugs.js

Element.include({indexOf: function() {
    return this.parent().children().indexOf(this);
}});

Element.include({removeChildren: function() {
    this.children().each(function(e) {
        e.remove();
    });
}});

String.include({title: function() {
    // http://stackoverflow.com/questions/196972/convert-string-to-proper-case-with-javascript
    return this.replace(/\w\S*/g, function(txt) {
        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
}});