[Proto-Scripty] Re: Extracting methods from codebase

2009-05-04 Thread Bertrand
I don't have a problem with neither really. I personally love Prototype as it is. It's just that sometimes I wish I could just cherry-pick bits out of it when I don't need the whole library. And since my knowledge of Javascript is decent but limited (I'm definitely no core Prototype developer) I'v

[Proto-Scripty] Re: Extracting methods from codebase

2009-05-03 Thread RobG
On May 1, 1:42 am, Bertrand wrote: > Well, actually, my managers are pushing for self-contained javascript > code (trying to get rid of all the library calls, which isn't > necessarily a good idea, but I have to abide). > > So I ended up using a DOM-compliant version using createElement, > crea

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread kangax
On Apr 30, 11:54 am, Bertrand wrote: > Because there's a reason why Prototype, jQuery and the likes have such > success. It lies in the fact that the developers are very talented and > provide good code. Unfortunately, I'm kind of new to the whole Success doesn't always mean quality. Quality i

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Ananth Raghuraman
|| position == 'after') childNodes.reverse(); > childNodes.each(insert.curry(element)); > > content.evalScripts.bind(content).defer(); >} > >return element; > }, > > > > > > - Original Message - > From: "Bertrand" > To: "

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Alex McAuley
From: "Bertrand" To: "Prototype & script.aculo.us" Sent: Thursday, April 30, 2009 4:54 PM Subject: [Proto-Scripty] Re: Extracting methods from codebase Because there's a reason why Prototype, jQuery and the likes have such success. It lies in the fact that the develop

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Alex McAuley
why cant you code your own insert function its not that hard ... You can probably do it in about 15 lines or so.. Alex - Original Message - From: "Bertrand" To: "Prototype & script.aculo.us" Sent: Thursday, April 30, 2009 4:47 PM Subject: [Proto-Scripty

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Rick Waldron
At very least the code i gave you will allow you to clean up your own code by subbing document.getElementById() with the $() and i'd say its pretty damn small Rick On Thu, Apr 30, 2009 at 11:42 AM, Bertrand wrote: > > Well, actually, my managers are pushing for self-contained javascript > code

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Bertrand
rt function its not that hard ... > You can probably do it in about 15 lines or so.. > > Alex > > - Original Message - > From: "Bertrand" > To: "Prototype & script.aculo.us" > Sent: Thursday, April 30, 2009 4:47 PM > Subject: [Proto-Sc

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Bertrand
Hi Walter, > There was a project getting started late last year called pulpjs that   > was aiming at this problem. It's sort of a port of Prototype with the   > following goals: no global namespace pollution, no extensions of   > native prototypes, and everything is modular and non-dependent. Hav

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-30 Thread Bertrand
Well, actually, my managers are pushing for self-contained javascript code (trying to get rid of all the library calls, which isn't necessarily a good idea, but I have to abide). So I ended up using a DOM-compliant version using createElement, createTextNode and appendChild. But I'll make sure t

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-29 Thread Rick Waldron
Just sort of curious ... of all the convenience that prototype offers, why is the only method you "need" is Element.update()? Anyway, try this... (function() { function _$(args) { this.elements = []; for (var i = 0, len = args.length; i < len; ++i) { if (typeof args[i] == 'str

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-29 Thread Walter Lee Davis
There was a project getting started late last year called pulpjs that was aiming at this problem. It's sort of a port of Prototype with the following goals: no global namespace pollution, no extensions of native prototypes, and everything is modular and non-dependent. Have a look at their

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-29 Thread Bertrand
That would indeed be another interesting way of doing it. The only problem is that javascript is often used in environments where filesize is critical. In my case, I only use ONE function from the library, because I've found it to be th best way to achieve what I want to do: Element.update. But b

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-29 Thread Matt Foster
I'd set up each class or major structure, such as Element, Enumerable, etc etc as its own file, then define packages such as minimal, efficient, advanced, ajax...etc. Then in a server side script it will bundle these files together depending on the package so you could make a request something li