[mapguide-internals] Re: better browser detection logic (basic
viewer)
Zac Spitzer
zac.spitzer at gmail.com
Mon Jul 12 23:00:15 EDT 2010
I'm at home sick and don't have a local 2.2 build i can test on, but I
have knocked up a patch
http://trac.osgeo.org/mapguide/attachment/ticket/1274/refactored%20getAttributeNodeValue.patch
the new function reuses the existing logic, with a fall back to the
modern way if
the 'brittle' browser detection fails, as happened with this opera bug
can some one try it out?
z
On 11 July 2010 12:21, Zac Spitzer <zac.spitzer at gmail.com> wrote:
> even better would be to move this into browserdetect.js as a function,
>
> function getAttributeValueCozIE6isCrap(tgt, attr){
> return (!msie6minus) ? tgt.attributes[attr].nodeValue: tgt[attr];
> }
>
> anyone got a good suggestion for the function name coz that just doesn't
> feel right and we should avoid using a generic function name which
> might conflict
>
> z
>
>
>
> On 11 July 2010 11:52, Zac Spitzer <zac.spitzer at gmail.com> wrote:
>> Right button context menu doesn't work in Opera or Chrome
>> http://trac.osgeo.org/mapguide/ticket/1274
>>
>> looks like this changeset for chrome fixes will fix things for opera as well
>>
>> http://trac.osgeo.org/mapguide/changeset/4267
>>
>> alas the fixes were committed against unrelated trac issues
>> anyway there's lots of this pattern
>>
>> var name = (chrome || firefox || safari3plus) ?
>> obj.attributes["name"].nodeValue: obj.name;
>>
>> through the code, which to fix for opera would requires this
>>
>> var name = (opera || chrome || firefox || safari3plus) ?
>> obj.attributes["name"].nodeValue: obj.name;
>>
>> which pretty much is equivalent to saying, not msie6, suprise suprise
>> :) as this works in IE7
>>
>> How about i change all this logic in 4267 to be (!msie6minus) ?
>>
>> z
>>
>>
>>
>> --
>> Zac Spitzer
>> Solution Architect / Director
>> Ennoble Consultancy Australia
>> http://www.ennoble.com.au
>> http://zacster.blogspot.com
>> +61 405 847 168
>>
>
>
>
> --
> Zac Spitzer
> Solution Architect / Director
> Ennoble Consultancy Australia
> http://www.ennoble.com.au
> http://zacster.blogspot.com
> +61 405 847 168
>
--
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168
More information about the mapguide-internals
mailing list