[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread Fábio Costa
A static class is totaly usefull when you have a widget that will always have one instance and is linked to a object. Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Sun, May 10, 2009 at 8:00 PM, nwhite wrote: > @christoph I agree the benefits of having a Singleton patter

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread nwhite
@christoph I agree the benefits of having a Singleton pattern in javascript are extremely limited. When developers are first introduced to OO paradigms they typically fall in love with Singletons for all the wrong reasons. With that said I do think there are a few use cases where it could prove adv

[Moo] iframe.getScroll()

2009-05-10 Thread storeman
I'm trying to scroll linenumbers with an iframe (some stupid editor idea ;) ) but I can't get it working as I want it to be and how it should be. The editor part is in an iframe which works sufficient by now. Before this iframe there is an div which should contains linenumbers. I want the linenum

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread Christoph Pojer
Remember that we don't have Singletons nor do we have "static classes" in a prototype-based language. So this is basically a mix of all of those approaches. I just don't see the use of a real Singleton pattern in JavaScript anyway. You either have a simple Object ( var MyObject = {} ) or an instan

[Moo] MooTools mode for Coda

2009-05-10 Thread pradador
I finally got tired of the autocompletion feature in Coda being nearly useless when using MooTools so I sat down and cranked out a custom Mode. It's basically the JavaScript mode with some changes. The main addition was adding MooTools functions to the Auto Completion file. I used a MooTools 1.2 c

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread nwhite
I borrowed the ideas from Scott Kyle's work. I made a hook so the initialize Mutator is not so expensive as well. Singleton is now in 1.2.2 http://gist.github.com/109094 2009/5/10 Fábio Costa > This looks like a static class more than the singleton pattern. > > > Fábio Miranda Costa > Engen

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread Fábio Costa
This looks like a static class more than the singleton pattern. Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Sun, May 10, 2009 at 4:31 PM, Christoph Pojer wrote: > > As JavaScript doesn't really have the concept of a Singleton I think > the easiest way to use it is jus

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread Christoph Pojer
As JavaScript doesn't really have the concept of a Singleton I think the easiest way to use it is just to do something like var MySingleton = new new Class({ ... }). This creates a class and directly one single instance of it. Of course, you can't subclass it or use the new operator with it again,

[Moo] Re: html serialization

2009-05-10 Thread patcullen
im working on ideas for ajax'ing assets down to the client. i want to steer interface development into a more pure javascript approach,.. as apposed to downloading some html, then using little scripts to activate the controls. so my goal here is to not transport any layout in pure html at all; but

[Moo] Re: html serialization

2009-05-10 Thread electronbender
Wait, can you explain what "jsonizing html" means? What is the input and what output do you get? On May 8, 4:18 pm, patcullen wrote: > here is a whole page/test for any willing eyes... > > http://pastie.org/472158 > > On May 8, 4:14 pm, patcullen wrote: > > > hi, im trying to find a practical w

[Moo] Re: modifying accordion effect

2009-05-10 Thread genxco
kkk thanks for pointing out dumb mistakes... thank you On May 9, 11:56 pm, ryan wrote: > It should be .setStyles not .setStyle > > Ryan > > On May 10, 1:29 am, genxco wrote: > > > var myAccordion = new Accordion($('accordion'), 'h3.toggler', > > 'div.element', { > >                 opacity: