[Proto-Scripty] Building a string for an array reference

2010-04-09 Thread thegdog
So here's what I am trying to do. I have a form with two select fields: issue and subissue. The second (subissue) is hidden by default. When the user selects one of the items in the first (issue), I want to populate the second with only certain options. So I have all the options in the

[Proto-Scripty] class.create question

2010-04-09 Thread patrick
Hi everyone, My question is-- quite often I do something like this: var Photos = (function() { var Photos = Class.create({ initialize: function() { var photos = this; //etc } return Photos; })(); and then when I have class methods, I have redefine a

[Proto-Scripty] Re: class.create question

2010-04-09 Thread T.J. Crowder
Hi, So this solves that problem-- but global variables are evil.. BUT..  this is in the context of a closure, so I wonder if it's less evil? The global variable is not affected by the fact it's being created by code in a closure, you're still (implicitly) creating a `photos` property on the

[Proto-Scripty] Re: The Unofficial Wiki

2010-04-09 Thread T.J. Crowder
Hi, I think the site needs an integrated contribution system for Prototype Extensions, better than jQuery's(http://plugins.jquery.com/). One thing at a time. :-) And of course, there's scripteka.com. Some want something easier than learning git, rake, lighthouse, etc.,  in order to

[Proto-Scripty] Re: class.create question

2010-04-09 Thread patrick
Thanks for the reply T.J., When using 'this', one other problem comes up for me which I wasn't sure how to address. I use lowpro along with prototype for it's Event.addBehavior stuff... So, if I do: var Foo = (function() { var Foo = Class.create({ initialize:

RE: [Proto-Scripty] Re: class.create question

2010-04-09 Thread Jonathan Rosenberg
Ok, I haven't thought this out fully, but how about Event.addBehavior({ '#foo:click': (function() { someFunc(this)).bind(this) } -- Jonathan Rosenberg Founder Executive Director, Tabby's Place

[Proto-Scripty] Re: class.create question

2010-04-09 Thread patrick
On Apr 9, 9:53 am, Jonathan Rosenberg j...@tabbysplace.org wrote: Ok, I haven't thought this out fully, but how about Event.addBehavior({ '#foo:click': (function() { someFunc(this)).bind(this) } Right.. that

[Proto-Scripty] Ajax Updater - get a special div from site

2010-04-09 Thread clicforw...@googlemail.com
Hello, can anyone please help me out with a Ajax Updater?! My script: a class=product href=site.html onclick=new Ajax.Updater('target_div', 'site',{method: 'get'}); return false;Link/a This works fine but this loads the whole site.html into the div. I need just a part from the request site. For

RE: [Proto-Scripty] Re: class.create question

2010-04-09 Thread Jonathan Rosenberg
Hmmm ... What do you mean by access to #foo? -- Jonathan Rosenberg Founder Executive Director, Tabby's Place http://www.tabbysplace.org/ -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of patrick Sent:

[Proto-Scripty] Re: class.create question

2010-04-09 Thread T.J. Crowder
Hi Patrick, I don't quite get how I would also be able to pass in the class 'this' instance to someFunc other than having a var foo = this; at the top of the initialize block.. Can you see a way to get around that? Since you replied to Jonathan that you wanted access to both #foo and the

[Proto-Scripty] Re: Prototype.js / AJAX.response() Script

2010-04-09 Thread mTorbin
TJ, Thanks for the detailed response. I mostly came to terms with this resolution but I was hoping another programmer would prove me wrong. It seems it can be somewhat accomplished with jQuery and PHP but jQuery and Prototype do not currently get along all that well and I'd had to bring that

[Proto-Scripty] Re: class.create question

2010-04-09 Thread patrick
Thanks for the reply T.J., Hmm.. Yeah it just seems like there's no way to win in this case. On one hand, I have to resort to redundancy of setting var blah = this; inside my class methods-- Otherwise, in some of my more intense methods, I have function calls inside function calls, and have to