[Proto-Scripty] Re: Scoping prototype

2009-03-15 Thread Josh Powell
Yeah, I'm currently using jQuery in noConflict mode but am looking to share code back and forth with other groups here at work. They develop in Prototype and my group develops in jQuery. I was hoping to find a way to constrain Prototype to the widgets that they develop so that I could use their

[Proto-Scripty] Re: Scoping prototype

2009-03-15 Thread T.J. Crowder
Hi, FYI, Tobie's working on Prototype support for Google Caja[1], which is around doing exactly the sort of thing. (Caja is Spanish for "box".) It's not released yet, but coming soon. (And yes, "Google Caja" does read a bit like the name of an 80's one-hit-wonder on first glance. ;-) Less so w

[Proto-Scripty] Re: 3 level nested chained select fields

2009-03-15 Thread vbastos
Thank you T.J. This is my corrected code with the JSON solution: I had obviously miss understood the use of bind, also when I wrote that code I was in a real rush and trying to fight errors so I was trying a few things to get it to work. I have now corrected the code: Event.observe('kindoffabri

[Proto-Scripty] Re: Weird textarea problem in FF

2009-03-15 Thread T.J. Crowder
Hi Dan, Can you put together a small but self-contained test page and post it to Pastie?[1] [1] http://pastie.org -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Mar 16, 2:44 am, Daniel Israel wrote: > I've got a fairly complex page w

[Proto-Scripty] Re: Scoping prototype

2009-03-15 Thread Josh Powell
First, thanks for the reply. This seemed like it should work to contain Prototype, but it doesn't... $(function() { console.log($('mySelect')); (function() { $.getScript('/cfgmgr/js/lib/prototype-1.6.0.3.js', function() { console.log($('mySelect'));

[Proto-Scripty] Weird textarea problem in FF

2009-03-15 Thread Daniel Israel
I've got a fairly complex page where I'm using AJAX to get data from the server and populate a form (in a modal box... (http://www.wildbit.com/labs/modalbox/) ). It works fine except for the one textarea. I get the value fine from the server (confirm in firebug), but when I set the value,

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Tobie Langel
Thanks. I'd like the refactoring to include all Function.prototype methods, not just bind, so we have a clean and coherent src code. Best, Tobie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.a

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Robert Kieffer
On Mar 15, 8:09 am, kangax wrote: > On Mar 15, 10:35 am, Tobie Langel wrote: > [...] > > > The difficulty of abstracting your solution comes from the need for > > the bound function to keep a reference to the original length of the > > array so a to reset it before passing it to the original f

[Proto-Scripty] IE 7 and dynamic div in IFRAMES

2009-03-15 Thread smartcookie
Hey, I recently received a bug report from a client that they were not able to navigate our e-learning web site. I found out that the specs they had were IE 7 and the only time this happened is on pages with collapsible / expandable animated div's. What is happening is the iframe in our site th

[Proto-Scripty] Re: Scoping prototype

2009-03-15 Thread Ryan Gahl
Sure... one quick and dirty way that comes to mind is to "AJAX" in the prototype.js file (of course, using a lightweight or homebrewed Ajax abstraction)... (function() { someAjaxAPI.request(pathToPrototype, onSuccess); function onSuccess(responseText) { eval(responseText); //use prototype in co

[Proto-Scripty] Scoping prototype

2009-03-15 Thread seasoup
Is it possible to contain prototype in a scope like: (function() { use prototype here })(); cant use it here, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this gr

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread T.J. Crowder
Gotcha, sorry for the misunderstanding. > Deprecating a useful API without replacing it by something at least as > good is not a good practice imho. We do need that separate thread. (There was more to this paragraph, but the first sentence kinda rendered the rest of it OT!!) -- T.J. On Mar 15

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Tobie Langel
Sorry T.J. if my last comment came across as agressive. Just to clarify: > You may think that it doesn't, but that's an opinion, not received > wisdom from on high.  If you want to keep supporting DOM0 handlers > with it, fine, say that. Deprecating a useful API without replacing it by somethin

[Proto-Scripty] Re: Mouseover difficulties

2009-03-15 Thread asterix
Hey Spinn, You can try the example i made at this link : http://mlh.free.fr/exemples/_essai_mouseover_2.php And get the code of the page to get inspirate of it. Hope you'll see what you need. Best regards. Michel L'HUILLIER http://mlh.free.fr --~--~-~--~~~---~--~

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread T.J. Crowder
Tobie: > ...it just doesn't make sense You may think that it doesn't, but that's an opinion, not received wisdom from on high. If you want to keep supporting DOM0 handlers with it, fine, say that. > Regarding partial application in Function.prototype.bind, that's been > part of Prototype for a

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Ryan Gahl
> > What do you mean by "backwards X-browser support"? Come on dude, really? You didn't get what I was saying there? I meant "cross browser support, including older browsers". Even if I was wrong on the details, I thought that phrase was fairly self explanatory... guess not. Just like I said, I

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Tobie Langel
> To re-iterate, Kangax, you _should_ be using .bindAsEventListener in your > first case if you want to guarantee backwards X-browser support. No. The only use case for bindAsEventListener other than partial application is for inline event handlers in IE: var myObj = { doSomething: function(ev

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Tobie Langel
> Isn't that what your "internal" (used with `Function.prototype` > extensions) `update` does? Precisely. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, se

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread kangax
On Mar 15, 10:54 am, Ryan Gahl wrote: > So, (sorry not to capture all this in a single post)... > > To re-iterate, Kangax, you _should_ be using .bindAsEventListener in your > first case if you want to guarantee backwards X-browser support. What do you mean by "backwards X-browser support"? Jus

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread kangax
On Mar 15, 10:35 am, Tobie Langel wrote: [...] > The difficulty of abstracting your solution comes from the need for > the bound function to keep a reference to the original length of the > array so a to reset it before passing it to the original function. > > I suspect that the cleanest solution

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread kangax
On Mar 15, 9:06 am, Robert Kieffer wrote: > On Mar 14, 8:24 am, kangax wrote: > > > Why not combine two? > > > ... > > function() { > > if (arguments.length) { > > var ll = arguments.length; > > args.length = l + ll; > > while (ll--) { > > args[l+ll] = arguments[ll]; > >

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Ryan Gahl
So, (sorry not to capture all this in a single post)... To re-iterate, Kangax, you _should_ be using .bindAsEventListener in your first case if you want to guarantee backwards X-browser support. On Sun, Mar 15, 2009 at 9:52 AM, Ryan Gahl wrote: > On Sun, Mar 15, 2009 at 9:36 AM, Ryan Gahl wr

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Ryan Gahl
On Sun, Mar 15, 2009 at 9:36 AM, Ryan Gahl wrote: > What this all means is that these 2 expressions are functionally >> identical (considering that they are called from within the same >> execution context): >> >> myElement.observe('click', onClick.bind(this)); >> myElement.observe('click', onCli

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Ryan Gahl
> > What this all means is that these 2 expressions are functionally > identical (considering that they are called from within the same > execution context): > > myElement.observe('click', onClick.bind(this)); > myElement.observe('click', onClick.bindAsEventListener(this)); > FWIW, this was not al

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Tobie Langel
We've discussed deprecating bindAsEventListener about half a dozen times already, and it just doesn't make sense, for the reasons expressed above. So there's no point in discussing this further. I suggest this be clarified in the documentation. Regarding partial application in Function.prototype.

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread Robert Kieffer
On Mar 14, 8:24 am, kangax wrote: > Why not combine two? > > ... > function() { > if (arguments.length) { > var ll = arguments.length; > args.length = l + ll; > while (ll--) { > args[l+ll] = arguments[ll]; > } > } > return fn.apply(context, args);} > } This implementa

[Proto-Scripty] Re: Proposal for improving bind() + adding "unbind()" support

2009-03-15 Thread T.J. Crowder
Here's a thought: bindAsEventListener() is basically bind() where a certain number of leading args are expected at call-time and the rest are provided at bind-time. (Unless you use it to create DOM0-style handlers on IE; Don't Do That, this is 2009.) So perhaps the symbol bindAsEventListener ca

[Proto-Scripty] Re: Extending a document returned from an Ajax.Request

2009-03-15 Thread T.J. Crowder
Hi, > I'm writing an app which retrieves an RSS feed and processes it. I'd > like to use the Prototype methods on it, but first it must be > extended. I'm guessing if you're dealing with RSS, you're talking about processing XML. Someone jump on me if I'm wrong, but I don't think Prototype curr

[Proto-Scripty] Re: Should Text Nodes Be Wrapped With An Element?

2009-03-15 Thread T.J. Crowder
Hi, > Are there any guides to the style of markup and coding that Prototype > assumes? Prototype doesn't assume or require any markup or particular coding style. Just about the only thing Prototype requires is that you declare a doctype in your document so IE behaves (vaguely) correctly. What

[Proto-Scripty] Extending a document returned from an Ajax.Request

2009-03-15 Thread Doug Reeder
I'm writing an app which retrieves an RSS feed and processes it. I'd like to use the Prototype methods on it, but first it must be extended. The documentation says: extend extend(element) Extends element with all of the methods contained in Element.Methods and Element.Methods.Simulated..

[Proto-Scripty] Re: Should Text Nodes Be Wrapped With An Element?

2009-03-15 Thread P. Douglas Reeder
I'm not clear on what you're suggesting I do with the elements inside elements -- Element#update would replace them, and if you move the elements outside the elements it's no longer valid HTML (as I think you meant). I should have noted that elements with the class "toggle" are used to open

[Proto-Scripty] Mouseover difficulties

2009-03-15 Thread spinn
http://www.spinnwebe.com/temp/a1/ I want the nav to appear on mouseover of the main image, and fade on mouseout of that image. But of course when I mouseover the nav, it fires a mouseout on the img, so it cycles. How do I ignore that mouseout but not the one I want? --~--~-~--~~