Re: [Proto-Scripty] Re: Problem using invoke()
Le mardi 8 décembre 2009 15:43, T.J. Crowder a écrit : this._navButtons.each(function(item) { _opacity(item, ...); }); The problem is to give additionnal params (for Effect.Oppacity); it does not seem to be possible with each(). That's why I tried invoke()... Look again at my example. You'd fill in the ... with the parameters. Thanks, I got it. -- Frédéric -- 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.
[Proto-Scripty] Include scripts
Hi, I'm looking for a import script code example, to be able to include parent class code (I write only 1 class per file). Is there something already available? Thanks, -- Frédéric -- 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.
[Proto-Scripty] Re: Include scripts
Hi, Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Dec 9, 11:15 am, Frédéric f...@gbiloba.org wrote: Hi, I'm looking for a import script code example, to be able to include parent class code (I write only 1 class per file). Is there something already available? Thanks, -- Frédéric -- 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.
[Proto-Scripty] Re: Include scripts
Hi again, But answering the actual question you asked: http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically -- T.J. ;-) On Dec 9, 11:25 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new:http://code.google.com/closure/compiler/ HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 9, 11:15 am, Frédéric f...@gbiloba.org wrote: Hi, I'm looking for a import script code example, to be able to include parent class code (I write only 1 class per file). Is there something already available? Thanks, -- Frédéric -- 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] Re: Include scripts
Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit : Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I see. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. I'm not looking for a minimizer, but only to solve dependencies... I guess it needs to introduce a specific tag in the code, like the Google Closure Compiler does. For example: // @include another_script.js Maybe this as already been discussed here? Did anyone already write such tool? Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler Well, dependencies is the only thing I'm looking for :o/ If it does not yet exist, I will try to write my own tool (in python, as I'm familiar with this language). Thanks for your help. -- Frédéric -- 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.
[Proto-Scripty] Re: Check a mouse button
Hi Frédéric, When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. -- david On 8 déc, 15:07, Frédéric f...@gbiloba.org wrote: Le mardi 8 décembre 2009 13:54, Alex McAuley a écrit : ...observe('mousemove',function(e) { $('SomeElement').observe('click',function() { doSomethingWIthyourClick(); Ok, so I have to register both events... Thanks :o) -- Frédéric -- 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.
[Proto-Scripty] Progressive update messages from single request
i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks. -joe t. -- 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.
[Proto-Scripty] Re: Check a mouse button
Hi, This is true except `isXXXClick` are not properties but methods. The correct snippet would then be: Event.observe(element, 'mousemove', function(evt) { if(evt.isLeftClick()) alert('left button clicked'); if(evt.isMiddleClick()) alert('middle button clicked'); if(evt.isRightClick()) alert('right button clicked'); }); Best, Samuel. On Dec 9, 4:24 pm, david david.brill...@gmail.com wrote: Hi Frédéric, When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. -- david On 8 déc, 15:07, Frédéric f...@gbiloba.org wrote: Le mardi 8 décembre 2009 13:54, Alex McAuley a écrit : ...observe('mousemove',function(e) { $('SomeElement').observe('click',function() { doSomethingWIthyourClick(); Ok, so I have to register both events... Thanks :o) -- Frédéric -- 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] Re: Check a mouse button
On mercredi 09 décembre 2009, david wrote: When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. I have to check again, but in my previous tests, the isLeftClick() always returned true, and other always returned false... -- Frédéric -- 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] Progressive update messages from single request
I would do this with chained onSuccess handlers. Each one would trigger a new request to a different endpoint, carrying some token to identify the visitor. $('button').observe('click',function(evt){ //do your lookup new Ajax.Request('lookup.php',{ parameters:{id:'?=$id?'}, onCreate:function(){ $('message').update('searching...');; }, onSuccess:function(transport){ //make your pdf $('message').update('making PDF...');; new Ajax.Request('pdf.php',{ parameters:{id:'?=$id?'}, onCreate:..., //you get the idea onSuccess:... }); } }}; }); Walter On Dec 9, 2009, at 11:11 AM, joe t. wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks. -joe t. -- 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.
[Proto-Scripty] Event ordering for cross domain frames
Hi, So i finally came up with protoype based implementation for crossdomain iframe communication based on Julien's example as can be seen live in http://www.julienlecomte.net/blogfiles/cross-frame/ For quick reference, lets say an iframe from domain B is hosted on main site from domain A. In order to talk to the main site, iframe creates an iframe loading proxy file from domain B which passes on the message from its current location to the main site using custom event notification mechanism (because both belong to the same domain B). As soon as the message is delivered (part of loading of the iframe's body), in iframe's onload event, iframe is destroyed after cleaning up the listeners attached to it. Now comes my problem. These messages are reaching fine across different domains. But the order is not guaranteed. I think this is more so because of the loading order of the iframes that are dynamically created for each message and then destroyed. Is there a way i could ensure the ordered delivery? I tried to reuse the iframes for multiple messages (not destroying at the end of the message delivery); but then location update is not communicated to the iframe (should have happened in onload listener, but it doesn't). Any idea what could be done? For more reference on crossdomain communication with iframes, please see http://softwareas.com/cross-domain-communication-with-iframes Thanks in advance for any pointers. -Sumit -- 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.
[Proto-Scripty] Re: Custom events with iframes
Hi David, It did work finally though i'm facing a different issue now. Posting a new thread on that problem. Please have a look at http://groups.google.com/group/prototype-scriptaculous/t/e69e90a8b84987f4 Thanks again for your response. -Sumit On Dec 9, 11:49 am, Sumit skbrnwl-...@yahoo.com wrote: I think i'm having issues with the loading sequence of the javascripts and these iframes. Will report more details once i'm done fixing the issue. Thanks for your response, David! -Sumit On Dec 9, 2:36 am, david david.brill...@gmail.com wrote: Hi sumit, Just a though, I didn't test it. you don't use custom event it has the form namespace:eventName. What you could do ?? is to define in frame A: document.observe(FrameB:message, function(e){ console.log(11+e); }); And send from Frame B: Event.fire(document,'FrameB:message','message to send',true); It could work, but my question is about frame and crossdomain ?? -- david On 8 déc, 20:31, Sumit skbrnwl-...@yahoo.com wrote: Hi, I've certain iframes loaded on my page (same domain) and i want to fire custom events from one of them to the other for which those iframes are already listening. Somehow the following implementation doesn't work (sadly the firebug console doesn't show anything): In the iframe A, i'm doing- document.observe(message, function(e){ console.log(11+e); }); In the iframe B (same as domain A), i'm doing- Event.fire(parent.frames[frame11],message,frame12, true); Any idea what i might be doing wrong? Thanks in advance. -Sumit -- 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] Re: Include scripts
Something I came across in my Twitter feed... LABjs On Wed, Dec 9, 2009 at 6:54 AM, Frédéric f...@gbiloba.org wrote: Le mercredi 9 décembre 2009 11:25, T.J. Crowder a écrit : Your best bet for something like that is to have a build process that combines the scripts (and then minifies them), and then include the resulting single script with just one script tag. Reading lots of individual script files will be quite slow, because browsers typically will load only one or two at a time, and it takes very perceptible time to individually retrieve even three or four scripts in addition to the other resources on the page. Latency kills. I see. I don't currently have a good recommendation of a build tool to use for this, but if it's just combining files and then running them through jsmin or something similar, any of the usual suspects (rake, ant, etc.) should be able to manage it. I'm not looking for a minimizer, but only to solve dependencies... I guess it needs to introduce a specific tag in the code, like the Google Closure Compiler does. For example: // @include another_script.js Maybe this as already been discussed here? Did anyone already write such tool? Google's just released their Closure Compiler, which handles doing this (including dependency management, although it's a bit of a pain to configure dependencies at present based on comments in the discussion group) as well as handling removing unused code and various other optimisations. It's still very new: http://code.google.com/closure/compiler Well, dependencies is the only thing I'm looking for :o/ If it does not yet exist, I will try to write my own tool (in python, as I'm familiar with this language). Thanks for your help. -- Frédéric -- 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.comprototype-scriptaculous%2bunsubscr...@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.
[Proto-Scripty] Re: Include scripts
Prototype's using Sprockets[1] for this. You might want to give it a spin. Best, Tobie [1] http://getsprockets.org/ -- 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.
[Proto-Scripty] Re: Progressive update messages from single request
Thanks for the response Walter. i can see where you're going with that, but in those successively created new Ajax.Request calls, it's generating a new request to the server, which runs the server-side routine from the beginning, right? In my concept, the first call commands the server to run all three steps: Client Request 1 -- Collect the data (send feedback to client) -- Create the PDF (send feedback to client) -- Attach to an email and send (send final feedback) End Where your structure more resembles: Client Request 1 -- Collect data (send Feedback 1) -- Client Request 2 -- Create PDF (send Feedback 2) -- Client Request 3 -- Attach and email (send Feedback 3) End Am i correct? If so, that works only to the amount of detail i provide nested invocations of Ajax.Request to check/perform one specific detail of progress. Keep in mind this is only an example: what if i need feedback during the attachment process (attaching 1 of 100 files)? For one, it would be nasty to nest that many Ajax.Request calls, and more importantly, that email object only exists within the request that creates and processes it. The second request to attach file 2 of 100 isn't working on the same email object (as i understand it). i did find one QA similar to this where it was suggested to use $_SESSION for the current progress message... The initial Request gets the server going on the task, and also creates a second Request that repeats (eg, Ajax.PeriodicalUpdater). That one does nothing more than check $_SESSION for the latest message (which gets updated by the task being performed). That feels slightly better to me, despite the potential traffic overhead for longer requests (hence the {decay} option, i suppose). Something for me to chew on, i suppose. Thanks again, -joe t. On Dec 9, 1:22 pm, Walter Lee Davis wa...@wdstudio.com wrote: I would do this with chained onSuccess handlers. Each one would trigger a new request to a different endpoint, carrying some token to identify the visitor. $('button').observe('click',function(evt){ //do your lookup new Ajax.Request('lookup.php',{ parameters:{id:'?=$id?'}, onCreate:function(){ $('message').update('searching...');; }, onSuccess:function(transport){ //make your pdf $('message').update('making PDF...');; new Ajax.Request('pdf.php',{ parameters:{id:'?=$id?'}, onCreate:..., //you get the idea onSuccess:... }); } }}; }); Walter On Dec 9, 2009, at 11:11 AM, joe t. wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks. -joe t. -- 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 athttp://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] Re: Include scripts
On mercredi 09 décembre 2009, Tobie Langel wrote: Prototype's using Sprockets[1] for this. You might want to give it a spin. That's exactly what I was looking for! Simple and powerfull... Thanks :o) -- Frédéric -- 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.
[Proto-Scripty] Re: Check a mouse button
Hi Samuel, Thanks to point my mistake. It's effectivelly a method and not a property. Sorry frédéric. -- david On 9 déc, 18:35, Frédéric f...@gbiloba.org wrote: On mercredi 09 décembre 2009, david wrote: When observing an event with: Event.observe('mousemove',function(evt){ if(evt.isLeftClick) alert('left button clicked'); if(evt.isMiddleClick) alert('middle button clicked'); if(evt.isRightClick) alert('right button clicked'); }) there is inside the event object some shortcut to know at the moment the event is fired if a button is clicked. And the same existe in case of a key pressed. I have to check again, but in my previous tests, the isLeftClick() always returned true, and other always returned false... -- Frédéric -- 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.