[Laszlo-dev] [Laszlo-checkins] r12373 - in openlaszlo/trunk: lps/components/extensions/av test/video

Sarah Allen sarah at ultrasaurus.com
Tue Jan 20 12:59:12 PST 2009


a) I'm just taking your word for it that this weird JS pattern is only  
in the a/v components
b) Max and I are working on re-writing all the a/v extensions in  
regular LZX... we're almost there!

On Jan 20, 2009, at 12:51 PM, P T Withington wrote:

> I'm ok with this if
>
> a) you are sure the 'bug' you hit will not affect anyone else.   
> Otherwise, I'd really like to see a test case.
> b) you promise that the code I quoted below will go away... :)
>
> On 2009-01-19, at 17:55EST, Sarah Allen wrote:
>
>> The problem is that there is some bug where the defaults declared  
>> in the attributes weren't getting set; however, the file is written  
>> using an interim syntax that isn't exactly supported.  This is just  
>> scaffolding to get the test files working, so when we translate the  
>> files into normal LZX syntax we can make sure they don't break...  
>> Max didn't think it made sense to dive into trying to isolate the  
>> setter bug, but rather spend the time getting the code to work with  
>> more supported syntax.
>>
>> Sarah
>>
>> On Jan 19, 2009, at 10:04 AM, P T Withington wrote:
>>
>>> FWIW:
>>>
>>>>> +           if (attrs && attrs['type'] == null) attrs.type =  
>>>>> 'http'
>>>>> +           if (attrs && attrs['autoplay'] == null)  
>>>>> attrs.autoplay = false;
>>>>> +           if (attrs && attrs['cam'] == null) attrs.cam = null;
>>>>> +           if (attrs && attrs['mic'] == null) attrs.mic = null;
>>>>> +           if (attrs && attrs['width'] == null) attrs.width =  
>>>>> 160;
>>>>> +           if (attrs && attrs['height'] == null) attrs.height =  
>>>>> 120;
>>>>> +           if (attrs && attrs['playvolume'] == null)  
>>>>> attrs.playvolume = 1.0;
>>>>> +           if (attrs && attrs['url'] == null) attrs.url = "";
>>>>> +           super(parent, attrs, children, instcall);
>>>>>
>>>
>>> I realize this is JS code, but smashing defaults into attrs is  
>>> _highly_ discouraged because attrs only sees constant values from  
>>> an instantiation, so this operation will clobber any constraint  
>>> that may have been specified.
>>>
>>> If you want default values for an attribute, define an initial  
>>> value in the <attribute> tag, or in JS as the initial value of the  
>>> `var` declaration.
>>>
>>>
>>>
>>
>



More information about the Laszlo-dev mailing list