RE: [Rails-spinoffs] Question about event listener highlighting withchild elements

2006-03-03 Thread Ryan Gahl
1. Create a separate class that has your highlight/unhighlight behavior in it, and extend just the element you want to highlight with that class… like this (also allows you to easily apply this behavior elsewhere when you need it in the future):     Object.extend(this.el, Highlig

[Rails-spinoffs] Question about event listener highlighting with child elements

2006-03-03 Thread Casey O'Neill
I have created a _javascript_ object which is initialized for some input fields, fieldsets, and divs on the page. With each object i attach a mouseover and mouseout event that highlights and un-highlights. Also on mouseout i am trying to display the id of the object to a console. The highlighting w

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
These inconsistencies exist in ALL the browsers... different cases for each one. Yea yea yea, I like FF better also, but it has just as many problems. No one has made a perfect browser yet. Anyway, I just reverted to using the old event attachment method for this class, so I could use the INTUITI

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
Totally disagree. Which is easier? if (keyThatWasPressed.toLowerCase() == "g") << for your "99%" of people or... if (keyThatWasPressed.toLowerCase() == "g") { ...Now figure out if shift and/or capslock is down.. } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTE

Re: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Robin Haswell
Because that's what you get when you produce a product which is a just a series of dirty hacks added on to the last version. Honestly, I would bet any money that is the real answer. -Rob Ryan Gahl wrote: This is another case of what we were talking about yesterday. Browser inconsistencies. Wh

Re: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Robin Haswell
I'd say, returning letters consistently cased makes sense. element.nodeName is always returned in capital letters for the same reason - because 99% of the time the case doesn't matter, and you really don't want to be calling case-conversion functions when you just want to see if something == a

Re: [Rails-spinoffs] Dynamic JS updating / data-preloading using ajax

2006-03-03 Thread Jerod Venema
Hey Jan,You may want to consider JSON. I don't know much about Ruby, but JSON is the simplest format to use if you're just going to be converting the results to JS objects anyway. Regardless of the language you use, you'll have to pick a method for returning the data. There are any number of possib

Re: [Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Robin Haswell
Cheers, good stuff. Yeah I had a bit of a debate over the cursor thing. I thought it would be easy enough for other people to do it so I left it. Glad you like it. I'll probably submit a finished version on monday. I'm going to just add an option for "Fixed height" and let people set it if t

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
This is another case of what we were talking about yesterday. Browser inconsistencies. Why would, in the same browser, attaching an event handler one way give you different results from attaching it another way?   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Rya

Re: [Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Danger Stevens
I just had to see this in action so I put up an example of Robin's excellent work here: http://turnstudio.com/accordian.htmlIt's butt-ugly but it at least shows the different elements in action.  also, I made the h3 use a link cursor - that's not actually part of the accordian code.    - DangerOn 3

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
Yes, prototype handles that (so it does exist)   Function.prototype.bindAsEventListener = function(object) {   var __method = this;   return function(event) {     return __method.call(object, event || window.event);   } }     Now… just attaching the event handler as you suggested

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Gregory Hill
Well, my point was that in IE, the variable that is passed to the function does not exist, so you need to reference the global ‘event’ object.  Or does prototype handle that in the bindAsEventListener code already?    What happens if you do this, instead of the inline handler? $(‘id’).>

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
I’ve simplified my example. Changing “evt” to “event” makes no difference, you can name that parameter anything you want, it’s just a function argument variable (which is a reference to the actual event object).   I’m using IE6. I’m implementing a textbox input masking script in a proto O

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Gregory Hill
Just a random thought, but what if you change ‘evt’ to ‘event’.  Does it work then?   What browser are you testing in, btw?  My thought is based on the fact that event is a global object in IE that gets the last event triggered.  I thought that you had to pass the object in as a parameter i

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
  The above returns “g” when “g” is pressed and “G” when “G” is pressed.   WHILE…     someClass = Class.create(); someClass.prototype = {     initialize: function()     {     Event.observe($(“tb”), “keypress”, this.showkeyPressed.bindAsEven

Re: [Rails-spinoffs] Ajax.InPlaceEditor - disabling the yellow highlight?

2006-03-03 Thread John Beppu
On 3/3/06, Andrew Kaspick <[EMAIL PROTECTED]> wrote: > I just set my hightlight colour like so highlightcolor:'transparent' I tried that and it seemed to work, but Firefox's Javascript console was spewing a lot of warnings about #NaNNanNan not being a valid color every time I rolled over an in

RE: [Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Gregory Hill
Code?  Can’t help much without seeing what you’re doing.     From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gahl Sent: Friday, March 03, 2006 1:48 PM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] event.keyCode broken in prototype?   I

[Rails-spinoffs] event.keyCode broken in prototype?

2006-03-03 Thread Ryan Gahl
I ran 2 tests. One using proto’s Event.observe, and another using an in-line handler of the “keydown” event in a textbox.   Using .bindAsEventListener, the event.keyCode is always returning a capital letter, no matter what. The in-line event handler returns lowercase vs. uppercase correct

[Rails-spinoffs] Re: How to use the sortable_element tagname option?

2006-03-03 Thread Sean Mountcastle
Ok, while I'm able to drag-and-drop the table rows in the browser, my callback (onUpdate) function is not being called (nor is the onComplete function), so the new order isn't being saved in the DB. Any ideas why this would be happening? Here's the Rails code: <%= sortable_element 'item-list-bod

Re: [Rails-spinoffs] xml handling

2006-03-03 Thread Francisco Calderon
i did it, the problem was i am using var xml = originalRequest.responseText; i need to use this var xml = originalRequest.responseXML; thx a lotOn 3/3/06, Maninder, Singh <[EMAIL PROTECTED]> wrote: Make sure the response you are receiving is XML and not Text in case you want to traverse throu

Re: [Rails-spinoffs] Ajax.InPlaceEditor - disabling the yellow highlight?

2006-03-03 Thread Andrew Kaspick
I just set my hightlight colour like so highlightcolor:'transparent' Best I could figure out. On 3/3/06, John Beppu <[EMAIL PROTECTED]> wrote: > Is there a way to disable Ajax.InPlaceEditor's yellow rollover highlight? > ___ > Rails-spinoffs mailing

[Rails-spinoffs] Ajax.InPlaceEditor - disabling the yellow highlight?

2006-03-03 Thread John Beppu
Is there a way to disable Ajax.InPlaceEditor's yellow rollover highlight? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Re: [Rails-spinoffs] xml handling

2006-03-03 Thread Francisco Calderon
On 3/3/06, Maninder, Singh <[EMAIL PROTECTED]> wrote: Make sure the response you are receiving is XML and not Text in case you want to traverse through XML.Check it by checking the responseHeaders(). how? i put this function showResponse(originalRequest){     alert(originalRequest.responseHeader

Re: [Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Robin Haswell
Sorry, it would be unprofessional of me to give my example (as I wrote this for work), but it's intended to be identical to: http://openrico.org/rico/demos.page?demo=ricoAccordion.html ..eventually. The only work left to be done is work out whether we wanna expand the container (#accordion) to

Re: [Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Nicolas Terray
I love real live examples, do you have one ? :) On 3/3/06, Robin Haswell <[EMAIL PROTECTED]> wrote: > Oops, should provide an example: > > > > Heading> > > Content geoes here > Etc.. > >

Re: [Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Robin Haswell
Oops, should provide an example: Heading> Content geoes here Etc.. Another heading Yet more tatsy content

RE: [Rails-spinoffs] xml handling

2006-03-03 Thread Maninder, Singh
Make sure the response you are receiving is XML and not Text in case you want to traverse through XML. Check it by checking the responseHeaders(). Hope this helps! Thank you, Mandy. <>___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails

[Rails-spinoffs] [PATCH] Effect.Accordion (not from the wiki)

2006-03-03 Thread Robin Haswell
Hello boys and girls In the ever-loving spirit of OSS, here's another feature for s.a.u. In particular it's called Effect.Accordion, and is a scriptaculified version of openrico's Accordion. Work in progress, I'll submit further modifications as the come in, but this is 90% of what needs to be d

[Rails-spinoffs] xml handling

2006-03-03 Thread Francisco Calderon
Hello there, im having a problem with the xml handling, i want to get and xml node and put things in an input text but im a little lost, im using this code, but isn't work, what am i doing wrong? -
function getXML(){
    var url = '';
    var myAjax = new Ajax.Re

Re: [Rails-spinoffs] Updated: window dialog script

2006-03-03 Thread Jerod Venema
Sorry, we're using the SVN version of script.aculo.us...which has v1.5pre0 of prototype. Its a new function. Careful when removing the strip() function, it *could* cause themes to break. You can just replace it with a regex to remove whitespace if that's the case. -JerodOn 3/3/06, Michael Peters <[

Re: [Rails-spinoffs] Serializing Forms with disabled fields

2006-03-03 Thread David Zülke
You're wrong, I'm afraid. Disabled elements are never sent. I don't know any browser that does not adhere to this part of the HTML spec (http://www.w3.org/TR/html4/interact/forms.html, read sections 12 and 13.2). Maybe you are confusing this with fields set to "display:none" - David Am 03

RE: [Rails-spinoffs] Serializing Forms with disabled fields

2006-03-03 Thread Gregory Hill
> Because that's how form behaviour is defined? I don't know what browser > you're using, but anything I've ever seen sends disabled elements along > just like every other element. It's been too long since I looked into it, but either IE or Firefox does not send disabled elements along. Of course

Re: [Rails-spinoffs] Serializing Forms with disabled fields

2006-03-03 Thread Robin Haswell
Because that's how form behaviour is defined? I don't know what browser you're using, but anything I've ever seen sends disabled elements along just like every other element. In my experience the only deviation between a browser's normal behaviour and the Form.serialize function is the handling of

[Rails-spinoffs] Dynamic JS updating / data-preloading using ajax

2006-03-03 Thread Jan Deppisch
Hi all, I'm building an application which uses mostly ajax to update the sections of the page. Now I've come to some thoughts on how to make the ajax-handling more efficient / less buggy. Currently, when the page loads up, I start some "new Ajax.Updater"-stuff to fill some sections with content f

Re: [Rails-spinoffs] Re: How to use the sortable_element tagname option?

2006-03-03 Thread Nicolas Terray
On 3/3/06, Sean Mountcastle <[EMAIL PROTECTED]> wrote: > > Could you try to replace :tagname by :tag ? > > Thanks Nicolas, that seems to have fixed the tr vs 'tr' issue. The > version of dragdrop.js I have (from Rails 1.0) has the following > comment which threw me off: > tag: 'li',

[Rails-spinoffs] Serializing Forms with disabled fields

2006-03-03 Thread David Zülke
Does anyone know why Prototype adds disabled fields to the query string generated by Form.serialize()? I have looked through the code, there is no way around that, I'll have to do it by hand. Nevertheless, I find that behavior a little irritating. Any ideas why it's implemented like this?

[Rails-spinoffs] Re: How to use the sortable_element tagname option?

2006-03-03 Thread Sean Mountcastle
> Could you try to replace :tagname by :tag ? Thanks Nicolas, that seems to have fixed the tr vs 'tr' issue. The version of dragdrop.js I have (from Rails 1.0) has the following comment which threw me off: tag: 'li', // assumes li children, override with tag: 'tagname' It see

Re: [Rails-spinoffs] How to use the sortable_element tagname option?

2006-03-03 Thread Nicolas Terray
On 3/3/06, Sean Mountcastle <[EMAIL PROTECTED]> wrote: > I'm having some difficulty adding drag-and-drop sorting to my > application. I'm hoping that someone can help me figure out what I'm > doing wrong: > > #view > > ... > > > > ... > <%= sortable_element('item-list-body', >

[Rails-spinoffs] How to use the sortable_element tagname option?

2006-03-03 Thread Sean Mountcastle
I'm having some difficulty adding drag-and-drop sorting to my application. I'm hoping that someone can help me figure out what I'm doing wrong: #view ... ... <%= sortable_element('item-list-body', :tagname => 'tr', :url => { :controller => 'Item',

Re: [Rails-spinoffs] Updated: window dialog script

2006-03-03 Thread Michael Peters
Marco M. Jaeger wrote: > The dialog script has been updated – thanks to Jerod we were able to add > themes – please see changelog for further details and fixes. > > > > The latest version can be downloaded from here: > http://www.net4visions.com/dev/downloads/dialog.zip The only problem I ha