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 What is the best way to eliminate this parameter? Points of interest: 1.- the only one (there are other in IPCE) reference to editorId in the controls.js code is at line 818 in the loadExternalText function 2.- I try to put parameters: false into the IPE options but, as you can see at line 818, IPE extends options with the editorId parameter Thanks! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 17, 2008 12:05 PM, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 caseUnless you want to override the handleFormSubmission method, I don''t think there is a way to *not* include this parameter. I was just looking at this code this morning due to some server-side code I had that was just taking the raw post data and trying to parse it. This trailing parameter was messing this up. Rather than overriding the handleFormSubmission method I opted to use standard key/value parameters, which solved the problem. -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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I wonder why IPE sends an empty parameter that I not set It will be ok if I have more than an IPE at the same time but this is not the case I could delete the parameter on the server side but this is a bother Perhaps Christophe could say anything about this, Christophe? Thanks! On 17 ene, 19:08, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 17, 2008 12:05 PM, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 *not* include this parameter. > > I was just looking at this code this morning due to some server-side > code I had that was just taking the raw post data and trying to parse > it. This trailing parameter was messing this up. > > Rather than overriding the handleFormSubmission method I opted to use > standard key/value parameters, which solved the problem. > > -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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Garito a écrit :> I wonder why IPE sends an empty parameter that I not setNot set? How so? Are you telling me you''re creating an Ajax.InPlaceEditor over a zone that has no ID? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 18, 2008 7:27 AM, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I wonder why IPE sends an empty parameter that I not set > It will be ok if I have more than an IPE at the same time but this is > not the caseYou are probably passing in an element object, as opposed to an element ID, when you instantiate the IPE. Maybe something like (where the span in the H1 has no ID): var elem = $$(''body h1 span'')[0]; new Ajax.InPlaceEditor(elem, ''/my/path'') Just a guess. -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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Justin Perkins a écrit :> Maybe something like (where the span in the H1 has no ID):OK, I shall fix it so the param isn''t sent when there is no ID… -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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? Thanks again! On 18 ene, 16:11, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Justin Perkins a écrit : > > > Maybe something like (where the span in the H1 has no ID): > > OK, I shall fix it so the param isn''t sent when there is no ID... > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 18, 2008 2:51 PM, Garito <garito-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 custom code. What version of Scriptaculous are you currently using? Can you explain what problem this is causing you? -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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Garito a écrit :> Thanks Christophe for the quick solution!I haven''t fixed it yet, hold on your horses… But more pragmatically, how come an *extra* param throws your server code off? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
If you *do* need optional editorId behavior, use the attached patch. If you never used a diff file before, here''s how to apply it on *nix or Windows with Cygwin: * Open a shell * Move to the directory with controls.js * Run the following line $ patch -p0 < path/to/your_download_of/optional_editorid_param.diff -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ok, thanks! I''ll try it and ask if I have problems See ya! On Jan 19, 12:01 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> If you *do* need optional editorId behavior, use the attached patch. > > If you never used a diff file before, here''s how to apply it on *nix or > Windows with Cygwin: > > * Open a shell > * Move to the directory with controls.js > * Run the following line > > $ patch -p0 < path/to/your_download_of/optional_editorid_param.diff > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > [optional_editorid_param.diff]Index: controls.js > ==================================================================> --- controls.js (revision 8662) > +++ controls.js (working copy) > @@ -624,7 +624,8 @@ > var params = this.options.callback(form, value) || ''''; > if (Object.isString(params)) > params = params.toQueryParams(); > - params.editorId = this.element.id; > + if (this.element.id) > + params.editorId = this.element.id; > if (this.options.htmlResponse) { > var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); > Object.extend(options, { > @@ -668,7 +669,6 @@ > this._controls.editor.disabled = true; > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > Object.extend(options, { > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > onComplete: Prototype.emptyFunction, > onSuccess: function(transport) { > this._form.removeClassName(this.options.loadingClassName); > @@ -681,6 +681,8 @@ > }.bind(this), > onFailure: this._boundFailureHandler > }); > + if (this.element.id) > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id) : , > new Ajax.Request(this.options.loadTextURL, options); > }, > postProcessEditField: function() { > @@ -775,7 +777,6 @@ > this.showLoadingText(this.options.loadingCollectionText); > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > Object.extend(options, { > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > onComplete: Prototype.emptyFunction, > onSuccess: function(transport) { > var js = transport.responseText.strip(); > @@ -786,6 +787,8 @@ > }.bind(this), > onFailure: this.onFailure > }); > + if (this.element.id) > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id), > new Ajax.Request(this.options.loadCollectionURL, options); > }, > > @@ -813,7 +816,6 @@ > this.showLoadingText(this.options.loadingText); > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > Object.extend(options, { > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > onComplete: Prototype.emptyFunction, > onSuccess: function(transport) { > this._text = transport.responseText.strip(); > @@ -821,6 +823,8 @@ > }.bind(this), > onFailure: this.onFailure > }); > + if (this.element.id) > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id), > new Ajax.Request(this.options.loadTextURL, options); > },--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
My first impression: it works for me I don''t test it in depth but in the context of my original post it works like a champ Thanks Christophe and the others!! On Jan 20, 12:38 am, Garito <gar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, thanks! I''ll try it and ask if I have problems > > See ya! > > On Jan 19, 12:01 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > If you *do* need optional editorId behavior, use the attached patch. > > > If you never used a diff file before, here''s how to apply it on *nix or > > Windows with Cygwin: > > > * Open a shell > > * Move to the directory with controls.js > > * Run the following line > > > $ patch -p0 < path/to/your_download_of/optional_editorid_param.diff > > > -- > > Christophe Porteneuve aka TDD > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > [optional_editorid_param.diff]Index: controls.js > > ==================================================================> > --- controls.js (revision 8662) > > +++ controls.js (working copy) > > @@ -624,7 +624,8 @@ > > var params = this.options.callback(form, value) || ''''; > > if (Object.isString(params)) > > params = params.toQueryParams(); > > - params.editorId = this.element.id; > > + if (this.element.id) > > + params.editorId = this.element.id; > > if (this.options.htmlResponse) { > > var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); > > Object.extend(options, { > > @@ -668,7 +669,6 @@ > > this._controls.editor.disabled = true; > > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > > Object.extend(options, { > > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > > onComplete: Prototype.emptyFunction, > > onSuccess: function(transport) { > > this._form.removeClassName(this.options.loadingClassName); > > @@ -681,6 +681,8 @@ > > }.bind(this), > > onFailure: this._boundFailureHandler > > }); > > + if (this.element.id) > > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id) : , > > new Ajax.Request(this.options.loadTextURL, options); > > }, > > postProcessEditField: function() { > > @@ -775,7 +777,6 @@ > > this.showLoadingText(this.options.loadingCollectionText); > > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > > Object.extend(options, { > > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > > onComplete: Prototype.emptyFunction, > > onSuccess: function(transport) { > > var js = transport.responseText.strip(); > > @@ -786,6 +787,8 @@ > > }.bind(this), > > onFailure: this.onFailure > > }); > > + if (this.element.id) > > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id), > > new Ajax.Request(this.options.loadCollectionURL, options); > > }, > > > @@ -813,7 +816,6 @@ > > this.showLoadingText(this.options.loadingText); > > var options = Object.extend({ method: ''get'' }, this.options.ajaxOptions); > > Object.extend(options, { > > - parameters: ''editorId='' + encodeURIComponent(this.element.id), > > onComplete: Prototype.emptyFunction, > > onSuccess: function(transport) { > > this._text = transport.responseText.strip(); > > @@ -821,6 +823,8 @@ > > }.bind(this), > > onFailure: this.onFailure > > }); > > + if (this.element.id) > > + options.parameters = ''editorId='' + encodeURIComponent(this.element.id), > > new Ajax.Request(this.options.loadTextURL, options); > > },--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---