[Proto-Scripty] sound.js hack that works in IE, gecko, webkit

2010-04-12 Thread Junkshops
Ok, here's an extremely ugly hack, but it works in IE6/8, Opera, Chrome, FF3, and Safari: http://pastie.org/915231 It also doesn't load the entire mp3 file before playing it like the old bgsound version did. I'm not too familiar with the object and embed tags so there's probably more junk in

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

[Proto-Scripty] Re: The Unofficial Wiki

2010-04-12 Thread Eric
Hi, Instead of moving the wiki content to official prototype's page, couldn't we just rename it as Official Wiki and link it from the prototypejs homepage? This would allows more peoples to find the content while still let them add/edit content if they wish it. The howtos (and some of the tips)

[Proto-Scripty] Re: Class Inheritance from Element

2010-04-12 Thread Eric
Could you post a use example? In this case, I usualy create a simple class not derived from Element and a maker function to extend DOM elements with this class prototype. I am not sure at all it is the best approach but it works and is relatively easy to maintain. It looks like this (untested)

[Proto-Scripty] Proposal: Alias clearContent for update()

2010-04-12 Thread Rüdiger Plantiko
Hi, I didn't find a method for clearing the content of an HTML element *and* which from its name clearly indicates this action. I formerly used $(myContainer).update() for clearing the element's content, i.e. calling the update method with no arguments. But I prefer a readable alias like

[Proto-Scripty] Cross-browser function for Text content

2010-04-12 Thread Rüdiger Plantiko
Hi there, is there a cross-browser function for retrieving the text content of an element? If I have an element like span id=test4711/span I get the number 4711 in IE with $(test).innerText and in FF with $ (test).textContent - does Prototype provide a browser-independent abstraction for this?

[Proto-Scripty] Re: Cross-browser function for Text content

2010-04-12 Thread T.J. Crowder
Hi, I get the number 4711 in IE with $(test).innerText and in FF with $ (test).textContent - does Prototype provide a browser-independent abstraction for this? Hopefully you get the *string* 4711 rather than the number 4711 (unless you parse it). :-) `innerHTML` works on all major browsers.

[Proto-Scripty] Re: Cross-browser function for Text content

2010-04-12 Thread Rüdiger Plantiko
Hi TJ, I get the number 4711 in IE with $(test).innerText and in FF with $ (test).textContent - does Prototype provide a browser-independent abstraction for this? Hopefully you get the *string* 4711 rather than the number 4711 (unless you parse it). :-) You are right, in a posting every

[Proto-Scripty] Re: Proposal: Alias clearContent for update()

2010-04-12 Thread joe t.
Admittedly, there are methods in Prototype (and any library) which are not perfectly intuitive because they can serve multiple purposes for the sake of condensing code. i personally see the update() method as suitable. When there's an argument, you're updating with the content in the argument.

[Proto-Scripty] Proper observer removal

2010-04-12 Thread Gregory Nicholas
If i setup an html link element to be observed, and then i subsequently remove the html element without calling stopObserving(), does that remove the observer? or does it create a leak of some sort? Ex: $('logo').observe('click', function (e) { e.stop(); }); // remove the html element

[Proto-Scripty] Re: Proposal: Alias clearContent for update()

2010-04-12 Thread T.J. Crowder
If you really want to propose the alias to the core, though, join the Prototype Core group and toss it out there, see if it sticks. Or file an enhancement request: http://prototype.lighthouseapp.com/projects/8886/home But I'm with Joe on this (FWIW), I think just #update is clear enough that

[Proto-Scripty] Re: Proper observer removal

2010-04-12 Thread T.J. Crowder
Hi, On Apr 13, 5:24 am, Gregory Nicholas faction.greg...@gmail.com wrote: If i setup an html link element to be observed, and then i subsequently remove the html element without calling stopObserving(), does that remove the observer? or does it create a leak of some sort? It leaves the