You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ma...@apache.org on 2013/07/28 20:13:34 UTC

svn commit: r1507824 - /openoffice/ooo-site/trunk/content/download/test/download.js

Author: marcus
Date: Sun Jul 28 18:13:34 2013
New Revision: 1507824

URL: http://svn.apache.org/r1507824
Log:
#122875# Android was recognized as support platform, reported by Andrea Pescetti

Modified:
    openoffice/ooo-site/trunk/content/download/test/download.js

Modified: openoffice/ooo-site/trunk/content/download/test/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download.js?rev=1507824&r1=1507823&r2=1507824&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Sun Jul 28 18:13:34 2013
@@ -179,10 +179,57 @@ function getPlatform() {
 	var os	= navigator.platform.toLowerCase();
 	var ua	= navigator.userAgent.toLowerCase();
 
-	// Assume as default: No platform / OS was recognized, set $UI_PLATFORM to show it to the user
-								UI_PLATFORM	= "an unknown platform/OS";
+//	if ( os != "" ) {
+	if ( os ) {
 
-	if ( navigator.platform != "" ) {
+	  // Recognized but not supported platforms / OS, set $UI_PLATFORM to show it to the user
+	  if ( os.indexOf( "sunos"		) != -1 ) {	UI_PLATFORM	= "Solaris x86 (PKG)";
+	    if ( ua.indexOf( "sun4u"		) != -1 )	UI_PLATFORM	= "Solaris SPARC (PKG)";
+	  }
+	  if ( os.indexOf( "freebsd"		) != -1 )	UI_PLATFORM	= "FreeBSD (PKG)";
+	  if ( os.indexOf( "os/2"		) != -1 )	UI_PLATFORM	= "OS/2";
+	  if ( os.indexOf( "freebsd"		) != -1 )	UI_PLATFORM	= "FreeBSD";
+	  if ( os.indexOf( "openbsd"		) != -1 )	UI_PLATFORM	= "OpenBSD";
+	  if ( os.indexOf( "netbsd"		) != -1 )	UI_PLATFORM	= "NetBSD";
+	  if ( os.indexOf( "pcbsd"		) != -1 )	UI_PLATFORM	= "PC-BSD";
+	  if ( os.indexOf( "dragonfly"		) != -1 )	UI_PLATFORM	= "DragonFly BSD";
+	  if ( os.indexOf( "amiga"		) != -1 )	UI_PLATFORM	= "AmigaOS";
+	  if ( os.indexOf( "darwin"		) != -1 )	UI_PLATFORM	= "Darwin";
+	  if ( os.indexOf( "aix"		) != -1 )	UI_PLATFORM	= "IBM AIX";
+	  if ( os.indexOf( "irix"		) != -1 )	UI_PLATFORM	= "IRIX";
+	  if ( os.indexOf( "vms"		) != -1 )	UI_PLATFORM	= "OpenVMS";
+	  if ( os.indexOf( "alphaserver"	) != -1 )	UI_PLATFORM	= "AlphaServer";
+	  if ( os.indexOf( "qnx"		) != -1 )	UI_PLATFORM	= "QNX";
+	  if ( os.indexOf( "x11"		) != -1 )	UI_PLATFORM	= "an unknown OS with X11 support";
+
+	  if ( ua.indexOf( "ppc"		) != -1 )	UI_PLATFORM	= "Mac OS PPC (DMG)";
+	  if ( ua.indexOf( "iphone"		) != -1 ||
+	       ua.indexOf( "ipad"		) != -1 ||
+	       ua.indexOf( "ipod"		) != -1 )	UI_PLATFORM	= "Apple mobile device (iPhone/iPad/iPod)";
+	  if ( ua.indexOf( "android"		) != -1 )	UI_PLATFORM	= "Android mobile device";
+	  if ( ua.indexOf( "blackberry"		) != -1 )	UI_PLATFORM	= "a Blackberry Smartphone";
+	  if ( ua.indexOf( "nokia"		) != -1 )	UI_PLATFORM	= "a Nokia Mobile device";
+	  if ( ua.indexOf( "symbian"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Symbian OS";
+	  if ( ua.indexOf( "symbos"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Symbian OS";
+	  if ( ua.indexOf( "s60"	        ) != -1 )	UI_PLATFORM	= "a Mobilephone with Series60/S60 support";
+	  if ( ua.indexOf( "series60"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Series60/S60 support";
+	  if ( ua.indexOf( "palm"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Palm OS";
+	  if ( ua.indexOf( "webos"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Palm webOS";
+	  if ( ua.indexOf( "pike"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Pike support";
+	  if ( ua.indexOf( "ce.net"		) != -1 )	UI_PLATFORM	= "a Mobilephone with Windows CE";
+	  if ( ua.indexOf( "widerweb"		) != -1 )	UI_PLATFORM	= "a Mobilephone with WiderWeb support";
+	  if ( ua.indexOf( "brew"		) != -1 )	UI_PLATFORM	= "a Smartphone with BREW support";
+	  if ( ua.indexOf( "hiptop"		) != -1 )	UI_PLATFORM	= "a Smartphone with Hiptop support";
+
+	  if ( ua.indexOf( "playstation"	) != -1 )	UI_PLATFORM	= "a Sony Playstation";
+	  if ( ua.indexOf( "psp"		) != -1 )	UI_PLATFORM	= "a Sony Playstation Portable";
+	  if ( ua.indexOf( "nintendo"		) != -1 )	UI_PLATFORM	= "a Nintendo game console";
+	  if ( ua.indexOf( "wii"		) != -1 )	UI_PLATFORM	= "a Wii game console";
+
+	  // If variable is already filled, then something was recognized and no more work is need
+	  if ( UI_PLATFORM ) {
+	    return;
+	  }
 
 	  // Windows
 	  if ( os.indexOf( "windows"		) != -1 ||
@@ -191,82 +238,47 @@ function getPlatform() {
 								EXTENSION	= ".exe";
 	    if ( ua.indexOf( "phone"		) != -1 ||
 		 ua.indexOf( "mobile"		) != -1 )	UI_PLATFORM	= "Windows Mobile device";
+	  }
 
 	  // Linux
-	  } else if ( os.indexOf( "linux"	 ) != -1 ) {
-	      if ( os.indexOf( "64"		 ) != -1 ) {	UI_PLATFORM	= "Linux 64-bit (RPM)";
+	  if ( os.indexOf( "linux"		) != -1 ) {
+	    if ( os.indexOf( "x86"		) != -1 ) {
+								UI_PLATFORM	= "Linux 32-bit (RPM)";
+							     // UI_PLATFORM	= "Linux 32-bit (RPM/DEB ?)";
+								URL_PLATFORM	= "Linux_x86_install-rpm";
+								EXTENSION	= ".tar.gz";
+	      if ( ua.indexOf( "debian"		) != -1 ||
+		   ua.indexOf( "ubuntu"		) != -1 ||
+		   ua.indexOf( "iceweasel"	) != -1 ) {	UI_PLATFORM	= "Linux Debian 32-Bit (DEB)";
+								URL_PLATFORM	= "Linux_x86_install-deb";
+								EXTENSION	= ".tar.gz";
+	      }
+	    }
+	    if ( os.indexOf( "_64"		) != -1 ) {	UI_PLATFORM	= "Linux 64-bit (RPM)";
 							     // UI_PLATFORM	= "Linux 64-bit (RPM/DEB ?)";
 								URL_PLATFORM	= "Linux_x86-64_install-rpm";
 								EXTENSION	= ".tar.gz";
-		if ( ua.indexOf( "debian"	 ) != -1 ||
-		     ua.indexOf( "ubuntu"	 ) != -1 ||
-		     ua.indexOf( "iceweasel"	 ) != -1 ) {	UI_PLATFORM	= "Linux Debian 64-bit (DEB)";
+	      if ( ua.indexOf( "debian"		) != -1 ||
+		   ua.indexOf( "ubuntu"		) != -1 ||
+		   ua.indexOf( "iceweasel"	) != -1 ) {	UI_PLATFORM	= "Linux Debian 64-bit (DEB)";
 								URL_PLATFORM	= "Linux_x86-64_install-deb";
 								EXTENSION	= ".tar.gz";
-		}
-	      } else {
-								UI_PLATFORM	= "Linux 32-Bit (RPM)";
-							     // UI_PLATFORM	= "Linux 32-Bit (RPM/DEB ?)";
-								URL_PLATFORM	= "Linux_x86_install-rpm";
-								EXTENSION	= ".tar.gz";
-		    if ( ua.indexOf( "debian"	 ) != -1 ||
-			 ua.indexOf( "ubuntu"	 ) != -1 ||
-			 ua.indexOf( "iceweasel" ) != -1 ) {	UI_PLATFORM	= "Linux Debian 32-Bit (DEB)";
-								URL_PLATFORM	= "Linux_x86_install-deb";
-								EXTENSION	= ".tar.gz";
-		    }
 	      }
+	    }
+	  }
 
 	  // Mac OS x86
-	  } else if ( os.indexOf( "mac"		 ) != -1 ) {	UI_PLATFORM	= "Mac OS Intel (DMG)";
+	  if ( os.indexOf( "mac"		) != -1 ) {	UI_PLATFORM	= "Mac OS 32-bit Intel (DMG)";
 								URL_PLATFORM	= "MacOS_x86_install";
 								EXTENSION	= ".dmg";
-
-	  // Recognized but not supported platforms / OS, set $UI_PLATFORM to show it to the user
-	      if    ( ua.indexOf( "ppc"		) != -1 )	UI_PLATFORM	= "Mac OS PPC (DMG)";
-	  } else if ( os.indexOf( "sunos"	) != -1 ) {	UI_PLATFORM	= "Solaris x86 (PKG)";
-	      if    ( ua.indexOf( "sun4u"	) != -1 )	UI_PLATFORM	= "Solaris SPARC (PKG)";
-	  } else if ( os.indexOf( "freebsd"	) != -1 )	UI_PLATFORM	= "FreeBSD (PKG)";
-	    else if ( os.indexOf( "os/2"	) != -1 )	UI_PLATFORM	= "OS/2";
-	    else if ( os.indexOf( "freebsd"	) != -1 )	UI_PLATFORM	= "FreeBSD";
-	    else if ( os.indexOf( "openbsd"	) != -1 )	UI_PLATFORM	= "OpenBSD";
-	    else if ( os.indexOf( "netbsd"	) != -1 )	UI_PLATFORM	= "NetBSD";
-	    else if ( os.indexOf( "pcbsd"	) != -1 )	UI_PLATFORM	= "PC-BSD";
-	    else if ( os.indexOf( "dragonfly"	) != -1 )	UI_PLATFORM	= "DragonFly BSD";
-
-	    else if ( os.indexOf( "amiga"	) != -1 )	UI_PLATFORM	= "AmigaOS";
-	    else if ( os.indexOf( "darwin"	) != -1 )	UI_PLATFORM	= "Darwin";
-	    else if ( os.indexOf( "aix"		) != -1 )	UI_PLATFORM	= "IBM AIX";
-	    else if ( os.indexOf( "irix"	) != -1 )	UI_PLATFORM	= "IRIX";
-	    else if ( os.indexOf( "vms"		) != -1 )	UI_PLATFORM	= "OpenVMS";
-	    else if ( os.indexOf( "alphaserver"	) != -1 )	UI_PLATFORM	= "AlphaServer";
-	    else if ( os.indexOf( "qnx"		) != -1 )	UI_PLATFORM	= "QNX";
-	    else if ( os.indexOf( "x11"		) != -1 )	UI_PLATFORM	= "an unknown OS with X11 support";
-
-	  // Recognized but not supported mobile devices, set $UI_PLATFORM to show it to the user
-	    else if ( os.indexOf( "blackberry"  ) != -1 )	UI_PLATFORM	= "a Blackberry Smartphone";
-	    else if ( os.indexOf( "android"	) != -1 )	UI_PLATFORM	= "Android mobile device";
-	    else if ( os.indexOf( "nokia"	) != -1 )	UI_PLATFORM	= "a Nokia Mobile device";
-	    else if ( os.indexOf( "s60"	        ) != -1 )	UI_PLATFORM	= "a Mobilephone with Series60/S60 support";
-	    else if ( os.indexOf( "series60"    ) != -1 )	UI_PLATFORM	= "a Mobilephone with Series60/S60 support";
-	    else if ( os.indexOf( "symbian"	) != -1 )	UI_PLATFORM	= "a Mobilephone with Symbian OS";
-	    else if ( os.indexOf( "palm"	) != -1 )	UI_PLATFORM	= "a Mobilephone with Palm OS";
-	    else if ( os.indexOf( "webos"	) != -1 )	UI_PLATFORM	= "a Mobilephone with Palm webOS";
-	    else if ( os.indexOf( "pike"	) != -1 )	UI_PLATFORM	= "a Mobilephone with Pike support";
-	    else if ( os.indexOf( "ce.net"	) != -1 )	UI_PLATFORM	= "a Mobilephone with Windows CE";
-	    else if ( os.indexOf( "widerweb"    ) != -1 )	UI_PLATFORM	= "a Mobilephone with WiderWeb support";
-	    else if ( os.indexOf( "brew"	) != -1 )	UI_PLATFORM	= "a Smartphone with BREW support";
-	    else if ( os.indexOf( "hiptop"	) != -1 )	UI_PLATFORM	= "a Smartphone with Hiptop support";
-	    else if ( ua.indexOf( "iphone"	) != -1 ||
-		      ua.indexOf( "ipad"	) != -1 ||
-		      ua.indexOf( "ipod"	) != -1 )	UI_PLATFORM	= "Apple mobile device (iPhone/iPad/iPod)";
-
-	  // Recognized but not supported video game consoles, set $UI_PLATFORM to show it to the user
-	    else if ( os.indexOf( "playstation"	) != -1 )	UI_PLATFORM	= "a Sony Playstation";
-	    else if ( os.indexOf( "psp"		) != -1 )	UI_PLATFORM	= "a Sony Playstation Portable";
-	    else if ( os.indexOf( "nintendo"	) != -1 )	UI_PLATFORM	= "a Nintendo game console";
-	    else if ( os.indexOf( "wii"		) != -1 )	UI_PLATFORM	= "a Wii game console";
+	  } 
 	} 
+
+	// If variable is not filled, then nothing was recognized, set $UI_PLATFORM to show it to the user
+	if ( ! UI_PLATFORM ) {
+	  UI_PLATFORM = "an unknown platform/OS";
+	  return;
+	}
 }
 
 /*