Re: [Rails-spinoffs] AOP in Prototype / JS

2006-07-20 Thread nick hemsley
I think dojo has aop features (which are apparently very well done), via its event system (that's what it is called). you can register pre & post funcitons for arbitrary functions. This may be a good place to look, it may be easier to port it from dojo than recreate from scratch. FYI, I dont thin

[Rails-spinoffs] [OT] Domain-specific type extensions

2006-07-07 Thread nick hemsley
Hey all, This is just a little heads up about a little script I have been using a bit & thought I'd put it out there (hopefully someone adds some other stuff so I dont have to do it all). Basically it works very similar to Element.extend (snarfed some of the code), but you can define functions p

Re: [Rails-spinoffs] AJAX data grid for Rails?

2006-06-13 Thread nick hemsley
jSON vs Component: It depends on what you want to do with the generated grid. If you need to munge the data to put it into a grid (i.e. dates, timespan) for display purposes, it is sometimes handy to have the raw json object around so that you dont have to do a whole lot of un-munging in JS to ge

Re: [Rails-spinoffs] Ajax.Replacer

2006-06-02 Thread nick hemsley
The easiest is probably clear the containers contents in the onSuccess handler. This gets called just before the container gets updated. Nick On 6/1/06, Garito <[EMAIL PROTECTED]> wrote: Hi all! How can I do a Ajax.Replacer instead of Ajax.Updater? I created Ajax.Replacer but I would like to i

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-11 Thread nick hemsley
And yes, it fixed the memory problems I was having. (ie still leaks a little, but not much) On 5/12/06, nick hemsley <[EMAIL PROTECTED]> wrote: I checked it out from svn yesterday. bit of a pain as it needs rake to build the prototype.js file. if anyone wants it, let me know. On 5

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-11 Thread nick hemsley
ritten much before that? If not, then this might still not address the problems. Thoughts? -Mandy. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of nick hemsley Sent: Thursday, May 11, 2006 8:24 AM To: rails-spinoffs@lists.rubyonrails.org Subject: Re:

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-10 Thread nick hemsley
OK, scrap this, check out the latest in svn. this issue got raised in trac: http://dev.rubyonrails.org/ticket/4465On 5/11/06, nick hemsley <[EMAIL PROTECTED]> wrote: Disclaimer: Im still getting used to dynamic scoping. & _javascript_ as well.Which part clobbers window.property? If thi

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-10 Thread nick hemsley
Todd Ross <[EMAIL PROTECTED]> wrote: On 5/10/06, nick hemsley <[EMAIL PROTECTED]> wrote:> for (property in methods) {for (var property in methods) {ensures that you're working with a locally-scoped property variable. The way it's written, if window.property ex

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-10 Thread nick hemsley
Slightly nicer:Element.extend = function(element) {  if (!element) return;  if (!element._extendedMethods) element._extendedMethods = {}    if (!element._extended && element.tagName && element != window) {     var methods = Element.Methods;    for (property in methods) {  if (typeof methods[pro

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-09 Thread nick hemsley
If anyone can come up with a better alternative to the line:args = $A([this]).zip($A(arguments)).flatten();i.e. without needing to use flatten, let me know. On 5/9/06, nick hemsley <[EMAIL PROTECTED]> wrote: Turns out this is causing (at least some) of the problems I have been having with IE bl

Re: [Rails-spinoffs] prototype: leak with Element.extend

2006-05-09 Thread nick hemsley
Turns out this is causing (at least some) of the problems I have been having with IE bloating.The culprit as far as I can tell is the bind call (anon function & dom element, not too sure why this is a circular reference though) in Element.extend. I have been having a poke around, but I can't think