[Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-04 Thread fma
Ok, I found something... If I look at the HTML tree in the IE debugger, on the left panel I can't see any 'class' attribute. However, it does appear on the right panel (called Attributs), with the correct value. But IE does not seems to use it. I found that I can add an attribute to the div in the

[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)

2009-12-04 Thread Wil
TJ and David, Thanks - that was all very useful information and I have things working now. The info.key.info.value business was, in retrospect, a fairly silly failure to think about the order of operations. I somehow expected it to have been (info.key).(info.value), rather than ((info.key).info).

[Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-04 Thread fma
Very usefull site, thanks. Does someone have an idea of my problem? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, se

[Proto-Scripty] Re: this and setTimeout in Prototype-based class

2009-12-04 Thread fma
Thanks for the tip! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@

[Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-04 Thread Eric
When you have a large piece of code to post, it is nice to also post a link on pastie.org or jsbin.com. For example, I pasted the code you've posted on pastie here: http://pastie.org/727583 Eric On Dec 4, 8:09 am, fma wrote: > BTW, what is the tag to format code on this group? -- You receive

[Proto-Scripty] Re: this and setTimeout in Prototype-based class

2009-12-04 Thread Eric
Well, since you're in Prototype, you can do this: this.doSomething.bind(this).delay(1000, ...); where the "..." stand for other parameters of doSomething method (if they are needed). Eric On Dec 3, 3:29 pm, Daan Mortier wrote: > I'm sorry, I made some typos. This is correct: > > // where obj

[Proto-Scripty] Re: How to queue Multiple effects?

2009-12-04 Thread fma
I didn't know yet this param ;o) I'll give it a try... Thanks, -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send em

Re: [Proto-Scripty] How to queue Multiple effects?

2009-12-04 Thread Christophe Decaux
What about using afterFInish instead of a queue ? I know, it's not very nice... new Effect.multiple([this._view.prevButton, this._view.nextButton, this._view.hideButton], Effect.Opacity, {from: 0, to: 1, duration: 2,afterFinish:function(){ new Effect.multiple([this._view.

[Proto-Scripty] Re: background-color stucked after an highlight effect

2009-12-04 Thread Eric
Thanks David, It does work! And do does tr.style.backgroundColor = ''; Why did I look for something complex when solution was so simple :o) Thanks again! Eric On Dec 4, 1:08 pm, david wrote: > Hi Eric, > > do you try to reset the element style property for background-color ?? > try this > ne

[Proto-Scripty] How to queue Multiple effects?

2009-12-04 Thread fma
Is it possible to combine Multiple effect and Queue? I tried the following: new Effect.multiple([this._view.prevButton, this._view.nextButton, this._view.hideButton], Effect.Opacity, {from: 0, to: 1, duration: 2}, {queue: {position: 'end', scope: 'fade'}});

[Proto-Scripty] Element initialisation

2009-12-04 Thread speedpac...@gmail.com
Hello there, I have another question that I hope someone can give me some insight too... As I want all javascript code to be in a seperate file, I wrote a function "initialiseElements" which literally takes an element and initialises its behaviour based upon some attributes (classname for instanc

[Proto-Scripty] Re: Using Ajax.Request to fetch an image

2009-12-04 Thread fma
That's what I did, using 'observe' to register the 'load' event. Not that I had to use stopObserving() to ensure that the callback was not called several times... -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this gr

[Proto-Scripty] Re: background-color stucked after an highlight effect

2009-12-04 Thread david
Hi Eric, do you try to reset the element style property for background-color ?? try this new Effect.Highlight('b',{queue: 'end', afterFinish: function() { $('b').setStyle({backgroundColor:''});}}); -- david On 4 déc, 12:55, Eric wrote: > Hi, > > I have a table with even rows having an "even"

[Proto-Scripty] Re: Trouble removing a select

2009-12-04 Thread david
Hi srufle, it works for me in FF3.5. Don't you have modified the remove() merthod in the specified object. Because myElement.remove() ans Element.remove('myElementId') are the same function. -- david On 1 déc, 15:54, srufle wrote: > I am not sure I may have found an issue. > > On FF35 > Does n

[Proto-Scripty] background-color stucked after an highlight effect

2009-12-04 Thread Eric
Hi, I have a table with even rows having an "even" class name. even changes the background color of the row: tr.even { background-color: #def; } My concern is that after using a Effect.Highligth on some rows, if I add or remove the even className to them, their background color doesn't change an

Re: [Proto-Scripty] Re: Using Ajax.Request to fetch an image

2009-12-04 Thread Peter De Berdt
On 04 Dec 2009, at 10:34, fma wrote: > Ok, I see. Someone on the web proposed to encode images in base64 to > be able to fetch them using text answer. Do you think it is a good > idea? Let me rephrase what I meant (AJAX wasn't the correct term, you just need to rely on asynchronous events and

[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)

2009-12-04 Thread david
Hi, Thanks to TJ answer, I forgot THE each second argument to automatically bind the called function to a context. -- david. On 4 déc, 12:22, "T.J. Crowder" wrote: > Hi, > > > Tracing through the code, everything appears fine up to the point > > where I try to call the stored callback. This lin

[Proto-Scripty] Re: element.insert not working in safari 4.0.3 (OS X)

2009-12-04 Thread david
Hi jjaayy, first, do you have trry an alert inside the oncomplete function, so it indicate that the AJAX request work. Next, does your AJAX.Request return something (transport.responseText contain something) ? that is some question you did not answer, but it could be so much think !! Any chance

[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)

2009-12-04 Thread T.J. Crowder
Hi, > Tracing through the code, everything appears fine up to the point > where I try to call the stored callback. This line: > > info.key.info.value(this)); > > info.key and info.value are both valid objects, but nothing happens. Your 'info.key' property is your observer, which I tend to suspect

[Proto-Scripty] Re: storing a closure as the value in a Hash (and then calling it later)

2009-12-04 Thread david
Hi Wil, info.key.info.value(this)); have two closed brace, but I'm sure that it's a cut & paste error :)) Something surprise me, you call info.key.info.value as an object and you say that info.key and info.value is defined. It's strange, because you should have say info.key.info.value is an existi

[Proto-Scripty] Re: Element.remove, Element.stopObserving, Function.bindAsEventListener

2009-12-04 Thread T.J. Crowder
Hi, On Dec 3, 3:35 pm, Rob Cluett wrote: > RE: Element.remove(DOMelement) > > Does this method remove all children of the specified DOMelement > before removing the specified DOMelement or must I delete all of the > DOMelements children, grandchildran, etc. first? Removing an element, by its nat

[Proto-Scripty] storing a closure as the value in a Hash (and then calling it later)

2009-12-04 Thread Wil
Hi all, I'm trying to implement a somewhat generic way for my controller objects to listen for changes to various properties of my model objects. I'm not a javascript expert, so there is quite possibly a Better Way™ of solving the bigger problem - I'm open to pointers in that direction, if my curr

[Proto-Scripty] Element.remove, Element.stopObserving, Function.bindAsEventListener

2009-12-04 Thread Rob Cluett
RE: Element.remove(DOMelement) Does this method remove all children of the specified DOMelement before removing the specified DOMelement or must I delete all of the DOMelements children, grandchildran, etc. first? RE: Element.stopObserving(DOMelement) Does this method remove all events being obs

[Proto-Scripty] element.insert not working in safari 4.0.3 (OS X)

2009-12-04 Thread jjaayy
hi everybody, I'm not sure I my code is wrong or if this is a problem with safari (it's working in FF): In a Ajax.Request statement I have onComplete: function(transport) { $('container_td_loading').insert({ after: transport.responseText }); } But this hangs in S

