[Rails-spinoffs] Re: Adding an array to a hash

2007-03-14 Thread Justin Perkins
Let's just take a step back and talk about what your HTML looks like and what the expected POST parameters should look like. Then we can write some JavaScript to solve that problem. Say your HTML looks like: ul liimg src=http://www.domain.com/images/picture1.png; //li liimg

[Rails-spinoffs] Re: prototype: using Ajax.Updater does not apply styles

2007-03-16 Thread Justin Perkins
Have you used an inspector type tool (like Firebug) to verify that your markup is correct and corresponds the CSS you are expecting? -justin On 3/16/07, michal [EMAIL PROTECTED] wrote: hi guys, i have a question regarding prototype and the Ajax.Updater. When the requested page contains

[Rails-spinoffs] Re: Set width of the autocomplete dropdown list?

2007-03-19 Thread Justin Perkins
Sorry if my first post wasn't too clear. Unless I'm mistaken, setWidth won't matter to the library, I had to modify prototype.js to add that. OK, that makes more sense. I am not familiar with the options so I was assuming you were saying that setWidth was an option. I think it's a simple

[Rails-spinoffs] Re: slider.setValue

2007-03-22 Thread Justin Perkins
I don't see that slider observes any 'change' events, only mousedown, mouseup and mousemove. -justin On 3/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Does anyone know if there is a way to prevent setValue from calling the onChange event with the slider? Thanks.

[Rails-spinoffs] Re: PeriodicalExecuter

2007-03-27 Thread Justin Perkins
I'm wondering if you can have more than one PeriodicalExecuter? Why not? Did you try and it didn't work for you? Having more than one PeriodicalExecuter is a fairly normal, and not something I've ever run into problems with. All they really are is window.setInterval() calls, and there is no

[Rails-spinoffs] Re: prototype.js: Using Ajax from withing my own class

2007-03-28 Thread Justin Perkins
You just need to bind the observer method when you're attaching it, like: new Ajax.Request('/path/to/action', {method:get, onSuccess:this.handle_the_data.bindAsEventListener(this) }); -justin On 3/28/07, smellis [EMAIL PROTECTED] wrote: Hi All, First off, I have to mention that I love

[Rails-spinoffs] Re: Prototype and code samples

2007-04-05 Thread Justin Perkins
Could anybody point me to prototype demos and sample code? Though there's not really demos, did you see this page: http://prototypejs.org/learn/introduction-to-ajax Ajax requires server-side code, which makes it hard to demo something in your language of choice, so that could be why it was

[Rails-spinoffs] Re: Draggable Link any example ?

2007-04-13 Thread Justin Perkins
I've implemented draggable links before, but it required that I extend the Draggable class, to enable this behavior. Basically it requires overriding the endDrag method, but doing nothing in that method. Here is example code: YourNameSpace.Draggable = Class.create();

[Rails-spinoffs] Re: Draggable Link any example ?

2007-04-17 Thread Justin Perkins
So your solution seems fine, thanks ! (BTW, sorry with the search for the *best* solution ever :-), but as I'm beginning in JS, so I tried to compare the different answers). No offense taken :) I was trying to say that when I needed a solution for that problem, I didn't research it, I just

[Rails-spinoffs] Re: Draggable Link any example ?

2007-04-17 Thread Justin Perkins
My solution worked fine for me. I used it on a page with a bunch of links and inside each link was a thumbnail image. I was pleased with the results, but did not research if there was *better* ways to achieve the goal. If you look at the complete code example I gave you, I've implemented a click

[Rails-spinoffs] Re: Problem with toQueryParams()

2007-04-18 Thread Justin Perkins
Indeed it is, thanks Tobie! -justin On 4/18/07, tobie [EMAIL PROTECTED] wrote: Hi Justin, This has been corrected in the svn trunk: $H(foo=barapple=orange=.toQueryParams()).toQueryString() // = foo=barapple=orange= Regards, Tobie

[Rails-spinoffs] Re: Help with Class, $super and addMethods

2008-01-07 Thread Justin Perkins
I suggest you subclass Ajax.InPlaceEditor like so: Ajax.CustomInPlaceEditor = Class.create(Ajax.InPlaceEditor, { /* custom methods */ }); Yes, that is what I will likely end up doing since addMethods is not doing what I'm expecting it to. The problem with this approach is how much existing

[Rails-spinoffs] Re: Help with Class, $super and addMethods

