[Rails-spinoffs] sorting with D&D follows the link (browser thinks I click)

2006-02-10 Thread Alain Ravet
Hi all, I've just added d&d sorting to a list where each item is a link_to .. Problem: when I drop an item to its new location, the browser think I clicked, and follows the link. Any idea? TIA. Alain ___ Rails-spinoffs mailing list Rails-spinoffs@

Re: [Rails-spinoffs] sorting with D&D follows the link (browser thinks I click)

2006-02-10 Thread Pawel Szymczykowski
On 2/9/06, Alain Ravet <[EMAIL PROTECTED]> wrote: > Hi all, > > I've just added d&d sorting to a list where each item is a link_to .. > Problem: when I drop an item to its new location, the browser think I > clicked, and follows the link. > Any idea? Roll a 1d20 to make a saving throw vs. clicking

[Rails-spinoffs] Sortable + Draggable : doesn't follow the mouse horizontally

2006-02-10 Thread Alain Ravet
When a 'draggable' element is made 'sortable', it no longer follows the mouse horizontally when you drag it. Is there a solution/workaround? TIA Alain ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/

Re: [Rails-spinoffs] Stopping an observe event

2006-02-10 Thread Todd Ross
On 2/9/06, Deco Rior <[EMAIL PROTECTED]> wrote: > If I want to stop observing a div Is this the format? > > Event.stopObserving($(''mydiv'),'click'); The stopObserving function expects you to pass the handler(/observer) in as well. Both detechEvent (IE) and removeEventListener (W3C) require it.

Re: [Rails-spinoffs] Sortable + Draggable : doesn't follow the mouse horizontally

2006-02-10 Thread Robin Haswell
Yes, use the constraints options of Sortable.create Alain Ravet wrote: When a 'draggable' element is made 'sortable', it no longer follows the mouse horizontally when you drag it. Is there a solution/workaround? TIA Alain ___

Re: [Rails-spinoffs] Element.observe () binding

2006-02-10 Thread Todd Ross
On 2/9/06, Jeremy Kitchen <[EMAIL PROTECTED]> wrote: > as for this, I believe Event.observe handles finding the proper event object > for you and passes that to your function. This is what I've experienced > anyways :) Event.observe() does nothing to smooth out passing the event in as a parameter

Re: [Rails-spinoffs] Element.observe () binding

2006-02-10 Thread Todd Ross
On 2/9/06, Jerod Venema <[EMAIL PROTECTED]> wrote: > And another reply-to-self...make that: > > Event.observe(el, 'click', (function(event) { > Element.addClassName(Event.element(event), 'myClass'); > ); ... and you're missing a ')', or I could argue that you have one '(' too many. Todd _

Re: [Rails-spinoffs] Draggables and Droppable performance (tips)

2006-02-10 Thread Dirk Eschler
Am Donnerstag, 9. Februar 2006 23:56 schrieb Ryan Gahl: > Hi all. I have some performance tips to share. I had been having > problems with the overall performance of the drag/drop objects. This is > due largely to the fact that my project really pushes the limits > (potentially thousands of draggab

RE: [Rails-spinoffs] sorting with D&D follows the link(browser thinks I click)

2006-02-10 Thread Gregory Hill
Maybe don't make anchor tags draggable? Or you could do something like change the href to point to '#' and move the actual href into your javascript, and only call it if they click without dragging. Still, I think making a clickable item draggable is begging for problems. > -Original Message

Re: [Rails-spinoffs] Element.observe () binding

2006-02-10 Thread Greg Militello
Todd, I finally got it working, though IE is a lot slower than Safari, or Firefox. You can check out my code here,: http://thinkof.net/projects/js/highlight/highlight.html http://thinkof.net/projects/js/highlight/javascript/highlight.js Or you can download the entire thing to

Re: [Rails-spinoffs] Element.observe () binding

2006-02-10 Thread Greg Militello
EUREKA!  WOOO HOOO  I finally got it... ! ! !Here is the old code: setMouseEvents: function(el) { Event.observe(el, 'mouseover', (function(event) {         Element.addClassName(el, 'highlightHover'); } )); }Here's what I did (works IE 6, Firefox 1.5, Safari 2.0.3): setMouseEvents: function(el)

[Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread John Osborn
Hello Everyone,I am working on a control collection for _javascript_/Ajax.Net. I am stuck on the class inheritance aspects of the prototype library. If someone could point me to an example it would be a great help. I have looked through the controls.js of the scriptaculous library and found someth

RE: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread Ryan Gahl
You’re missing a level of extension in the 2nd object. It should be…   Object.extend(Object.extend(MyControls.EditableTextbox.prototype, MyControls.TextBox.prototype), {     …stuff here… });   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Osborn

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Kevin Old
Hi everyone, On 2/8/06, Todd Ross <[EMAIL PROTECTED]> wrote: > On 2/8/06, Deco Rior <[EMAIL PROTECTED]> wrote: > > So the data is returned in an object that can be handled rather than use > > strain response.text? > > > > > > Is there a library that allows JSON data object manipulation ? > > The c

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Todd Ross
On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > I'm using prototype 1.4.0 final. > > Any help is greatly appreciated! I'd be happy to look at a live website. Todd ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyo

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Sebastian Kurt
Todd Ross schrieb: On 2/9/06, Sebastian Kurt <[EMAIL PROTECTED]> wrote: Hi, I'm using PHP to fill my parameterlist for Autocompleter.Local as shown in the example (http://wiki.script.aculo.us/scriptaculous/show/Autocompleter.Local). new Autocompleter.Local('recipeNameAlternative', 'rezept_li

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Your PHP-built list has quotes in it which is breaking the JS. Try: '\''.str_replace("'", "\\'", $rezept_vorgabe[$i]).'\'' Also you know you can loop through an array with http://www.php.net/foreach ? Prints: foo bar baz boo You should use the JavaScript console in Firefox 1.5, it alerts

Re: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread John Osborn
Ryan,Thank you for the quick response. I tried what you suggested and still no luck. I also found in scriptaculous.js another example of inheritance that might also work:Autocompleter.Local = Class.create(); Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(),{    ..stuff});But t

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Sebastian Kurt
thanks, i will try as far as I can. Robin Haswell schrieb: Your PHP-built list has quotes in it which is breaking the JS. Try: '\''.str_replace("'", "\\'", $rezept_vorgabe[$i]).'\'' there are no ' in $rezept_vorgabe[$i]. i add the in the loop(PHP), see for ($i=0;$i<$ende;$i++) {

Re: [Rails-spinoffs] Element.observe () binding

2006-02-10 Thread Todd Ross
On 2/10/06, Greg Militello <[EMAIL PROTECTED]> wrote: > You will notice former code had the hardcoded string 'highlightHover', but > the new code get the value of that class via the class options. Yup. Looks good. An option that doesn't do anything doesn't sound like a very good option. :) > C

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Todd Ross
On 2/10/06, Sebastian Kurt <[EMAIL PROTECTED]> wrote: > there are no ' in $rezept_vorgabe[$i]. i add the in the loop(PHP), see > for ($i=0;$i<$ende;$i++) { > echo "'".$region_vorgabe[$i]."'"; > } You are mistaken. 'Costa Rica', 'Cote d'Ivoire', 'Daenemark' d'Ivoir

Re: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread Todd Ross
On 2/10/06, John Osborn <[EMAIL PROTECTED]> wrote: > Thank you for the quick response. I tried what you suggested and still no > luck. I also found in scriptaculous.js another example of inheritance that > might also work: > > Autocompleter.Local = Class.create(); > Autocompleter.Local.prototype =

RE: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread Ryan Gahl
If my suggestion did not work then my next thought is that you are not actually defining “MyControls” first.   You can’t define MyControls.TextBox is MyControls is not defined.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Osborn Sent: Friday, February 1

Re: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread John Osborn
Ryan: No I am defining that with a var -- besides I would get a differant error that blah.blah is not a contructorTodd: The skeleton code I am using to create the base class is in my first email. On 2/10/06, Ryan Gahl <[EMAIL PROTECTED]> wrote: If my suggestion did not work then my ne

RE: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread Ryan Gahl
Ok then, the other thing then is your MyControls.TextBox doesn’t seem to have an “initialize” method. That might have something to do with it. Try this, change “baseInitialize to initialize. Then you will have instantiate your base class in your subclass’s initialize method to inherit, like

Re: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread Todd Ross
On 2/10/06, John Osborn <[EMAIL PROTECTED]> wrote: > Todd: The skeleton code I am using to create the base class is in my first > email. Sorry. I was expecting to see MyControls.Base. http://www.brainsick.com/prototype/classinheritance.html There were a couple changes. Like Ryan said, you need

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Jeremy Kitchen
On Friday 10 February 2006 13:38, Sebastian Kurt wrote: > okay, i can. http://lekapidia.ml-its.de/formtest/test.php 'Cote d'Ivoire' you need to escape that inner single quote. Again, I would recommend using some sort of json module to handle this for you. -Jeremy -- Jeremy Kitchen ++ [EMAIL

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
I think that's a bit overkill. My fix should work fine for anything that doesn't include newlines. If this were my application I'd dump the data in a hidden or maybe as an xml string and parse it with the built-in DOM parser. Much better parse something in XML than *shudder* javascript. JS sho

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Michael Peters
Robin Haswell wrote: > I think that's a bit overkill. My fix should work fine for anything that > doesn't include newlines. If this were my application I'd dump the data > in a hidden or maybe as an xml string and parse it with the > built-in DOM parser. Much better parse something in XML than *

Re: [Rails-spinoffs] Prototype Inheritance example

2006-02-10 Thread John Osborn
Thanks for all you help and quick replies. It is still not working but it must be a syntax error or something I will have to look at it later.Thanks.On 2/10/06, Todd Ross <[EMAIL PROTECTED]> wrote: On 2/10/06, John Osborn <[EMAIL PROTECTED]> wrote:> Todd: The skeleton code I am using to create the

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Hm I may be mistaken. AFAIU JSON is a JS-compatible serialization form? Do browsers have built-in JSON deserializers? My the way, you'd be surprised at how efficient XML parsers are. In Python, it's quicker to decode a list from XML than using the Pickle module (which is equivalent to PHP seri

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Michael Peters
Robin Haswell wrote: > Hm I may be mistaken. AFAIU JSON is a JS-compatible serialization form? > Do browsers have built-in JSON deserializers? Well, they'd have to if they have JS interpreters right? -- Michael Peters Developer Plus Three, LP ___ Ra

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Michael Peters wrote: Robin Haswell wrote: Hm I may be mistaken. AFAIU JSON is a JS-compatible serialization form? Do browsers have built-in JSON deserializers? Well, they'd have to if they have JS interpreters right? Um no, I mean can you convert a JSON object into a memory construct wi

RE: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Ryan Gahl
No, but from I understand (don't use JSON myself), it translates directly into Javascript objects when eval'ed. var myObj = eval(myJSONstring); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robin Haswell Sent: Friday, February 10, 2006 5:02 PM To: rails

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Oh I see. How interesting. Eval scares me heh. Well in which case you'd have to unit-test JSON vs XML to see which would be quicker. I have a feeling it'd be close though, and I know which one I'd pick if that was the case. -Rob Ryan Gahl wrote: No, but from I understand (don't use JSON my

[Rails-spinoffs] Add value to other input impelmented?

2006-02-10 Thread Sebastian Kurt
Hi, I want to add the value of my Autocompletion field to an input-field by clicking on a (submit-)Button/Link. Is there any function that provides me easy help in scriptalous-JS? It would be nice if there is a possibility to give the added value a "+" or "-" so the input-field knows if it has

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Sebastian Kurt
thanks to all of you! this sign was the seed of all evil. move it into an JS-Array helped to solve it var temp_rezept_array = new Array(); //Schleife thx sebastian Todd Ross schrieb: On 2/10/06, Sebastian Kurt <[EMAIL PROTECTED]> wrote: there are no ' in $rezept_vorgabe[$i]. i add the in th

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Jeremy Kitchen
On Friday 10 February 2006 14:52, Robin Haswell wrote: > I think that's a bit overkill. My fix should work fine for anything that > doesn't include newlines. If this were my application I'd dump the data > in a hidden or maybe as an xml string and parse it with the > built-in DOM parser. Much bett

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
There are a few mistakes in this but yeah that would solve it for the meantime. -Rob Sebastian Kurt wrote: thanks to all of you! this sign was the seed of all evil. move it into an JS-Array helped to solve it var temp_rezept_array = new Array(); //Schleife thx sebastian Todd Ross schrieb:

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Jeremy Kitchen
On Friday 10 February 2006 15:05, Robin Haswell wrote: > Oh I see. How interesting. Eval scares me heh. Well in which case you'd > have to unit-test JSON vs XML to see which would be quicker. I have a > feeling it'd be close though, and I know which one I'd pick if that was > the case. no need to

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Oh I see! Sorry. That seems, well, bloody interesting. I don't do anything like this at the moment (all AJAX) but I will consider that for the future. I do need a way to encapsulate a load of HTML inside a JS string accurately. At the moment's I'm just doing search/replace escaping of quotes an

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Jeremy Kitchen
On Friday 10 February 2006 15:58, Robin Haswell wrote: > Oh I see! Sorry. That seems, well, bloody interesting. I don't do > anything like this at the moment (all AJAX) but I will consider that for > the future. I do need a way to encapsulate a load of HTML inside a JS > string accurately. At the m

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Robin Haswell
Nice. As I say, I don't have a need to pass anything other than straight-up strings at the moment, but that certainly is worth remembering. Cheers. -Rob Jeremy Kitchen wrote: On Friday 10 February 2006 15:58, Robin Haswell wrote: Oh I see! Sorry. That seems, well, bloody interesting. I don't

Re: [Rails-spinoffs] Length of parameters in Autocompleter.Local()

2006-02-10 Thread Michael Peters
Robin Haswell wrote: > Michael Peters wrote: > >> >> Robin Haswell wrote: >> >>> Hm I may be mistaken. AFAIU JSON is a JS-compatible serialization form? >>> Do browsers have built-in JSON deserializers? >> >> >> Well, they'd have to if they have JS interpreters right? >> > > > Um no, I mean ca

Re: [Rails-spinoffs] Error in prototype.js? / Enumerable.each

2006-02-10 Thread Todd Ross
On 2/9/06, smi <[EMAIL PROTECTED]> wrote: > I am using the latest version of prototype.js from the SVN, including > the wonderful $$ operator to loop through a number of elements with a > certain classname. In Firefox everything works fine, no JS error, but in > IE I get an error in the .each funct

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Kevin Old
Hi Todd, On 2/10/06, Todd Ross <[EMAIL PROTECTED]> wrote: > On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > > I'm using prototype 1.4.0 final. > > > > Any help is greatly appreciated! > > I'd be happy to look at a live website. > Here's the page: http://kold.homelinux.com/prototype/testajax2.h

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Todd Ross
On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > Here's the page: http://kold.homelinux.com/prototype/testajax2.html I was hoping to be able to play with your X-JSON approach because that seems to be what you wanted originally. The latest iteration works for me in Firefox, and I'd imagine will

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Kevin Old
On 2/10/06, Todd Ross <[EMAIL PROTECTED]> wrote: > On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > > Here's the page: http://kold.homelinux.com/prototype/testajax2.html > > I was hoping to be able to play with your X-JSON approach because that > seems to be what you wanted originally. The lates

[Rails-spinoffs] Re: sorting with D&D follows the link (browser thinks I click)

2006-02-10 Thread Alain Ravet
Another way to ask the question: "How to make a list of links sortable?" I read the doc and scratched my head, but I found nothing, not even dandruff. Alain > I've just added d&d sorting to a list where each item is a link_to .. > Problem: when I drop an item to its new location, the brow

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Kevin Old
On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > On 2/10/06, Todd Ross <[EMAIL PROTECTED]> wrote: > > On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > > > Here's the page: http://kold.homelinux.com/prototype/testajax2.html > > > > I was hoping to be able to play with your X-JSON approach becaus

Re: [Rails-spinoffs] JSON and scriptaculous

2006-02-10 Thread Ed C.
Just include the ( and ) parens in your X-JSON header string. On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > > On 2/10/06, Todd Ross <[EMAIL PROTECTED]> wrote: > > > On 2/10/06, Kevin Old <[EMAIL PROTECTED]> wrote: > > > > Here's the page: htt

[Rails-spinoffs] cannot combine in_place_editor_field and a sortable list

2006-02-10 Thread Alain Ravet
As the title says, _sortable list_ doesn't like 'in_place_editor' very much. Problem: when you click on an editable element, the field editor and the 2 buttons appears - good - , BUT they keep following the mouse - bad -, and moving, while you're in edit mode. Alain ___