[Proto-Scripty] prototype 1.7 : using 'invoke' method with a Hash

2011-03-11 Thread Francois
Hi! I had problems using the 'invoke' method with an Hash : the Enumerable API says about 'invoke' : "Invokes the same method, with the same arguments, for all items in a collection. Returns the results of the method calls." so I expected the following code to work : function A() {}; A.prototype.d

Re: [Proto-Scripty] Re: event on leaving page

2011-03-11 Thread Richard Quadling
On 11 March 2011 01:17, joe t. wrote: > One note on TJ's post, hopefully helpful: > > You cannot CANCEL the unload event. If i understand them correctly, > load and unload are the only native events that can't be canceled from > scripts. You can perform other actions, but unload means the browser

[Proto-Scripty] Re: Behavior of Element.select different in 1.7

2011-03-11 Thread Incero
works fine now, thank you very much for explaining On 10 Mrz., 16:05, "T.J. Crowder" wrote: > Hi, > > Sorry, that list should have been: > > Using 1.6.1 and "=", works:http://jsbin.com/ewire5/ > Using 1.7 and "=", doesn't work:http://jsbin.com/ewire5/2 > Using 1.7 and "$=", works:http://jsbin.com

Re: [Proto-Scripty] Re: event on leaving page

2011-03-11 Thread Bertilo Wennergren
T.J. Crowder wrote: > Yes, you can run functions using the window unload event. Example: > http://jsbin.com/apuke4 > Open that link in a tab, click "Open Window", then close the tab you > opened the link in -- the subordinate window closes as well. > What you can do in those functions is severel

Re: [Proto-Scripty] prototype 1.7 : using 'invoke' method with a Hash

2011-03-11 Thread Guillaume Lepicard
Hi François You should use h.values().invoke("draw"); As specified in the Has#each method, the iterator's first argument is an object with two properties : key and value http://api.prototypejs.org/language/Hash/prototype/each/ On Thu, Mar 10, 2011 at 8:17 PM, Francois wrote: > Hi! > I had proble

Re: [Proto-Scripty] Re: event on leaving page

2011-03-11 Thread Walter Lee Davis
On Mar 11, 2011, at 7:41 AM, Bertilo Wennergren wrote: Here's a limitation with "beforeunload" (in case someone hasn't heard): More of less the only thing you can do with "beforeunload", is to ask the user if he or she really wants to leave the page. A dialog will appear, and the user can choo

[Proto-Scripty] Re: prototype 1.7 : using 'invoke' method with a Hash

2011-03-11 Thread Francois
Ok it's much clearer now! Merci Guillaume! On Mar 11, 2:35 pm, Guillaume Lepicard wrote: > Hi François > > You should use > h.values().invoke("draw"); > As specified in the Has#each method, the iterator's first argument is an > object with two properties : key and > valuehttp://api.prototypejs.

[Proto-Scripty] Re: event on leaving page

2011-03-11 Thread joe t.
Here's a sample from code that i wrote and seems to work ok (at least, last i tested it, i no longer work there), adapted for generics: http://pastie.org/1661648 So here's what i learned, now that my curiosity got roused... The beforeunload event will automatically generate the prompt. If you wan

Re: [Proto-Scripty] Re: event on leaving page

2011-03-11 Thread Walter Lee Davis
On Mar 11, 2011, at 7:50 PM, joe t. wrote: Here's a sample from code that i wrote and seems to work ok (at least, last i tested it, i no longer work there), adapted for generics: http://pastie.org/1661648 So here's what i learned, now that my curiosity got roused... The beforeunload event wil