2008-01-07 Thread Justin Perkins
addMethods will overwrite your methods, not inherit them, so using $super will do what it's doing on your example. OK, that makes sense. Thanks for clarifying. Still unsure why my simple example works well, but fails when I try to do the same with the Ajax.InPlaceEditor#createEditField method,

[Rails-spinoffs] Re: Help with Class, $super and addMethods

2008-01-07 Thread Justin Perkins
Thanks for clarifying why this is happening Nicolás. I had not thought about the impact my changes are having upon IPCE, probably because I have never used it. fyi, I am overwriting the #getText method in IPE and using function#wrap to extend #createEditField. -justin p.s. I believe you meant

[Rails-spinoffs] Re: Prototype.js - Memory Management / Maintenence question

2008-01-08 Thread Justin Perkins
On 1/8/08, noneothers [EMAIL PROTECTED] wrote: Hi, I had a question about deleting something from my computer memory. I used a Creative Div tag and I used Remove to delete it, but it doesnt completely delete from my memory; even after I used a null value. Setting it to null is the

[Rails-spinoffs] Re: delay on effect callbacks

2008-01-08 Thread Justin Perkins
On Jan 8, 3:34 pm, [EMAIL PROTECTED] wrote: I'm running into problems when trying to use the delay function on effect callbacks: Error: this.options[eventName] is not a function Yes, I am getting the same thing when writing code similar to yours. A possible workaround (albeit

[Rails-spinoffs] Re: get address parents nodes for a child

2008-01-10 Thread Justin Perkins
The basic question is how can to generate this string 'body div h1 b' when I stays on This or basically how can I know the structure of nodes that has this node where I stays. What you are saying here, is given the element b, how can you derive a CSS-style selector that shows the path to that

[Rails-spinoffs] Re: InPlaceEditor question

2008-01-13 Thread Justin Perkins
Have you looked into extending the existing behavior of the InPlaceEditor? If you want to perform some extra actions when going into edit mode, you can wrap the enterEditMode method (or another one, if it is more fitting) such that you can either do something before or after enterEditMode is

[Rails-spinoffs] Re: InPlaceEditor question

2008-01-13 Thread Justin Perkins
Maybe I misunderstood your original question. I thought you wanted to do some extra stuff *before* the form submission occurs, as-if to prepare the page for switching to edit mode. If you want to do stuff after the form submission (or even just before), you may want to checkout the various

[Rails-spinoffs] Re: InPlaceEditor question

2008-01-14 Thread Justin Perkins
Turning htmlReponse on or off did not seem to make a difference. I think that may be because my server-side Seaside framework turns on evalScripts by default. Setting htmlResponse to false means that the form submission will use a plain Ajax.Request instead of an Ajax.Updater. See the method

[Rails-spinoffs] InPlaceEditor and Canceling

2008-01-14 Thread Justin Perkins
In a recent discussion it was noted that in the new version of Scriptaculous, pressing the escape key for an InPlaceEditor field to cancel the editing, no longer works as it did in the older version. I realize that this code has been substantially re-written by Christophe Porteneuve, and perhaps

[Rails-spinoffs] Re: InPlaceEditor and Canceling

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 1:44 AM, Christophe Porteneuve [EMAIL PROTECTED] wrote: 1.7.1beta1 includes the FORMER version of IPE/IPCE. It was replaced by 1.8.0 on the website on Nov 7, 2007, quite some time ago. Perhaps you downloaded it through one monster cache :-? Well, I guess I need to explain

[Rails-spinoffs] Re: InPlaceEditor and Canceling

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 1:39 AM, Christophe Porteneuve [EMAIL PROTECTED] wrote: Just FYI: I'll try to find the time today or soon enough anyway to review the thread in detail and either promote your patch or put another one in. But yeah, I'm tracking this :-) If it makes it any easier, or more

[Rails-spinoffs] Re: evalscripts on repetitive calls to ajax updater

