Re: [Proto-Scripty] Where is the Ajax.Request options documentation?

2016-07-11 Thread Christophe Decaux
Hi there,

Just click on the « Ajax section » header in the left column (the black one). 
That will link you to : http://prototypejs.org/doc/latest/ajax/ 


In there, you’ll find what you’re looking for…


Ajax options

All Ajax classes share a common set of options and callbacks. Callbacks are 
called at various points in the life-cycle of a request, and always feature the 
same list of arguments.
Common options

asynchronous (Boolean; default true): Determines whether XMLHttpRequest is used 
asynchronously or not. Synchronous usage is strongly discouraged — it halts all 
script execution for the duration of the request and blocks the browser UI.
contentType (String ; 
default application/x-www-form-urlencoded): The Content-type header for your 
request. Change this header if you want to send data in another format (like 
XML).
encoding (String ; default 
UTF-8): The encoding for the contents of your request. It is best left as-is, 
but should weird encoding issues arise, you may have to tweak this.
method (String ; default 
post): The HTTP method to use for the request. The other common possibility is 
get. Abiding by Rails conventions, Prototype also reacts to other HTTP verbs 
(such as put and delete) by submitting via post and adding a extra _method 
parameter with the originally-requested method.
parameters (String ): The 
parameters for the request, which will be encoded into the URL for a get 
method, or into the request body for the other methods. This can be provided 
either as a URL-encoded string, a Hash 
, or a plain Object 
.
postBody (String ): 
Specific contents for the request body on a post method. If it is not provided, 
the contents of the parameters option will be used instead.
requestHeaders (Object ): A 
set of key-value pairs, with properties representing header names.
evalJS (Boolean | String ; 
default true): Automatically evals the content of Ajax.Response#responseText 
 
if the Content-type returned by the server is set to one of text/javascript, 
application/ecmascript (matches expression 
(text|application)\/(x-)?(java|ecma)script). If the request doesn't obey 
same-origin policy, the content is not evaluated. If you need to force 
evalutation, pass 'force'. To prevent it altogether, pass false.
evalJSON (Boolean | String 
; default true): 
Automatically evals the content of Ajax.Response#responseText 
 
and populates Ajax.Response#responseJSON 
 
with it if the Content-type returned by the server is set to application/json. 
If the request doesn't obey same-origin policy, the content is sanitized before 
evaluation. If you need to force evalutation, pass 'force'. To prevent it 
altogether, pass false.
sanitizeJSON (Boolean; default is false for same-origin requests, true 
otherwise): Sanitizes the contents of Ajax.Response#responseText 
 
before evaluating it.
Common callbacks

When used on individual instances, all callbacks (except onException) are 
invoked with two parameters: the Ajax.Response 
 object and the result 
of evaluating the X-JSONresponse header, if any (can be null).
For another way of describing their chronological order and which callbacks are 
mutually exclusive, see Ajax.Request 
.
onCreate: Triggered when the Ajax.Request 
 object is initialized. 
This is after the parameters and the URL have been processed, but before 
opening the connection via the XHR object.
onUninitialized (Not guaranteed): Invoked just after the XHR object is created.
onLoading (Not guaranteed): Triggered when the underlying XHR object is being 
setup, and its connection opened.
onLoaded (Not guaranteed): Triggered once the underlying XHR object is setup, 
the connection is open, and it is ready to send its actual request.
onInteractive (Not guaranteed): Triggered whenever the requester receives a 
part of the response (but not the final part), should it be sent in several 
packets.
onSuccess: Invoked when a request completes and its status code is undefined or 
belon

Re: [Proto-Scripty] Prototype old documentation

2012-12-03 Thread Christophe Decaux
I believe that what you are looking for is here: 

http://prototypejs.org/doc/1.6.0/

Hope this helps

Christophe

Le 30 nov. 2012 à 18:20, protobook  a écrit :

> This suddenly seems to have disappeared. It used to be at
> http://www.prototypejs.org/api
> 
> I still look at it occasionally because there are things I can never
> find in the current docs.
> For example, could someone tell me where it explains about $break?
> Thanks.
> Ian
> 
> -- 
> 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-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 

-- 
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-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: enumerate hash

2010-04-14 Thread Christophe Decaux
I'm sorry, but I don't understand your questions.

