I took a cue from Sam's "Prototype.BrowserFeatures" object.
I am not against adding to the namespaces, but I want to make sure it's
done judiciously and carefully. Note that typng
"Prototype.Browser.KHTML" is still easier than typing
"navigator.userAgent.test(/KHTML/)". And while I don't think that
browser detection is something we should shy away from lest we
encourage bad coding practice... well, I don't think we should be
giving it first-class treatment either. Putting it inside the
"Prototype" object sends the message that it's for Prototype's internal
use and isn't *necessarily* meant for public consumption.
Andrew
On Jan 19, 4:31 am, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
http://dev.rubyonrails.org/ticket/6800
I like the overall implementation, but find writing
"Prototype.Browser.KHTML" a bit verbose.
Personally, in some scripts i've used something like:
if (Engine.isKHTML) ...
The patch even has a var B = Prototype.Browser; line.
Thoughts on this? It's more like a general issue if we like to have
more namespaces or stick to what we have.
In general it might also be worthy to investigate some more
$something shortcuts, maybe not for the browser detection, but based
on some analysis of existing code you guys use (that is, often-called
methods that could use a shortcut).
-Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---