2008-01-15 Thread Justin Perkins
cedric, Unless your method, registerHtmlCode, is altering what getData returns (it doesn't look like it, from your example code), then I don't see how the result from calling getData will ever change. Can you post the real code you are using instead of the simplified version? -justin

[Rails-spinoffs] Re: evalscripts on repetitive calls to ajax updater

2008-01-15 Thread Justin Perkins
Instead of redefining the getData function on every request why not just make getData return a dynamic object instead of one with hardcoded values? What you're probably running into is the function is not getting redefined until after the request is completed, so when you call getData, you'll

[Rails-spinoffs] Re: evalscripts on repetitive calls to ajax updater

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 12:45 PM, ced [EMAIL PROTECTED] wrote: I don't quite see what you mean by dynmaic object. I wanted, with this construct, to avoid pulling the data out of the DOM piece I just included: As I know it before hand on the server. It 's like a data accessor on the html snippset.

[Rails-spinoffs] Re: disable highlight for inPlaceEditor

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 1:49 PM, Andy Koch [EMAIL PROTECTED] wrote: I'd like to disable the highlight effect on text that's embedded in the inPlaceEditor. Without changing the existing behavior, there really isn't a way to just flat-out disable the hover effect, however there are a few options you

[Rails-spinoffs] Re: InPlaceEditor and Canceling

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 9:59 AM, Steve Prior [EMAIL PROTECTED] wrote: Thanks, if you follow the link on http://script.aculo.us/downloads you still get the 1.8.0 version. fyi, I just grabbed the latest version (1.8.1) from the site today with no issues. -justin

[Rails-spinoffs] Re: Form field copying

2008-01-15 Thread Justin Perkins
If you change your naming convention just slightly, such that the second set of fields uses a predictable prefix/suffix, then you can just use a single array to iterate over. Without looking into how to handle radio buttons, checkboxes, and selects, the code would be something like: $A(

[Rails-spinoffs] Re: disable highlight for inPlaceEditor

2008-01-15 Thread Justin Perkins
On Jan 15, 2008 2:55 PM, Christophe Porteneuve [EMAIL PROTECTED] wrote: Just pass onEnterHover: false, onLeaveHover: false among the options… Those callbacks provide the default hover behavior, which is the highlight thing. D'oh! Of course you can override all those DefaultCallbacks in

[Rails-spinoffs] Re: evalscripts on repetitive calls to ajax updater

2008-01-16 Thread Justin Perkins
On Jan 16, 2008 5:32 AM, ced [EMAIL PROTECTED] wrote: That made my day. Thanks for your vision on my problem. Glad it all worked out. Have a great day. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

[Rails-spinoffs] Re: Can someone give me an example of the replace feature because the prototype documentation is hard to understand

2008-01-16 Thread Justin Perkins
On Jan 16, 2008 8:10 AM, desbest [EMAIL PROTECTED] wrote: Can someone give me an example of the replace feature because the prototype documentation is hard to understand. This would be typical usage... HTML: ul li id=my-first-itemI have not been replaced, ever!/li /ul JavaScript:

[Rails-spinoffs] Re: Prototype::GetElementsByClassName - IE trouble

2008-01-16 Thread Justin Perkins
On Jan 16, 2008 4:43 PM, Bjørn [EMAIL PROTECTED] wrote: Just a quick one, bear with me as I'm a prototype nOOb...:-) The following code works in firefox, but IE7 complain that it cannot get the display property? --- var elms =

[Rails-spinoffs] Re: Prototype::GetElementsByClassName - IE trouble

2008-01-17 Thread Justin Perkins
On Jan 17, 2008 7:43 AM, Bjørn [EMAIL PROTECTED] wrote: BTW: In documentation, $$ still state GetElementByClassName as alternative, even if it's now depricated? See this page, note the warning: http://prototypejs.org/api/utility/getElementsByClassName -justin

[Rails-spinoffs] Re: Ajax.Request not answered

2008-01-17 Thread Justin Perkins
On Jan 17, 2008 12:07 PM, JCR [EMAIL PROTECTED] wrote: What happens if an Ajax.Request is not answered? If the server is no longer online (not responding), then I believe the request will result in an exception. Not a 500, which is catchable with the onFailure handler, but an exception. I have

[Rails-spinoffs] Re: Returned RJS not executing when I submit a form with onclick instead of a submit tag

2008-01-17 Thread Justin Perkins
On Jan 17, 9:09 am, Jennifer Maas [EMAIL PROTECTED] wrote: I'm having a problem getting the rjs sent to a client from a controller to execute when I submit the form with an onclick event in a checkbox instead of using a submit tag. The returned js is rendered as text. Probably whatever

[Rails-spinoffs] Re: IPE and editorId

2008-01-17 Thread Justin Perkins
On Jan 17, 2008 12:05 PM, Garito [EMAIL PROTECTED] wrote: Hi! I note that when a IPE submit's the form an editorId parameter is passed with the form values but I don't want this editorId in any case Unless you want to override the handleFormSubmission method, I don't think there is a way to

[Rails-spinoffs] Re: Returned RJS not executing when I submit a form with onclick instead of a submit tag

2008-01-17 Thread Justin Perkins
On Jan 17, 2008 1:39 PM, Jennifer Maas [EMAIL PROTECTED] wrote: I am using prototype 1.5 *I think*. I put version 1.5 in my public javascript folder, so I assume that's the version it's picking up. Is there an easy way to tell? Just look at the prototype.js file, it's right at the top. The

[Rails-spinoffs] Re: Returned RJS not executing when I submit a form with onclick instead of a submit tag

2008-01-17 Thread Justin Perkins
On Jan 17, 2008 2:40 PM, Jennifer Maas [EMAIL PROTECTED] wrote: I'm just a little concerned about how to tell the controller that a particular checkbox is on or off. The code I sent previously can do this, with one slight modification. See below. %= check_box_tag

[Rails-spinoffs] Re: Request Div from Url

2008-01-17 Thread Justin Perkins
You may want to look into RESTful design patterns, this is exactly what is intended to do (and a whole lot more): http://www.google.com/search?q=restful+rails Although there is a lot of info on Rails-specific techniques for making your application RESTful, the basic idea is the same everywhere.

[Rails-spinoffs] Re: IPE and editorId

2008-01-18 Thread Justin Perkins
On Jan 18, 2008 2:51 PM, Garito [EMAIL PROTECTED] wrote: Hi! Thanks Christophe for the quick solution! How can I download it? Subversion? I never used subversion and I don't know how to do it Could anyone point me to a tutorial or something similar? You can patch your version with some

[Rails-spinoffs] Re: design pattern help needed for periodical updater

2008-01-18 Thread Justin Perkins
On Jan 18, 2008 9:33 AM, Walter Lee Davis [EMAIL PROTECTED] wrote: I am trying to make a gallery of photos poll the server and see if there's anything more recent. I am having trouble figuring out how to get Ajax.PeriodicalUpdater to send a dynamic value to the server. Parameters are just

[Rails-spinoffs] Re: PeriodialUpdater does not like URL with port specified

2008-01-22 Thread Justin Perkins
On Jan 22, 2008 4:22 AM, Karel Minarik [EMAIL PROTECTED] wrote: I am playing with PeriodicalUpdater an it seems, that it doesn't like port specified in URL. With Ajax requests, you do not specify a port or a hostname. Everything is relative to the URL in the address bar. This is explicitly

[Rails-spinoffs] Re: update if periodical updater has changed

2008-01-22 Thread Justin Perkins
On Jan 22, 2008 11:58 AM, ahs10 [EMAIL PROTECTED] wrote: i have a periodical updater running, i want to run a javascript function when the response for the periodical updater has changed. i still want the periodical updater to keep running, and i want the function to run each time the

[Rails-spinoffs] Re: PeriodialUpdater does not like URL with port specified

2008-01-22 Thread Justin Perkins
On Jan 22, 2008 3:00 PM, Karel Minarik [EMAIL PROTECTED] wrote: BUT, the bigger problem is, that Ajax.PeriodicalUpdater keeps inserting *more* elements than it receives from the server. OK, now we're getting somewhere. This sounds like the same issue as discussed in this conversation:

[Rails-spinoffs] Re: Ajax form post without submitting the entire page

2008-01-22 Thread Justin Perkins
Let's start with some basic code that you can try out and then follow-up with questions you may have. First, some JavaScript: function prepare(){ var form = $('my-form'); form.observe('submit', handle); } function handle(event){ event.stop(); var form = $('my-form'); new

[Rails-spinoffs] Re: PeriodialUpdater does not like URL with port specified

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 3:59 AM, Karel Minarik [EMAIL PROTECTED] wrote: Does this simple example work for you, Justin? new Ajax.PeriodicalUpdater('some_div', '/some_file', { asynchronous:true, frequency: 3, method: 'get', insertion: Insertion.Bottom }

[Rails-spinoffs] Re: Ajax form post without submitting the entire page

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 4:06 AM, Michael Sharman [EMAIL PROTECTED] wrote: Although this works find, I would have liked to find a way where my markup is clean of any javascript and the default Observer worked from the linked .js file (as it does on the first ajax request). The dom:loaded observer will

[Rails-spinoffs] Re: Event.observe and DOM

2008-01-23 Thread Justin Perkins
To address one of your other questions, regarding attaching events to content that is loaded through Ajax. You need to use callbacks to accomplish this, such as onComplete or onSuccess. function attachListeners(){ // attach your observers to the new elements on the page } new

[Rails-spinoffs] Re: Event.observe and DOM

2008-01-23 Thread Justin Perkins
That's a really long post, so rather than reply to individual pieces how about just a quick example... This JS would be in an included JS file, in your document's head: function initializePage(){ $('my-div').observe('click', divClicked); } function divClicked(event){ var myDiv =

[Rails-spinoffs] Re: Element.up using element.ancestors() -- Please help with the logic

2008-01-23 Thread Justin Perkins
I have noticed huge performance problems in IE when doing what should be a simple operation, like: $$('body') It's instantaneous in Firefox, and dog-slow in IE. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails-spinoffs] Re: $$ question

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 2:27 PM, elduderino [EMAIL PROTECTED] wrote: Does using the $$ give extend an element like $ does? I can't find a clear answer on this so i thought i'd post. Yes it does, but keep in mind it returns a collection of elements, not a single one. Even when your selector only

[Rails-spinoffs] Re: $$ question

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 3:42 PM, elduderino [EMAIL PROTECTED] wrote: how do i add an id to an element i've just createdi've just done: You'll want to use the Element constructor for that: http://prototypejs.org/api/element new Element('a', { id: 'my-id', class: 'my-class', href:

[Rails-spinoffs] Re: Ajax form post without submitting the entire page

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 4:00 PM, Michael Sharman [EMAIL PROTECTED] wrote: So if I fire an ajax form submission (and the same form is returned in that ajax response), then attempt to fire it again (without reload the entire page) it seems to fail. It only works in that scenario when I have the

[Rails-spinoffs] Re: $$ question

2008-01-23 Thread Justin Perkins
On Jan 23, 2008 4:10 PM, Tobie Langel [EMAIL PROTECTED] wrote: Hi, Watch out for class... it's a reserved keyword in JS. Prototype supports either using className (preferred imho) or 'class': Oh yes, good point. Looks like somebody needs to update the Prototype API page for Element, because

[Rails-spinoffs] Re: Ajax Matter

2008-01-23 Thread Justin Perkins
Ideally speaking, you are spot on Matt, but in reality I just don't see that to be a feasible, scalable option. In a large project, such an approach has lead me (I used to be a stickler for such design patterns) down a prickly path of one-off solutions in hundreds of different places in my

[Rails-spinoffs] Re: Prototype: Ajax.Request doesn't work in Internet Explorer

2008-01-24 Thread Justin Perkins
On Jan 24, 2008 1:09 PM, dashifen [EMAIL PROTECTED] wrote: That's been my experience as well. Hanging commas just seem to cause problems for IE from which it (a) doesn't recover and (b) doesn't tell you about. A hanging comma will cause trouble for Safari as well, it's classified as a

[Rails-spinoffs] Re: Prototype: setAttribute and options

2008-01-25 Thread Justin Perkins
Take the advice of kangax and Richard, To set the selected item of a select box, you use selectedIndex. There is no better way. Setting the selected attribute on an option is not a reliable means of setting the selected state, not to mention it requires you to unset the selected attribute on

[Rails-spinoffs] Re: Prototype: setAttribute and options

2008-01-25 Thread Justin Perkins
On Jan 25, 2008 5:57 PM, RobG [EMAIL PROTECTED] wrote: Depends on your criteria for better. No, it doesn't. I guess I should have clarified that I'm referring to a means to reliably set the selected state for a select box, across all browsers, without branching. -justin

[Rails-spinoffs] Re: Ajax.Updater vs Script

2008-01-27 Thread Justin Perkins
On Jan 27, 2008 7:09 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: im not sure why you want to retrieve the remote script once the page has loaded. It's actually a very nice way to include external scripts, since the loading of a script (with src) has an effect on page load times, which impacts

[Rails-spinoffs] Re: cancelling form submit

2008-01-27 Thread Justin Perkins
Try putting a return false on that function. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To

[Rails-spinoffs] Re: cancelling form submit

2008-01-27 Thread Justin Perkins
On Jan 27, 2008 9:46 PM, Gareth Evans [EMAIL PROTECTED] wrote: Thanks for getting back to me, I found that the startTagAdd function was causing execution to stop without a javascript error, which meant the e.stop() never got called. Yes, that would cause the error :) I just typically do

[Rails-spinoffs] Re: Ajax.Updater vs Script

2008-01-28 Thread Justin Perkins
On Jan 28, 2008 9:50 AM, Nathan Nobbe [EMAIL PROTECTED] wrote: the script is just a simple thing to allow 'buttons' to be animated. Why do you include something like that through a remote script include? Why can't you include that code in your local application's javascript file? Is it for

[Rails-spinoffs] Re: Ajax.Updater vs Script

2008-01-28 Thread Justin Perkins
On Jan 28, 2008 3:29 AM, Jean-Philippe Encausse [EMAIL PROTECTED] wrote: Thanks i'm going to try that. It is close to what I already tried. If I remember the script loads but replace the full page. It's a little bit weird. The script you are including is probably doing document.write, which

[Rails-spinoffs] Re: Calling methods in prototype?

2008-01-29 Thread Justin Perkins
You need to bind the this object to your Ball object for the event listener. Also, instead of using anonymous functions as page initializers, I prefer to utilize named methods (so they can be more easily extended/detached). var Ball = { initialize: function(){ this.ball = $('ball');

[Rails-spinoffs] Re: select.remove()

2008-01-29 Thread Justin Perkins
Is 'select' a reserved word perhaps? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe

[Rails-spinoffs] Re: select.remove()

2008-01-29 Thread Justin Perkins
On Jan 29, 2008 10:04 PM, Nycto [EMAIL PROTECTED] wrote: For anyone interested, I also managed to figure out why the method doesn't work as I was using it. It turns out that Select nodes have a pre-existing function named remove Ahh, good catch. Thanks for posting the follow-up. -justin

[Rails-spinoffs] Re: Ajax.Request - nothing in responseText, I need it!!

2008-01-30 Thread Justin Perkins
Try: originalRequest.transport.responseText -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To

[Rails-spinoffs] Re: Sortable List, Serializing and Parsing with Ruby

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 10:40 AM, OmenKing [EMAIL PROTECTED] wrote: (1) serializing and passing with Ajax Try using toJSON() on the collection, like: tasks = $A([ { :id = 1, :name = 'Foo' }, { :id = 2, :name = 'Bar' }, ]); tasks.toJSON() Where are the %5B%5D coming from? Those are escaped

[Rails-spinoffs] Re: Sortable List, Serializing and Parsing with Ruby

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 1:01 PM, OmenKing [EMAIL PROTECTED] wrote: Even though JSON is really cool I'm not sure if thats what I need. It may not be, but I think it's the easiest method of passing arbitrary data objects back and forth. Prototype is certainly well equipped for it. To deal with

[Rails-spinoffs] Re: Sortable List, Serializing and Parsing with Ruby

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 1:38 PM, OmenKing [EMAIL PROTECTED] wrote: That would be the simpler solution but it may not be practical for my me. I'll moving this code over to an asp classic system. I was just using it in ruby for simple testing and showing purposes. Since this list is to discuss the

[Rails-spinoffs] Re: handler has no properties

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 1:46 PM, wte [EMAIL PROTECTED] wrote: What am I not understanding? In anonymous functions like that (you're iterator), you need to bind to the current instance of your object. So this: initialize : function() { $$(span).each(function(item, index) {

[Rails-spinoffs] Re: handler has no properties

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 2:29 PM, wte [EMAIL PROTECTED] wrote: I did not catch that I needed to bind the iterator. Yes, you are binding the iterator so that you can use 'this' and have the same context inside the anonymous function as you have outside the function. Think of it like a means to pass the

[Rails-spinoffs] Re: $('el1','el2').onchange .. Why not??

2008-01-30 Thread Justin Perkins
On Jan 30, 2008 6:57 PM, kaydub [EMAIL PROTECTED] wrote: $('element1','element2').onchange = this.EventHandlerFunction.bindAsEventListener(this); When you pass multiple element ID's, you get an array of elements instead of an individual element. Since you want to attach the event listener to

[Rails-spinoffs] Re: .rjs update only showing un-rendered javascript

2008-02-04 Thread Justin Perkins
On Feb 4, 2008 10:45 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have changed the ajax call to: Sortable.create(inlist, {tag:'div',dropOnEmpty: true, containment: [inlist,notlist],constraint:false, onUpdate:function(){new Ajax.Updater('table', '/picture_management/updatetable',

[Rails-spinoffs] Re: netscape 7 issue with Ajax.Updater

2008-02-05 Thread Justin Perkins
On Feb 5, 2008 10:02 AM, Stan McFarland [EMAIL PROTECTED] wrote: ok, I misspoke. It turns out the error is not with the GET or POST issue at all, but the fact that my site is an HTTPS site. Are you saying that in the address bar the URL is https, and presumably your Ajax request is a

[Rails-spinoffs] Re: Form.request response

2008-02-05 Thread Justin Perkins
On Feb 5, 2008 11:30 AM, jonathon [EMAIL PROTECTED] wrote: My only confusion, is where is the response? I can see it in firebug, but have no clue how to access it! I would like something like: $('person-example').request({ onComplete: function(){ $('div').innerHTHML = response; } })

[Rails-spinoffs] Catching Ajax Failures (not 500s)

2008-02-05 Thread Justin Perkins
I am trying to catch failed Ajax requests, but I'm talking about requests that receive no response from the server (server is down), not responses that result in a 500. The latter can be handled with the onException or onFailure callback, but I am not able to handle the former. To

[Rails-spinoffs] Re: Catching Ajax Failures (not 500s)

2008-02-05 Thread Justin Perkins
Thanks a lot Ken, that's exactly what I need to see. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com

[Rails-spinoffs] Re: Object does not support this property or method... obviously only in IE

2008-02-06 Thread Justin Perkins
On Feb 6, 2008 9:18 AM, Abba [EMAIL PROTECTED] wrote: Thanks, it works. But in the end is like passing the Id of the element and then make a getElementByID... is not what i was expecting :( The $() function not does what the getElementByID() function does, but it also does so much more,

[Rails-spinoffs] Re: Upgrading Prototype

2008-02-08 Thread Justin Perkins
To add to Christophe's reply, for clearing out hash entries, use the unset method... myhash.unset(propNameExpr) Depending on the size of your project, this can be a rather daunting exercise, but well worth it :) -justin --~--~-~--~~~---~--~~ You received this

[Rails-spinoffs] Re: Ajax.Request evalJSON document.write hangs

2008-02-10 Thread Justin Perkins
On Feb 10, 2008 2:57 PM, Burst Web Solutions [EMAIL PROTECTED] wrote: Its writing the value to the screen That's what happens when you use document.write like that. If you're just debugging, and you use Firefox/Firebug, use console.log instead. -justin

[Rails-spinoffs] Re: In-Place Editor when field is empty

2008-02-11 Thread Justin Perkins
If there is nothing there but white space, how is anyone supposed to know that the intention is to click to edit the non-existent value? This was discussed recently, the comments in this thread may help:

[Rails-spinoffs] Re: Element.update removing form tags

2008-02-12 Thread Justin Perkins
You cannot have a form in a form, you're probably doing a page.replace_html 'form_id', :partial = 'form_partial' which is causing this situation. You need to have an inner div with a unique ID and a partial for the form contents that you will replace. Something like: form id=foo div

[Rails-spinoffs] Re: acts_as_taggable Rails 2.0.2.

2008-02-12 Thread Justin Perkins
acts_as_taggable is a plugin in Rails 2.0, as is many other things that provided JavaScript helper methods for you. This is better discussed on a Rails-focused list. This post explains all the changes (see the section titled Active Record: Shedding some weight):

[Rails-spinoffs] Re: Topics for a quick presentation on Prototype

2008-02-12 Thread Justin Perkins
On Feb 13, 2008 12:02 AM, emullet [EMAIL PROTECTED] wrote: Is there anything else that I'm missing that would be really useful to newbs? Event observers? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails-spinoffs] Re: Event.observe on hidden element

2008-02-15 Thread Justin Perkins
You should be able to attach events just fine to hidden elements, assuming they are in the DOM, but with their visibility turned off (display:none or visibility:hidden). -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails-spinoffs] Re: Adding new javascript function using Insertion (or Element.replace)

2008-02-18 Thread Justin Perkins
You might want to consider defining the function once in your JS file, then call it from the Rails partial with parameters instead of re-defining the function every time the partial is rendered. There was a thread about this recently, I seem to remember the guy in that thread having a similar

[Rails-spinoffs] Re: wiki down?

2008-02-20 Thread Justin Perkins
On Wed, Feb 20, 2008 at 11:54 PM, joe t. [EMAIL PROTECTED] wrote: Wow, would have thought more people would have noticed and/or spoken up by now. i've seen it down since Wednesday. Do you mean Wednesday of last week, because today is Wednesday :| There was this other thread from two days

[Rails-spinoffs] Re: Who wants to 'Kick'/'Ban' Share and Care blog?

2008-02-22 Thread Justin Perkins
Moderating new members would make the list spotless, but does require substantially more work on behalf of the admins. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post

[Rails-spinoffs] Re: How do I know when my move effect is finished? (script.aculo.us)

2008-02-24 Thread Justin Perkins
On Sun, Feb 24, 2008 at 10:43 PM, mng0 [EMAIL PROTECTED] wrote: I want to call another method after my move-effect is finished. You want to use the afterFinish parameter to pass in a function. http://wiki.script.aculo.us/scriptaculous/show/CoreEffects -justin

[Rails-spinoffs] Re: IE: don´t get element-focus if I enhancing the DOM-Tree via Element.insert or appendChild( )

2008-03-03 Thread Justin Perkins
I didn't realize that you could focus non-form controls, such as a span. What purpose does this serve? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group,

[Rails-spinoffs] Re: What is the corresponding scripaculous version for Prototype 1.5.1

2008-03-03 Thread Justin Perkins
On Mon, Mar 3, 2008 at 11:11 AM, Brian Williams [EMAIL PROTECTED] wrote: Just because Intel releases a new chip doesn't mean I need to go out and buy it. Just because you have lots of metaphors up your sleeve, doesn't make them applicable to web development ;) This is how I look at it:

[Rails-spinoffs] Re: Having Difficulty Updating Text Field

2008-03-25 Thread Justin Perkins
You cannot use an Ajax.Updater to update an input control. All the updater does is basically call $('your-id').update('your Ajax Response') which will never work on an form control. Switch back to using an Ajax.Request and an onSuccess handler like you were doing before if you really want to

[Rails-spinoffs] Re: Having Difficulty Updating Text Field

2008-03-25 Thread Justin Perkins
On Tue, Mar 25, 2008 at 12:04 PM, kangax [EMAIL PROTECTED] wrote: There's a (not yet documented) #setValue method (since 1.6) True, but isn't it Form.Element.setValue('id, 'value') ? $('id').value = 'value' is still pretty easy :) -justin

[Rails-spinoffs] Re: PeriodicalUpdater Stop

2008-03-26 Thread Justin Perkins
Isn't the problem that you're assigning the periodical updater to a global variable objTick and then later you're trying to access the same object via this.objTick? objTick = new Ajax.PeriodicalUpdater( ... this.objTick.stop(); The Ajax.PeriodicalUpdater object most certainly supports the

[Rails-spinoffs] Re: Prototype Element.insert API documentation

2008-03-26 Thread Justin Perkins
Your copied text is lacking the code syntax from the page, but position is a keyword and is to be replaced by the position you desire. Here are some examples: $('foo').insert( { top: 'pHello/p' } ) $('foo').insert( { bottom: 'pHello/p' } ) $('foo').insert( { before: 'pHello/p' } )

[Rails-spinoffs] Re: Prototype Element.insert API documentation

2008-03-26 Thread Justin Perkins
On Wed, Mar 26, 2008 at 2:43 PM, adriand [EMAIL PROTECTED] wrote: as currently, I do think it is a bit lacking. It's lacking from a new to prototype sense, but once you're familiar with prototype I think you'll find that the site is a wonderful resource. I do agree that it (that sentence)

[Rails-spinoffs] Re: How to do multiple inheritance with mixins in 1.6?

2008-03-26 Thread Justin Perkins
Well, you're going to run into trouble if both the classes you are trying to mixin to you Person class are both implementing the same method names, but assuming that is not the case you can use Object.extend to mixin another set of methods when you're creating the class. This is pretty crazy and

[Rails-spinoffs] Re: How to do multiple inheritance with mixins in 1.6?

2008-03-26 Thread Justin Perkins
I should follow up that when I said if both the classes I really meant to say objects. I don't even want to know what happens when you start mixing together multiple classes into a child class (which all would have an initialize method) and then try to instantiate a new hybrid object. Don't do

  1   2   >