Maybe I can explain what these lines say:
1- this is a loop, like :   "Take every pair of the Hash referenced as 
HashtoBeTested" 
Remember that a Hash is a collection of pairs. Each pair is composed of a key 
and a value  
2- for every pair, compare the value of the pair with ValueToTest
3- if they are equal, then remove this pair from the Hash
For such a removal, you have to identify the pair by its key, and not by its 
value

Hope this helps,

Le 14 avr. 2010 à 15:38, chrysanthe m a écrit :

> Hi Christophe
> Thanks, but is there anything more to the syntax.  Also how do you use that 
> optional context parameter with this within the loop and for what enhanced 
> value/processing does it give you?
> 
> On Mon, Apr 12, 2010 at 4:59 AM, Christophe Decaux 
>  wrote:
> If I understand well, what you're asking for is pretty close to what you 
> suggested in your original post:
> 
> hashToBeTested.each(function(pair){
>   if(valueToTest==pair.value){
> hashToBeTested.unset(pair.key);
>   }
> }
> 
> 
> Christophe
> 
> Le 10 avr. 2010 à 12:36, chrysanthe m a écrit :
> 
>> Hi, again
>> Sorry for being obtuse.  But can someone help me and even understand how to 
>> write a function and call it on a hash that will take a value, compare it 
>> against each of the keys in the hash, on match delete the key/value, and 
>> return the hash.  tia.
>> 
>> On Thu, Apr 8, 2010 at 5:24 PM, chrysanthe m  wrote:
>> Hi Alex
>> Thanks, but a newbie here so that was "drinking at a firehose".  Let me 
>> parse it to better understand.
>> First can you really invoke on two separate enumerable objects with that 
>> [n,n1,n2] syntax?  That is tremendous.
>> My problem is I need to first check the presence of a key before I unset it 
>> b/c I found out unset-ing a non-existent key seems to zero the struct; also 
>> it is more courteous, grin.  So how would I construct the and parameterize 
>> the annonymous function to do the check and if present "do it to itself".  
>> Ideally I would like to pass in the enumerable, call the function and return 
>> the modified(or not) enumerable in the function's return.  
>> 
>> On Thu, Apr 8, 2010 at 4:41 PM, Alex Wallace  wrote:
>> Ah, I see. You can handle this using Enumerable's invoke. This code should 
>> make it clear:
>> 
>> a = new Hash({ x : "foo", y : "bar" });
>> b = new Hash({ x : "zam", y : "moof" });
>> a.get("x");
>>   "foo"
>> b.get("x");
>>   "zam"
>> [a,b].invoke("get","x");
>>   ["foo", "zam"]
>> [a,b].invoke("unset","x")
>>   ["foo", "zam"]
>> a.get("x")
>>   (undefined)
>> 
>> Cheers,
>> Alex
>> 
>> On Thu, Apr 8, 2010 at 3:24 PM, chrysanthe m  wrote:
>> Sorry sudden send resume in this reply
>> 
>> Hello
>> I am having a difficult time trying to enumerate a hash to determine if a 
>> give key is in the hash and if so delete it and its value.
>> If I could approach it index it would be 
>> function remove(valueToTest, hashToBeTested){
>>for(i=0;i>   if(valueToTest==hashToBeTested[i]) hashToBeTested.unset(valueToTest);
>>}
>> 
>> Would I do it like
>> 
>> hashToBeTested.each(function(valueToTest){
>>   if(valueToTest==this)hashToBeTested.unset(valueToTest);
>>   },hashToBeTested);
>> return hashToBeTested;
>> 
>> 
>> which I am sure is wrong syntactically if not semantically.  Can someone 
>> guide the proper way and more deeply the use of this?
>> 
>> 
>> On Thu, Apr 8, 2010 at 3:06 PM, chrysanthe m  wrote:
>> 
>> 
>> 
>> 
>> -- 
>> 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...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>> 
>> 
>> -- 
>> 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 e

Re: [Proto-Scripty] Re: enumerate hash

2010-04-12 Thread Christophe Decaux
If I understand well, what you're asking for is pretty close to what you 
suggested in your original post:

hashToBeTested.each(function(pair){
  if(valueToTest==pair.value){
hashToBeTested.unset(pair.key);
  }
}


Christophe

Le 10 avr. 2010 à 12:36, chrysanthe m a écrit :

> Hi, again
> Sorry for being obtuse.  But can someone help me and even understand how to 
> write a function and call it on a hash that will take a value, compare it 
> against each of the keys in the hash, on match delete the key/value, and 
> return the hash.  tia.
> 
> On Thu, Apr 8, 2010 at 5:24 PM, chrysanthe m  wrote:
> Hi Alex
> Thanks, but a newbie here so that was "drinking at a firehose".  Let me parse 
> it to better understand.
> First can you really invoke on two separate enumerable objects with that 
> [n,n1,n2] syntax?  That is tremendous.
> My problem is I need to first check the presence of a key before I unset it 
> b/c I found out unset-ing a non-existent key seems to zero the struct; also 
> it is more courteous, grin.  So how would I construct the and parameterize 
> the annonymous function to do the check and if present "do it to itself".  
> Ideally I would like to pass in the enumerable, call the function and return 
> the modified(or not) enumerable in the function's return.  
> 
> On Thu, Apr 8, 2010 at 4:41 PM, Alex Wallace  wrote:
> Ah, I see. You can handle this using Enumerable's invoke. This code should 
> make it clear:
> 
> a = new Hash({ x : "foo", y : "bar" });
> b = new Hash({ x : "zam", y : "moof" });
> a.get("x");
>   "foo"
> b.get("x");
>   "zam"
> [a,b].invoke("get","x");
>   ["foo", "zam"]
> [a,b].invoke("unset","x")
>   ["foo", "zam"]
> a.get("x")
>   (undefined)
> 
> Cheers,
> Alex
> 
> On Thu, Apr 8, 2010 at 3:24 PM, chrysanthe m  wrote:
> Sorry sudden send resume in this reply
> 
> Hello
> I am having a difficult time trying to enumerate a hash to determine if a 
> give key is in the hash and if so delete it and its value.
> If I could approach it index it would be 
> function remove(valueToTest, hashToBeTested){
>for(i=0;i   if(valueToTest==hashToBeTested[i]) hashToBeTested.unset(valueToTest);
>}
> 
> Would I do it like
> 
> hashToBeTested.each(function(valueToTest){
>   if(valueToTest==this)hashToBeTested.unset(valueToTest);
>   },hashToBeTested);
> return hashToBeTested;
> 
> 
> which I am sure is wrong syntactically if not semantically.  Can someone 
> guide the proper way and more deeply the use of this?
> 
> 
> On Thu, Apr 8, 2010 at 3:06 PM, chrysanthe m  wrote:
> 
> 
> 
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] floating div

2010-04-08 Thread Christophe Decaux

You have to learn about position:absolute css style.
It will solve your issue.

Le 7 avr. 2010 à 20:37, Martín Marqués  a  
écrit :



OK, I know this isn't strictly prototype, but I'll through it here.

I have a div with id divsubmit which has an animated gif used when
prototype is waiting for a response. So I use $('divsubmit').show() in
onLoading: and $('divsubmit').hide in onComplete.

The thing is that I have this div on the top of the page and everytime
I .show() it, all the objects below it go down to make the div fit. I
want the div to show up on top of the other objects. How do I do this?

--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

--
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-scriptaculous@googlegroups.com 
.
To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en 
.




--
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Remove script from view

2010-04-07 Thread Christophe Decaux
First, this group doesn't know much about Rails, so you won't get any advice on 
how to move some code to application.js

But, I believe your issue can be easily solve with a little help from the queue 
mechanism.
Check Effect Queues - scriptaculous - GitHub

So you might end up with a slightly modified 
:onmouseout=>"new Effect.Move(this, {x: 10, y: 0, duration: 0.2, queue: 'end' } 
); return false;"

Hope this helps,
Christophe

Le 7 avr. 2010 à 06:16, emachnic a écrit :

> I'm new to Prototype and script.aculo.us and I have this code in my
> view that makes a link move left onmouseover and back right
> onmouseout. I have had the same problem as others where it executes
> the onmouseout event even if onmouseover hasn't finished so I wanted
> to put this in my application.js file and I needed to know how to
> write it there and call it in the view. This is written in HAML for a
> Rails2.3.5 app.
> 
> = link_to "BLOG", {:action => "index"}, :id => "sideLink1", :class =>
> "sideLink", :onmouseover => "new Effect.Move(this, {x: -10, y: 0,
> duration: 0.2}); return false;", :onmouseout => "new Effect.Move(this,
> {x: 10, y: 0, duration: 0.2}); return false;"
> 
> Any help/suggestions would be much appreciated. 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 email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Effect.Fade/Effect.Appear

