aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Main <smain@google.com>2009-11-03 18:54:26 -0800
committerandroid-build SharedAccount <android-build@sekiwake.mtv.corp.google.com>2009-11-24 17:55:12 -0800
commitf89f023f6942860a323b37684299a59fa8d0ecbd (patch)
tree129769ecc6f1fc73ed6f88dc89c0f97a3e968ab0
parent3655dfb5323a2fc3517cf3d5c3e741489f325b17 (diff)
downloadbuild-f89f023f6942860a323b37684299a59fa8d0ecbd.tar.gz
docs: revise user agent detection to use lower case
for string comparisons and add 'webos' as a mobile device
-rw-r--r--tools/droiddoc/templates/assets/android-developer-docs.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js
index 64311638a1..8843f9a0a2 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.js
+++ b/tools/droiddoc/templates/assets/android-developer-docs.js
@@ -24,15 +24,16 @@ function addLoadEvent(newfun) {
}
}
-var agent = navigator['userAgent'];
+var agent = navigator['userAgent'].toLowerCase();
// If a mobile phone, set flag and do mobile setup
-if ((agent.indexOf("Mobile") != -1) ||
- (agent.indexOf("BlackBerry") != -1) ||
- (agent.indexOf("Mini") != -1)) {
+if ((agent.indexOf("mobile") != -1) || // android, iphone, ipod
+ (agent.indexOf("blackberry") != -1) ||
+ (agent.indexOf("webos") != -1) ||
+ (agent.indexOf("mini") != -1)) { // opera mini browsers
isMobile = true;
addLoadEvent(mobileSetup);
// If not a mobile browser, set the onresize event for IE6, and others
-} else if (agent.indexOf("MSIE 6.0") != -1) {
+} else if (agent.indexOf("msie 6") != -1) {
isIE6 = true;
addLoadEvent(function() {
window.onresize = resizeAll;