[Proto-Scripty] Form.serialize without empty inputs.

2010-11-07 Thread Braulio
Hello. Is it possible to serialize a form but without empty inputs? I've been looking on the Internet for an example and I have tried code like this one, but without achieving success: $('step2').serialize(true).each(function(s, index) {if (s.empty()) {$ ('step2').remove(key)}}) or

[Proto-Scripty] Prototype script.aculo.us and conflict

2010-11-07 Thread Bagu
Hello, I use Prototype script.aculo.us (latest version) on a fluxbb forum to have autocomplete and autorefresh feature. The problem is that when i display a smiley bar with an other javascript function, i get many error messages on apache log. Here is an example on error message : [Fri Nov 05

[Proto-Scripty] Rails UJS data-remote fires on any click

2010-11-07 Thread Matt Smart
Hello, I was wondering if was intentional for ajax links (link_to ... :remote = true ... ) to fire on any click. I want links to behave where a left click fires of the ajax request, but a right click can allow you to copy link location or open in a new tab, depending on your browser. I found

[Proto-Scripty] the working of Template.evaluate

2010-11-07 Thread petrob
I am learning the Prototype library in-depth and my question is about the inner logic of the Template.evaluate method. Everything is clear as long as the original match provided by the gsub function from the stored template is further processed. a.) what kind of scenario is the inner regular

[Proto-Scripty] hash.__properties is undefined

2010-11-07 Thread Iravanchi
Hi, I'm upgrading from 1.5 to 1.6.1, and Firefox reports an error in prototype_update_helper.js (line 380) that hash.__properties is undefined. When I set a breakpoint it works fine. I have no idea what can be the problem. When I try it with prototype version 1.6.0.3, there's no such errors,

[Proto-Scripty] Re: Form.serialize without empty inputs.

2010-11-07 Thread T.J. Crowder
Hi, `Form#serialize` returns a plain object (with a property for each form element, where the value of the property is the value of the element). Plain objects don't have an `#each` method. But for what you're trying to do, JavaScript itself has a built-in each mechanism: `for..in`. `for..in`

[Proto-Scripty] Re: Prototype script.aculo.us and conflict

2010-11-07 Thread T.J. Crowder
Hi, You haven't actually quoted the bit of code that loops through `smilies_img_path`, or the code that calls `toolBar`, but from the error message I can make two predictions: 1. The `smilies_img_path` parameter to `toolBar` is an Array. 2. The code for looping through outputting the smilies

[Proto-Scripty] Re: How should I model this if extending the DOM is bad?

2010-11-07 Thread Luke
Sorry, I don't understand. How would you store a reference to the Object in the paragraph? Or would you keep a list (or an array) of paragraph-objects that have a reference to the paragraph-DOM-Element? On Nov 6, 7:33 pm, buda www...@pochta.ru wrote: Keep reference to the object in storage of a

[Proto-Scripty] Finding the position of a scroll bar for an element with overflow:auto

2010-11-07 Thread Shane McCarron
I have an element that has overflow:auto. The contents of the element are updated from time to time via ajax calls. I want to ensure that when this happens, if the user has scrolled down into the content, their scroll position stays the same even through the content is effectively regenerated.

[Proto-Scripty] Re: the working of Template.evaluate

2010-11-07 Thread T.J. Crowder
Hi, They're both there to handle property accessors within the template. It's missing from the documentation, but templates can actually handle things like: Hi #{person[firstname]} #{person.lastname} ...where what you feed in is: t.evaluate({person: { firstname: Joe,

[Proto-Scripty] Re: hash.__properties is undefined

2010-11-07 Thread T.J. Crowder
Hi, I'm upgrading from 1.5 to 1.6.1, and Firefox reports an error in prototype_update_helper.js (line 380)... As there's no prototype_update_helper.js in Prototype itself, you'll need to show the actual code being used. If it's using the internals of the `Hash` object (instead of its published