2010-03-19 Thread Christophe Decaux
You got it, this is exactly how I managed it
Christophe
Le 19 mars 2010 à 17:23, bernard wolsieffer a écrit :

> Woohoo! Works pretty well, although, i'm not sure that I did it completely 
> correctly. I had to put the Effect.Appear inside the afterFinish for the 
> Effect.Fade... otherwise, nothing showed up.
> Now all I have to do is generalize the buttons to use this... merci boucoups.
> bernard
> 
> On 3/19/2010 9:20 AM, Christophe Decaux wrote:
>> 
>> I haven't look thoroughly at your issue, but seems to me that you have to 
>> queue those two effects. Otherwise, they try to happen together.
>> I ran a while ago into the same issue.
>> When you lauch an effect, javascript doesn't wait for it. Remaining code is 
>> executed immediately.
>> So either you look at Effects.Queue in Scriptaculous doc, or you investigate 
>> the afterFinish option that you could add to the first effect
>> 
>> Christophe
>> 
>> Le 19 mars 2010 à 15:44, bernard wolsieffer a écrit :
>> 
>>> Update:
>>> I changed things up a bit:
>>> 
>>> 
>>> >> style="display:inline; ">
>>> 
>>> 
>>> 
>>> Note that I removed the  from the page definition. Now, the changes 
>>> in code:
>>> function loadPage(s) {
>>> Effect.Fade('root', {duration:1.5});
>>> if ($('contentFrame')) {
>>> $('contentFrame').remove();
>>> }
>>> Element.insert('container', {top: ">> style='display:inline; '>"});
>>> Effect.Appear('root', {duration:1.5});
>>> }
>>> Result? The element upon which I apply Fade/Appear has either
>>> style="display:none;"
>>> or
>>> style="" (which seems to force 'display:none')
>>> and it doesn't matter if it's the body element or the root . The 
>>> effect still is:
>>> page appears (without the 1.5 duration).
>>> page disappears (without any duration).
>>> Note that I'm using Google Chrome - its debugging facility is actually 
>>> pretty nice. The behaviour is the same in Firefox.
>>> 
>>> Thanks in advance for any hints that might help.
>>> 
>>> bernard
>>> 
>>> -- 
>>> 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...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>> 
>> -- 
>> 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...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 
> -- 
> Le homme n'est rien; le oeuvre c'est tout
> Flaubert
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Effect.Fade/Effect.Appear

