Hi there! I''ve found an interesting project called PhotoNotes[1]. It can be compared to Flickr''s photo tagging feature. There''s only one problem with this project: It doesn''t allow you to save the input in any way. I''ve looked around the source code, but I still haven''t found a way to get all of the input onsave(), and to send it to another resource through XMLHttpRequest. If someone could take a look at this, I''d be forever grateful! [1] PhotoNotes: http://www.dustyd.net/projects/PhotoNotes/ --~--~---------~--~----~------------~-------~--~----~ 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 5/31/07, Henrik Lied <henriklied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve looked around the source code, but I still haven''t found a way to > get all of the input onsave(), and to send it to another resource > through XMLHttpRequest. >Hi Henrik, The parameter of the function onsave is the note being saved. my_note.onsave = function(note) { console.log(note); return 1; } HTH, Nicolas Terray --~--~---------~--~----~------------~-------~--~----~ 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 Nicklas! Thanks, I managed to get the width/height/top/left parameters. But the text-parameter (note.text) is still "Add note text here...", even though I''ve written something else. Do you see an easy way to get this in available in the same function? On May 31, 1:38 pm, "Nicolas Terray" <nicolas.ter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/31/07, Henrik Lied <henrikl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ve looked around the source code, but I still haven''t found a way to > > get all of the input onsave(), and to send it to another resource > > through XMLHttpRequest. > > Hi Henrik, > > The parameter of the function onsave is the note being saved. > > my_note.onsave = function(note) { > console.log(note); > return 1; > > } > > HTH, > Nicolas Terray--~--~---------~--~----~------------~-------~--~----~ 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 5/31/07, Henrik Lied <henriklied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Nicklas! > > Thanks, I managed to get the width/height/top/left parameters. > But the text-parameter (note.text) is still "Add note text here...", > even though > I''ve written something else. Do you see an easy way to get this in > available in the same function? >The onsave method seems to be here only to validate. If onsave() returns false, then the note will not be saved... note1.onsave = function(note) { console.log(this.gui.TextBox.value); return 1; } will display the actual text. Yours, Nicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You are an angel, Nicklas! Thanks a bunch! On May 31, 2:21 pm, "Nicolas Terray" <nicolas.ter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/31/07, Henrik Lied <henrikl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi Nicklas! > > > Thanks, I managed to get the width/height/top/left parameters. > > But the text-parameter (note.text) is still "Add note text here...", > > even though > > I''ve written something else. Do you see an easy way to get this in > > available in the same function? > > The onsave method seems to be here only to validate. If onsave() > returns false, then the note will not be saved... > note1.onsave = function(note) { console.log(this.gui.TextBox.value); > return 1; } > will display the actual text. > > Yours, > Nicolas--~--~---------~--~----~------------~-------~--~----~ 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, if anyone''s still listening: I got the note-script to work. But now I want to expand it further by giving the input-field autocompletion (Ajax.Autocompleter). So I changed the textarea to an input in the js-file, and did everything by the book(http://wiki.script.aculo.us/scriptaculous/show/ Ajax.Autocompleter). But it just won''t show. Is it because the elements are created by the DOM? On May 31, 2:21 pm, "Nicolas Terray" <nicolas.ter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/31/07, Henrik Lied <henrikl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi Nicklas! > > > Thanks, I managed to get the width/height/top/left parameters. > > But the text-parameter (note.text) is still "Add note text here...", > > even though > > I''ve written something else. Do you see an easy way to get this in > > available in the same function? > > The onsave method seems to be here only to validate. If onsave() > returns false, then the note will not be saved... > note1.onsave = function(note) { console.log(this.gui.TextBox.value); > return 1; } > will display the actual text. > > Yours, > Nicolas--~--~---------~--~----~------------~-------~--~----~ 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 5/31/07, Henrik Lied <henriklied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So I changed the textarea to an input in the js-file, and did > everything by the > book(http://wiki.script.aculo.us/scriptaculous/show/ > Ajax.Autocompleter). > > But it just won''t show. Is it because the elements are created by the > DOM? >I replace, in the PhotoNote.prototype.CreateElements(), the lines : var newTextbox = document.createElement(''textarea''); newTextbox.value = this.text; by those : var newTextbox = document.createElement(''input''); newTextbox[''type''] = ''text''; newTextbox.value = this.text; new Form.Element.Observer(newTextbox, 0.2, function(el, value) { console.log(value); }); And it works fine. Please, could you copy-paste us your code, or (better) provide us a real demo of what you are trying to do on one of your public web space ? Thanks, Nicolas --~--~---------~--~----~------------~-------~--~----~ 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 again, Nicklas, The problem isn''t regarding creating the input-box. That''s working fine! :-) But I can''t seem to get the autocompleter to react to the input when there''s several of them! The explanation is probably pretty simple - Ajax.Autocompleter takes an input with a certain ID. When I create several image tags I create several input''s with the same ID. Don''t you think? ''cause it works on the first input, but not on the rest. Is there a solution to this? On 1 Jun, 07:57, "Nicolas Terray" <nicolas.ter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/31/07, Henrik Lied <henrikl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > So I changed the textarea to an input in the js-file, and did > > everything by the > > book(http://wiki.script.aculo.us/scriptaculous/show/ > > Ajax.Autocompleter). > > > But it just won''t show. Is it because the elements are created by the > > DOM? > > I replace, in the PhotoNote.prototype.CreateElements(), the lines : > var newTextbox = document.createElement(''textarea''); > newTextbox.value = this.text; > by those : > var newTextbox = document.createElement(''input''); > newTextbox[''type''] = ''text''; > newTextbox.value = this.text; > new Form.Element.Observer(newTextbox, 0.2, function(el, value) { > console.log(value); > }); > And it works fine. > > Please, could you copy-paste us your code, or (better) provide us a > real demo of what you are trying to do on one of your public web space > ? > > Thanks, > Nicolas--~--~---------~--~----~------------~-------~--~----~ 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 6/1/07, Henrik Lied <henriklied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I > create several > input''s with the same ID. Don''t you think? ''cause it works on the > first input, but not > on the rest. > > Is there a solution to this?Arggg. id means something like ''identifier''. The ids must be unique. Please use different ids for your different inputs and it will work better. By the way, you don''t have to provide an id to Ajax.Autocompleter. It will work with the DOM element : var newTextbox = document.createElement(''input''); new Ajax.Autocompleter(newTextbox, .......); Therefore you don''t have to compute different ids :) Yours, Nicolas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Oh, that''s great! I was not aware of that. Brilliant, thanks! :-) On 1 Jun, 09:26, "Nicolas Terray" <nicolas.ter...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/1/07, Henrik Lied <henrikl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I > > create several > > input''s with the same ID. Don''t you think? ''cause it works on the > > first input, but not > > on the rest. > > > Is there a solution to this? > > Arggg. > id means something like ''identifier''. The ids must be unique. Please > use different ids for your different inputs and it will work better. > > By the way, you don''t have to provide an id to Ajax.Autocompleter. It > will work with the DOM element : > var newTextbox = document.createElement(''input''); > new Ajax.Autocompleter(newTextbox, .......); > Therefore you don''t have to compute different ids :) > > Yours, > Nicolas--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---