[mochikit] Re: computedStyle

2006-06-09 Thread Beau Hartshorne
On 9-Jun-06, at 6:54 PM, Bob Ippolito wrote: > On Jun 9, 2006, at 6:15 PM, Beau Hartshorne wrote: > >> On 7-Jun-06, at 7:13 PM, Bob Ippolito wrote: >> >>> Base seems like a good enough place for it. Ignoring performance, >>> is backwards compatibility even an issue? I don't think it would >>> bre

[mochikit] Re: computedStyle

2006-06-09 Thread Bob Ippolito
On Jun 9, 2006, at 6:15 PM, Beau Hartshorne wrote: > > On 7-Jun-06, at 7:13 PM, Bob Ippolito wrote: > >> Base seems like a good enough place for it. Ignoring performance, >> is backwards compatibility even an issue? I don't think it would >> break anything to camelize everywhere appropriate. > >

[mochikit] Re: computedStyle

2006-06-09 Thread Beau Hartshorne
On 7-Jun-06, at 7:13 PM, Bob Ippolito wrote: > Base seems like a good enough place for it. Ignoring performance, > is backwards compatibility even an issue? I don't think it would > break anything to camelize everywhere appropriate. I don't really know. I replaced computedStyle entirely, and

[mochikit] Re: numberFormatter for Infinity

2006-06-09 Thread Bob Ippolito
On Jun 9, 2006, at 3:53 PM, Melkor wrote: > Hello, if I try to apply a numberFormatter to Infinity, instead of > Infinity I get something with dots and commas. It's a bug or a > feature? > =) What do you expect to happen if you format NaN, Infinity, or - Infinity? There isn't really any sens

[mochikit] numberFormatter for Infinity

2006-06-09 Thread Melkor
Hello, if I try to apply a numberFormatter to Infinity, instead of Infinity I get something with dots and commas. It's a bug or a feature? =) Regards, and thanks for a wonderful lib. Pablo --~--~-~--~~~---~--~~ You received this message because you are subscribed

[mochikit] Re: Sorting inside a

2006-06-09 Thread Bob Ippolito
On Jun 9, 2006, at 2:26 PM, Patrick Lewis wrote: > var compare_items = function(a, b){ > return compare(a[1], b[1]) > } MochiKit.Base.keyComparator does exactly that: var compare_items = keyComparator(1); ... though in this case, you might want to uppercase the strings or something for

[mochikit] Re: Sorting inside a

2006-06-09 Thread Patrick Lewis
I think this would do it: var json = "{1:'something', 2: 'A lovely thing', 3:'Not so nice'}" var compare_items = function(a, b){ return compare(a[1], b[1]) } var sort_options = function(options) { return sorted(items(options), compare_items) } var opts = eval('(' + json + ')') var s =

[mochikit] Re: Sorting inside a

2006-06-09 Thread Jorge Godoy
Em Sexta 09 Junho 2006 11:50, Arnar Birgisson escreveu: > > map(function (key) { > $('yourselect').appendChild(OPTION({'value': key}, yourjsonobject[key])); > }, keys(yourjsonobject).sort()); This will sort based on the "key", not based on what is shown to the user... E.g.: TODAY - 1 -

[mochikit] Re: Sorting inside a

2006-06-09 Thread Jorge Godoy
Em Sexta 09 Junho 2006 11:50, Arnar Birgisson escreveu: > I'm not sure if you mean sorting the elements after inserting > them into the DOM or before. I would do something like this: Actually, the order in sorting doesn't matter to me if the output appears sorted to the user :-) > map(functio

[mochikit] Re: Sorting inside a

2006-06-09 Thread Arnar Birgisson
Hi On 6/9/06, Jorge Godoy <[EMAIL PROTECTED]> wrote: > Is there something that I can use to sort the options inside a select > accordingly to what is shown to the user? I'm getting a Python dict > (unordered) in JSON format and I'd like to sort this to make options easier > to find when browsing

[mochikit] Sorting inside a

2006-06-09 Thread Jorge Godoy
Hi! Is there something that I can use to sort the options inside a select accordingly to what is shown to the user? I'm getting a Python dict (unordered) in JSON format and I'd like to sort this to make options easier to find when browsing the list... Thanks, -- Jorge Godoy <[EMAIL