2010-03-19 Thread Christophe Decaux
I haven't look thoroughly at your issue, but seems to me that you have to queue 
those two effects. Otherwise, they try to happen together.
I ran a while ago into the same issue.
When you lauch an effect, javascript doesn't wait for it. Remaining code is 
executed immediately.
So either you look at Effects.Queue in Scriptaculous doc, or you investigate 
the afterFinish option that you could add to the first effect

Christophe

Le 19 mars 2010 à 15:44, bernard wolsieffer a écrit :

> Update:
> I changed things up a bit:
> 
> 
>  style="display:inline; ">
> 
> 
> 
> Note that I removed the  from the page definition. Now, the changes 
> in code:
> function loadPage(s) {
> Effect.Fade('root', {duration:1.5});
> if ($('contentFrame')) {
> $('contentFrame').remove();
> }
> Element.insert('container', {top: " style='display:inline; '>"});
> Effect.Appear('root', {duration:1.5});
> }
> Result? The element upon which I apply Fade/Appear has either
> style="display:none;"
> or
> style="" (which seems to force 'display:none')
> and it doesn't matter if it's the body element or the root . The effect 
> still is:
> page appears (without the 1.5 duration).
> page disappears (without any duration).
> Note that I'm using Google Chrome - its debugging facility is actually pretty 
> nice. The behaviour is the same in Firefox.
> 
> Thanks in advance for any hints that might help.
> 
> bernard
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] "PLease Wait" or "Loading" message

2010-02-10 Thread Christophe Decaux
I would use onCreate to show an element displaying your "please wait" message 
(or a graphical spinner, etc.) and use onComplete to hide it

Enjoy,

Christophe
 
Le 10 févr. 2010 à 15:20, bill a écrit :

> I have an application that uses Ajax.updater.  As it runs over the internet 
> sometimes the response can take 10 seconds, by which time the user thinks 
> that it did not work so I would like to show a message as soon as the link is 
> clicked to fire the Ajax request.  I am however befuddled.
> If I set the innerHTML of the div with the message, it wipes out the form 
> that needs to be sent.
> If I use onSuccess, it takes too long.
> Suggestions ?
>  -- 
> Bill Drescher
> william {at} TechServSys {dot} com
> 
> -- 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Need immediate help closing one blind when another opens