Re: [Proto-Scripty] this and setTimeout in Prototype-based class

2009-12-04 Thread Daan Mortier
I'm sorry, I made some typos. This is correct: // where obj is obviously your object var func = function() { this.doSomething() }.bind( obj ); window.setTimeout( func, 1000 ); Daan On Thu, Dec 3, 2009 at 15:28, Daan Mortier wrote: > To pass a function to setTimeout that is binded to an obj

Re: [Proto-Scripty] this and setTimeout in Prototype-based class

2009-12-04 Thread Daan Mortier
To pass a function to setTimeout that is binded to an object of choice, to something along these lines: // where obj is obviously your object var func = function() { this.doSomething() }.bind( this ); window.setTimeout( func, 1000 ); Function.prototype.bind is a function that's defined in the

Re: [Proto-Scripty] Re: Using Ajax.Request to fetch an image

2009-12-04 Thread Alex McAuley
I can see alot of security issues with that! Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "fma" To: "Prototype & script.aculo.us" Sent: Friday, December 04, 2009 9:34 AM Subject: [Proto-Scripty] Re: Using Ajax.Request to fetch an image > Ok, I see. Someone

[Proto-Scripty] Re: this and setTimeout in Prototype-based class

2009-12-04 Thread fma
Thanks for the code! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...

[Proto-Scripty] Re: Using Ajax.Request to fetch an image

2009-12-04 Thread fma
Ok, I see. Someone on the web proposed to encode images in base64 to be able to fetch them using text answer. Do you think it is a good idea? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to pro

Re: [Proto-Scripty] Re: document.write() vs Element/appendChild()

2009-12-04 Thread Alex McAuley
There isn't one Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "fma" To: "Prototype & script.aculo.us" Sent: Friday, December 04, 2009 7:09 AM Subject: [Proto-Scripty] Re: document.write() vs Element/appendChild() > BTW, what is the tag to format code on this

Re: [Proto-Scripty] Using Ajax.Request to fetch an image

2009-12-04 Thread Alex McAuley
You cant .. simply fetch HTML and have the image in the html with css or Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "fma" To: "Prototype & script.aculo.us" Sent: Friday, December 04, 2009 6:59 AM Subject: [Proto-Scripty] Using Ajax.Request to fetch an image

Re: [Proto-Scripty] this and setTimeout in Prototype-based class

2009-12-04 Thread Christophe Decaux
Hi there, IMHO, Ajax wouldn't help as the real timing issue is around the image load which I don't think is predictable. So, why don't you use a image preload mechanism such as the one I use in a slightly different way. I display a waiting message, preload the pic and then hide the waiting mes