[Proto-Scripty] Re: Memory Leaks in IE7, Prototype or Prototip2?

2009-01-15 Thread mr_justin
Well unfortunately there is a 1MB leak in IE7 when you run the event_test on the latest version of prototype. Since there is significant changes in this version compared to the publicly available 1.6.0.3 version, I am guessing you guys are getting close to releasing 1.6.0.4? FWIW, I took the chec

[Proto-Scripty] Re: document.observe etc for multiple forms?

2009-01-15 Thread kangax
On Jan 15, 6:15 pm, "Richard Quadling" wrote: [...] > You could add the same class to each element and ... > > $$('.classname').invoke('observe', 'click', function(ev) { ... }); Not a good idea with many elements. Better would be: document.observe('click', function(e, el) { if (el = e.findE

[Proto-Scripty] Re: Memory Leaks in IE7, Prototype or Prototip2?

2009-01-15 Thread kangax
On Jan 15, 4:47 pm, mr_justin wrote: > Hey kangax, > I just cloned prototype's git source, ran the tests to generate the > HTML test files, then edited the _destroyCache() method to include the > following: > > for (var element in Element.cache) Element.cache[element] = null; > > (it already incl

[Proto-Scripty] Re: document.observe etc for multiple forms?

2009-01-15 Thread Richard Quadling
2009/1/16 geoffcox : > >> You could add the same class to each element and ... >> >> $$('.classname').invoke('observe', 'click', function(ev) { ... }); > > Many thanks Chris - that's done the trick! Chris? > > Cheers, > > Geoff > >> >> -- >> - >> Richard Quadling >> Zend Certified Engineer :

[Proto-Scripty] Re: document.observe etc for multiple forms?

2009-01-15 Thread geoffcox
> You could add the same class to each element and ... > > $$('.classname').invoke('observe', 'click', function(ev) { ... }); Many thanks Chris - that's done the trick! Cheers, Geoff > > -- > - > Richard Quadling > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 >

[Proto-Scripty] Re: document.observe etc for multiple forms?

2009-01-15 Thread Richard Quadling
2009/1/15 geoffcox : > > Hello, > > I have > > document.observe("dom:loaded", function () { >if ($("send1")) { >$("send1").observe("click", function (evt) { >evt.stop(); >getData(evt.element().form); >}); >} > }); > > in which the send1 is the id of

[Proto-Scripty] document.observe etc for multiple forms?

2009-01-15 Thread geoffcox
Hello, I have document.observe("dom:loaded", function () { if ($("send1")) { $("send1").observe("click", function (evt) { evt.stop(); getData(evt.element().form); }); } }); in which the send1 is the id of the button in a form If I have multiple

[Proto-Scripty] Re: Memory Leaks in IE7, Prototype or Prototip2?

2009-01-15 Thread mr_justin
Hey kangax, I just cloned prototype's git source, ran the tests to generate the HTML test files, then edited the _destroyCache() method to include the following: for (var element in Element.cache) Element.cache[element] = null; (it already includes code to stopObserving all events) I then loade

[Proto-Scripty] Re: help with Effect.Move onmouseover

2009-01-15 Thread George
That was just what I needed. Thanks! On Jan 14, 3:14 pm, Diodeus wrote: > One was to solve this is to set a flag that prevents a second effect > from running until the first has completed: > var running = false > > function previewOn(thisDiv) { >         running=true >         document.getElemen

[Proto-Scripty] Re: Memory Leaks in IE7, Prototype or Prototip2?

2009-01-15 Thread kangax
On Jan 15, 2:53 pm, mr_justin wrote: > Wanted to update this thread, I just took some screen captures running > 9 page refreshes on the Prototip2 demo page, showing an increase in > memory usage with every page refresh. > > See image:http://farm4.static.flickr.com/3370/3198951197_55e5869fbc_o.png

[Proto-Scripty] Re: Memory Leaks in IE7, Prototype or Prototip2?

2009-01-15 Thread mr_justin
Wanted to update this thread, I just took some screen captures running 9 page refreshes on the Prototip2 demo page, showing an increase in memory usage with every page refresh. See image: http://farm4.static.flickr.com/3370/3198951197_55e5869fbc_o.png --~--~-~--~~~---~

[Proto-Scripty] Re: reserved words for prototype and/or scriptaculous?

2009-01-15 Thread geoffcox
Nathan, I am not getting this yet! Say I have following simple form - what is getData(evt.element().myform); sending to getData()? Cheers, Geoff document.observe("dom:loaded", function () { if ($("send")) { $("send").observe("click", function (evt) { evt.stop()

[Proto-Scripty] Re: reserved words for prototype and/or scriptaculous?

2009-01-15 Thread geoffcox
Thanks Nathan - will work on that. Cheers Geoff On Jan 15, 2:29 pm, nlloyds wrote: > Geoff, > > > 'afraid I'm not able to follow all you've written but could you just > > explain what you mean by "avoiding inline event handlers"? > > > > onClick="getData(this.form)"> > > > Would above have to

[Proto-Scripty] Protosafe??

2009-01-15 Thread Chris John
Hi, I have been trying to find a way of making prototype play nicely with mootools. There seems to be a perfect solution in protosafe, but all the links to it seem to have gone dead. Does anybody know where I can get it, have a copy they can send me or know of any alternatives. Cheers Chris --~-

[Proto-Scripty] Re: Best way to apply an effect on page load?

2009-01-15 Thread T.J. Crowder
Hi Edd, > Just to confuse issues slightly, wouldn’t it be better to use #map > instead of #each? Why? He isn't using the return value, so no need to create the return array. One concern in both cases, though, is whether Effect.SlideDown will be bothered by the extra parameter provided by both

[Proto-Scripty] Re: Best way to apply an effect on page load?

2009-01-15 Thread Alex Mcauley
if you want to work out whats currently selected you can add a click event to the tab headings and store the value in a hidden field somewhere .. then you can allways access it whenever you need to Regards ALex - Original Message - From: "Matt" To: "Prototype & script.aculo.us" Se

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread Alex Mcauley
Thanks TJ i didnt think about it like that, the second way would work ... its oky now as i just mke it fade away after 10 seonds or something Thanks again Alex - Original Message - From: "T.J. Crowder" To: "Prototype & script.aculo.us" Sent: Thursday, January 15, 2009 4:26 PM Subject

[Proto-Scripty] Re: Best way to apply an effect on page load?

2009-01-15 Thread Matt
Thanks TJ, think I get it now! One question - since I do have multiple s with a class of 'test', it might just be easier to make them all do the same effect at once (the user will only see one at a time anyway due to the tabs and I can't figure out how to make the script aware of which one's curr

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread T.J. Crowder
Hi Alex, Apologies if I'm missing the point, but can't you use document.stopObserving[1]? [1] http://prototypejs.org/api/document/stopObserving E.g.: * * * * function showErrorDiv(msg) { var div = new Element('div', { 'id':'errDiv', 'class': 'error' }); div.updat

[Proto-Scripty] Re: asynchronous file upload

2009-01-15 Thread jason maina
Thanks joe, I wouldn't mind getting my hands on your code work, currently trying to understand SWFUpload flash/javascript. Dont worry to much about the documentation i will ask where things get to hit the rocks. Kind regards Jason On Thu, Jan 15, 2009 at 5:26 PM, joe t. wrote: > > If you can't

[Proto-Scripty] Re: Best way to apply an effect on page load?

2009-01-15 Thread redheat
TJ, Just to confuse issues slightly, wouldn’t it be better to use #map instead of #each? Edd P.S., I haven’t tested, so #map may not work. > > If you know there will only be one and don't mind if the effect > applies to all of them if (for whatever reason) there's more than one, > Enumerable#e

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread Alex Mcauley
I scrapped the idea and made it dissapear after a certain time .. was to much a headache !! - Original Message - From: "bflanagan" To: "Prototype & script.aculo.us" Sent: Thursday, January 15, 2009 2:38 PM Subject: [Proto-Scripty] Re: Stoping observing > > There's probably a correct

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread bflanagan
There's probably a correct event model way to do this, but, in the meantime, how about setting the 'removeErrorElement' equal to an empty function? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.

[Proto-Scripty] Re: asynchronous file upload

2009-01-15 Thread Alex Mcauley
asynchronous file upload via Ajax is impossible at the moment .. there is 2 ways to do it ... 1 is an iframe (takes minutes to set up) the other is flash - Original Message - From: "joe t." To: "Prototype & script.aculo.us" Sent: Thursday, January 15, 2009 2:26 PM Subject: [Proto-Scri

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread Alex Mcauley
The div isnt allways created by click .. its called by my method/function if and when i need it .. this is the trouble i am having ... At the moment ive got the method to check for a click (in my tests) and it finds the div (as you have put below - this was my first approach at it yesterday !!)

[Proto-Scripty] Re: reserved words for prototype and/or scriptaculous?

2009-01-15 Thread nlloyds
Geoff, > 'afraid I'm not able to follow all you've written but could you just > explain what you mean by "avoiding inline event handlers"? > > onClick="getData(this.form)"> > > Would above have to be changed/replaced? An inline event handler means you're putting scripts in html elements instead

[Proto-Scripty] Re: asynchronous file upload

2009-01-15 Thread joe t.
If you can't utilize a Flash solution, the only other way is an IFRAME. i had a need for this too, and spent a long time developing quite an elaborate Prototype-based JS class for the client side, and a PHP handler on the server side. If you're interested, let me know and i'll be happy to share (i

[Proto-Scripty] Re: Stoping observing

2009-01-15 Thread bflanagan
Since your function is creating the div, you can put a conditional in it to check for the existence of the div before attempting to add it. Event.observe(document,'click', function() { if($('divYouJustAdded'){ removeTheElementIJustAdded(); } else { addTheElement(); } }

[Proto-Scripty] Stoping observing

2009-01-15 Thread Jeztah
Afternoon Guys / Gals .. I'm having a slight headache with stop observing i'll try to explain my code ... upon click of an element (in this case a form submit) my javascript goes through some calculations and if needed calls a function to create an error message .. this function creates a

[Proto-Scripty] Re: How would you calculate the avg() value of a row?

2009-01-15 Thread T.J. Crowder
Hi Richard, Glad that helped. On the IDs, it sounds like that means you won't have duplicated IDs on the page, which was my only concern. It also sounds like they're sufficiently complex (rather than just being 1..n) that sticking with this DOM-based solution is probably best (allowing for my i

[Proto-Scripty] Re: Best way to apply an effect on page load?

2009-01-15 Thread T.J. Crowder
Hi Matt, Yes, *slightly*: Element#select() and $$() both return an array of matching (extended) elements. So you need to index into it. If you know there will only be one and don't mind if the effect applies to all of them if (for whatever reason) there's more than one, Enumerable#each makes f

[Proto-Scripty] Re: Sortable and lists of labels/checkboxes

2009-01-15 Thread Cyrus
Ok - I think I "solved" the problem. I exchanged the disabled/enabled with addClassName('dropped')/ removeClassName('dropped'). So the user doesn't see if the class is still attached to the checkbox. If he moves the mouse it will be gone. The final code looks like this, maybe you need it yoursel

[Proto-Scripty] Sortable and lists of labels/checkboxes

2009-01-15 Thread Cyrus
Hi, I decided to open a new thread (this is the old one: http://groups.google.com/group/prototype-scriptaculous/t/303d050dd9c07329), because it is a general question how to use the Sortable of script.aculo.us correctly. Simple HTML-Code: Item 1 Item 2 Javascript: Sortable.

[Proto-Scripty] Re: reserved words for prototype and/or scriptaculous?

2009-01-15 Thread geoffcox
Kangax, > So, yeah, this is yet another reason not to touch `Element.prototype` > (or not use inline event handlers) 'afraid I'm not able to follow all you've written but could you just explain what you mean by "avoiding inline event handlers"? Would above have to be changed/replaced? Does a

[Proto-Scripty] Re: Inheritance question

2009-01-15 Thread Cyrus
Thats a good idea. This code works actually. I just cannot (really) override existing methods. If I include methods with the same name in MySortable, they are not called, because within Sortable all methods are called with Sortable.nameOfMethod() - they don't use this.nameOfMethod(). On 14 Jan.,