2009-12-23 Thread Christophe Decaux
I'm not a programmer either, but here's how I would solve your problem

I assume that you have some function that does the "show info" stuff and that 
function is called whenever a click is made.
So I would store in a global variable the name of the element that is "opened"
But before you store this info, I would check if that variable has already some 
value which means that another element is opened and therefore you could close 
it

But again, I'm not a pro, so forgive me if I this solution is not elegant

Christophe
 
Le 22 déc. 2009 à 19:23, Herb a écrit :

> Hey everybody,
> 
> I' m not a programmer. I need to be able to click on a link, have it
> show info (blind, slide, appear) then have it close when another link
> is closed. Like a toggle but with a different link.
> 
> I've tried adapting the accordion: http://www.stickmanlabs.com/accordion/
> but I need to have my trigger links separate from the actual
> accordion.
> 
> If anybody could help me quickly, I'd be most appreciative.
> 
> Herb
> 
> --
> 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 

--

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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




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.prevButton, 
this._view.nextButton,this._view.hideButton],
Effect.Opacity, {from: 1,  to: 0, duration: 2}
);
}}
)

Hope this helps,

Le 4 déc. 2009 à 13:29, fma a écrit :

> 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'}});
> new Effect.multiple([this._view.prevButton, this._view.nextButton,
> this._view.hideButton],
>Effect.Opacity, {from: 1,  to: 0, duration: 2},
>{queue: {position: 'end', scope: 'fade'}});
> 
> but I don't get good results; the effects does not occur at the same
> time on the 3 elements, and I get flickering...
> 
> Is my usage correct?
> 
> --
> 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 

--

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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




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 message thus revealing the full image.

I think the following code should help you, I found it sometime ago it   
is based on this page : 
http://www.webreference.com/programming/javascript/gr/column3/ 
Basically, you need to have 
- an array with url's for your big images such as picSrc[0] = 'images/ 
big1.jpg'; picSrc[1] = 'images/big3.jpg' 
- a hidden  in your page which displays your   
waiting message 

When you want to load your big images you call these two lines: 

$('waitingPic').show() 
initPics() 

Here's the code 

function initPics(){ 
var ImagePreLoader = Class.create({ 
callback: null, 
imageCache: new Array, 
loaded: 0, 
processed: 0, 
noOfImages: 0, 
initialize: function(images, options) { 
if (options) { 
if (options.callback) this.callback = 
options.callback; 
} 

this.noOfImages = images.length; 
for ( var i = 0; i < images.length; i++ ) 
  this.preload(images[i]);   
}, 
preload: function(imgSrc) { 
var image = new Image; 
this.imageCache.push(image); 
Event.observe(image, 'load', 
this.onload.bindAsEventListener(this),   
false); 
Event.observe(image, 'error', 
this.onerror.bindAsEventListener 
(this), false); 
Event.observe(image, 'abort', 
this.onabort.bindAsEventListener 
(this), false); 
image.preloader = this; 
image.loaded = false; 
image.src = imgSrc; 
}, 
onComplete: function() { 
this.processed++; 
if (this.processed==this.noOfImages) { 
this.callback(this.imageCache, this.loaded); 
} 
}, 
onload: function(e) { 
this.loaded++; 
this.onComplete(); 
}, 
onerror: function(e) { 
this.onComplete(); 
}, 
onabort: function(e) { 
this.onComplete(); 
} 
}); 

var imgPreloadCallback = function(imageCache, loaded) { 
// where: 
// imageCache is an array of the loaded images 
// loaded is an int of the number of images that loaded. 
//doSomethingAfterImagesAreLoaded(); 
$('waitingPic').hide(); 
picsPreLoaded = true; 
} 

var imgLoader = new ImagePreLoader(picSrc, 
{callback:imgPreloadCallback}); 


} 

Hope this helps. 
Christophe 

Le 3 déc. 2009 à 17:34, Peter De Berdt a écrit :

> 
> On 02 Dec 2009, at 15:25, fma wrote:
> 
>> But it does not work. In the _show() method, the call to
>> this._flashNavButtons() leads to an error (this._flashNavButtons() is
>> not a function). I think I understand why: when called from the
>> timeout mecanism, 'this' no longer exists, or does not point anymore
>> on my object...
>> 
>> Is there a way to pass 'this' in the timeout callback? I also use such
>> timeout callback to make the navgation buttons blink 3 times when the
>> photo is opened in full size...
> 
> Instead of relying on setTimeout, you would be better off just rewriting the 
> whole thing in a more Prototype way and using Ajax to fetch the image, then 
> use the callback to display the fullscreen version.
> 
> Now if you still just want to get the setTimeout working, you probably could 
> just use:
> 
> setTimeout(function() {this._show}.bind(this),300);
> 
> 
> 
> Best regards
> 
> Peter De Berdt
> 
> 
> --
> 
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

--

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...@googlegroups.com.
For more options, visit this group at 
http://groups.googl

[Proto-Scripty] Re: Question about onmouseover, onmouseout and onclick

2009-10-14 Thread Christophe Decaux

I don't know anything what elegant means, but this would be my way to  
do it.
I'm your onclick handler, set a flag such as menuIsClicked to true and  
in your onMouseOut handler, test that flag before hiding the image.

On to the pros for the ellegant solution.

Christophe

Le 14 oct. 2009 à 18:44, Darkie  a écrit :

>
> Hi guys,
> I've got a menu with 3 links. On every link onmouseover I get an image
> that appears on its left, onmouseout I hide the image. I do this with
> Effect.Appear for making it appear and $('id').hide() to make it
> hide.
> I want that when I click on a link (onclick), the images stays there
> even if I move the mouse out. Is there an elegant way to do it? If
> not, is there a way to do it? :-D
> 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-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: prototype code to load images?

2009-09-16 Thread Christophe Decaux

Zion,

I think the following code should help you, I found it sometime ago it  
is based on this page : 
http://www.webreference.com/programming/javascript/gr/column3/
Basically, you need to have
- an array with url's for your big images such as picSrc[0] = 'images/ 
big1.jpg'; picSrc[1] = 'images/big3.jpg'
- a hidden  in your page which displays your  
waiting message

When you want to load your big images you call these two lines:

$('waitingPic').show()
initPics()

Here's the code

function initPics(){
var ImagePreLoader = Class.create({
callback: null,
imageCache: new Array,
loaded: 0,
processed: 0,
noOfImages: 0,
initialize: function(images, options) {
if (options) {
if (options.callback) this.callback = 
options.callback;
}

this.noOfImages = images.length;
for ( var i = 0; i < images.length; i++ )
  this.preload(images[i]);  
},
preload: function(imgSrc) {
var image = new Image;
this.imageCache.push(image);
Event.observe(image, 'load', 
this.onload.bindAsEventListener(this),  
false);
Event.observe(image, 'error', 
this.onerror.bindAsEventListener 
(this), false);
Event.observe(image, 'abort', 
this.onabort.bindAsEventListener 
(this), false);
image.preloader = this;
image.loaded = false;
image.src = imgSrc;
},
onComplete: function() {
this.processed++;
if (this.processed==this.noOfImages) {
this.callback(this.imageCache, this.loaded);
}
},
onload: function(e) {
this.loaded++;
this.onComplete();
},
onerror: function(e) {
this.onComplete();
},
onabort: function(e) {
this.onComplete();
}
});

var imgPreloadCallback = function(imageCache, loaded) {
// where:
// imageCache is an array of the loaded images
// loaded is an int of the number of images that loaded.
//doSomethingAfterImagesAreLoaded();
$('waitingPic').hide();
picsPreLoaded = true;
}

var imgLoader = new ImagePreLoader(picSrc, 
{callback:imgPreloadCallback});
}

Hope this helps.

Christophe

>
>
> On Tue, Sep 15, 2009 at 12:10 PM, zion  wrote:
>
> Hi,
>
> I have couple of really big images in my site that load slow and
> decreases the user experience, so is there a way to load the few
> images with prototype & scriptaculous so that it would display
> somesort of a loading image/page until these few big images are
> loaded.. it is important that this would apply only for the few
> selected images..Just cant figure out how to do it.. many 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-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-31 Thread Christophe Decaux

TJ,
Thanks for spending time to compile all this stuff.
Looking forward to enjoy working with old browsers ;-) Just to realize  
how much time flies.
Christophe

Le 31 juil. 09 à 14:16, T.J. Crowder a écrit :

>
> Hi,
>
> There are the documented supported browsers:
> http://prototypejs.org/download
>
> Using Prototype & script.aculo.us in earlier browsers will not be
> _supported_, but whether it'll "work" is more a fuzzy gray than black
> or white -- e.g., it will vary dramatically by feature.  I expect that
> the $() function will work on quite a few older browsers, whereas I'd
> be surprised if Element#getDimensions and some of the niftier things
> script.aculo.us does with computed styles were reliable.
>
> In terms of *language* features, I think you're pretty safe.
> Prototype uses Function#apply, Function#call, the arguments array, and
> the special behavior of the || (OR) operator, all of which were added
> after the first couple of releases of the language, but it was a
> looong time ago.  In fact, just looked it up[1], and if Wikipedia is
> correct we're talking 1998 or earlier for all of those.
>
> Prototype may (or may not) use some of the new array features from
> JavaScript 1.6 (~2005), but I suspect not (at least not 1.6.0.3) or
> that it has emulations of them it'll use if they're not there.  If
> there are any missing, though, it's easy enough to add emulations to
> the array prototype, and in any case a quick scan through the source
> for the new methods will tell you.
>
> In terms of Ajax features, if you're talking Mozilla 1.7, that would
> be well after Gecko had XmlHttpRequest.  Can't guarantee there won't
> be niggles, but...
>
> Bottom line is that it's unlikely to "just work," but I suspect most
> of what you'll hit will be manageable.  The joy is you have the
> source, and the license is not forbidding.
>
> [1] http://en.wikipedia.org/wiki/JavaScript#Versions
>
> Good luck,
> --
> T.J. Crowder
> tj / crowder software / com
> Independent Software Engineer, consulting services available
>
>
> On Jul 31, 9:09 am, Christophe Decaux 
> wrote:
>> That's right, it's device app dev.
>> The device is a Cisco DMP 4300 series
>> Does anyone knows what are the minimum browser requirements to run
>> Prototype and Scriptaculous
>> Christophe
>>
>> Le 30 juil. 09 à 22:40, Rick Waldron a écrit :
>>
>>
>>
>>> That sounds like fun... i like device app development. Can you tell
>>> us what device you're working with? That will be helpful
>>
>>> Rick
>>
>>> On Thu, Jul 30, 2009 at 3:55 PM, Christophe  
>>> >>> wrote:
>>
>>> Hi there,
>>
>>> Apologies to everybody if my question is offending in any way, but
>>> this is my first post to such a group.
>>
>>> I'm a occasional user of Prototype and Scriptaculous and pretty  
>>> happy
>>> with these tools.
>>
>>> However, I'm facing an issue for which I can find any answer around:
>>
>>> I created some pages that work pretty well on modern browsers such  
>>> as
>>> FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on  
>>> some
>>> special Internet devices that run only Mozilla Firefox 1.7 with
>>> Javascript 1.5
>>
>>> So my question is : what are the requirements of Prototype 1.6 and
>>> Scriptaculous 1.8, will my pages run well on such an old browser.
>>> If not, is there an older version of Prototype and/or Scriptaculous
>>> that will answer my problem.
>>
>>> Thanks in advance
>>
>>> Christophe
> >


--~--~-~--~~~---~--~~
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-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-31 Thread Christophe Decaux
That's right, it's device app dev.
The device is a Cisco DMP 4300 series
Does anyone knows what are the minimum browser requirements to run  
Prototype and Scriptaculous
Christophe

Le 30 juil. 09 à 22:40, Rick Waldron a écrit :

> That sounds like fun... i like device app development. Can you tell  
> us what device you're working with? That will be helpful
>
> Rick
>
> On Thu, Jul 30, 2009 at 3:55 PM, Christophe  > wrote:
>
> Hi there,
>
> Apologies to everybody if my question is offending in any way, but
> this is my first post to such a group.
>
> I'm a occasional user of Prototype and Scriptaculous and pretty happy
> with these tools.
>
> However, I'm facing an issue for which I can find any answer around:
>
> I created some pages that work pretty well on modern browsers such as
> FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on some
> special Internet devices that run only Mozilla Firefox 1.7 with
> Javascript 1.5
>
> So my question is : what are the requirements of Prototype 1.6 and
> Scriptaculous 1.8, will my pages run well on such an old browser.
> If not, is there an older version of Prototype and/or Scriptaculous
> that will answer my problem.
>
> Thanks in advance
>
> Christophe
>
>
>
>
> >


--~--~-~--~~~---~--~~
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-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---