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/06/20 23:08:43 UTC

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

Author: marcus
Date: Thu Jun 20 21:08:43 2013
New Revision: 1495188

URL: http://svn.apache.org/r1495188
Log:
Fixed platform recognition error, added possibility to link to the 'other.html' if needed

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=1495188&r1=1495187&r2=1495188&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Thu Jun 20 21:08:43 2013
@@ -128,9 +128,15 @@ function getLink() {
 	//	version = version.split( "_" )[0];
 
 	if ( hasMirrorLink() ) {
+		if ( UI_PLATFORM == "unknown" && PLATFORM == "unknown" && EXTENSION == "unknown" ) {
+			file_link 	= "http://www.openoffice.org/download/other.html";
+			UI_PLATFORM	= "(OS unknown)";
+			return file_link;
+		}
+
 		// file_link = SOURCEFORGE_BASE_URL + NL_LANGUAGE + "/Apache_OpenOffice_";
-                // file_link = file_link + VERSION + "_" + PLATFORM + "_" + NL_LANGUAGE;
-                // file_link = file_link + EXTENSION;
+		// file_link = file_link + VERSION + "_" + PLATFORM + "_" + NL_LANGUAGE;
+		// file_link = file_link + EXTENSION;
 
 		file_link = PEOPLE_BASE_URL + "/binaries/" + NL_LANGUAGE;
 		file_link = file_link + "/Apache_OpenOffice_" + VERSION + "_" + PLATFORM;
@@ -166,7 +172,8 @@ function getPlatform() {
 	// For more help or data see: "http://www.useragentstring.com"
 
 	if ( navigator.platform != "" ) {
-		if ( navigator.platform.toLowerCase().indexOf( "windows" ) != -1 ) {
+		if ( navigator.platform.toLowerCase().indexOf( "windows" ) != -1 ||
+		     navigator.platform.toLowerCase().indexOf( "win" )     != -1 ) {
 			UI_PLATFORM	= "Windows (EXE)";
 			PLATFORM	= "Win_x86_install";
 			EXTENSION	= ".exe";
@@ -174,14 +181,17 @@ function getPlatform() {
 			     navigator.userAgent.toLowerCase().indexOf( "mobile" ) != -1 ||
 			     navigator.userAgent.toLowerCase().indexOf( "ce" )     != -1 ) {
 				UI_PLATFORM	= "Windows mobile device";
-				PLATFORM	= "no_mirror_platform";
-				EXTENSION	= "no_extension";
+				PLATFORM	= "unknown";
+				EXTENSION	= "unknown";
 			}
 		} else if ( navigator.platform.toLowerCase().indexOf( "linux" ) != -1 ) {
 			if ( navigator.platform.indexOf( "64" ) != -1 ) {
 				UI_PLATFORM	= "Linux 64-bit (RPM)";
 				PLATFORM	= "Linux_x86-64_install-rpm";
 				EXTENSION	= ".tar.gz";
+				// UI_PLATFORM	= "Linux 64-bit (RPM/DEB ?)";
+				// PLATFORM	= "other";
+				// EXTENSION	= "";
 				if ( navigator.userAgent.toLowerCase().indexOf( "debian" )    != -1 ||
 				     navigator.userAgent.toLowerCase().indexOf( "ubuntu" )    != -1 ||
 				     navigator.userAgent.toLowerCase().indexOf( "iceweasel" ) != -1 ) {
@@ -193,6 +203,9 @@ function getPlatform() {
 				UI_PLATFORM	= "Linux 32-Bit (RPM)";
 				PLATFORM	= "Linux_x86_install-rpm";
 				EXTENSION	= ".tar.gz";
+				// UI_PLATFORM	= "Linux 32-Bit (RPM/DEB ?)";
+				// PLATFORM	= "other";
+				// EXTENSION	= "";
 				if ( navigator.userAgent.toLowerCase().indexOf( "debian" )    != -1 ||
 				     navigator.userAgent.toLowerCase().indexOf( "ubuntu" )    != -1 ||
 				     navigator.userAgent.toLowerCase().indexOf( "iceweasel" ) != -1 ) {
@@ -207,49 +220,49 @@ function getPlatform() {
 			EXTENSION	= ".dmg";
 			if ( navigator.userAgent.toLowerCase().indexOf( "ppc" ) != -1 ) {
 				UI_PLATFORM	= "Mac OS PPC (DMG)";
-				PLATFORM	= "no_mirror_platform";
-				EXTENSION	= "no_extension";
+				PLATFORM	= "unknown";
+				EXTENSION	= "unknown";
 			}
 		} else if ( navigator.platform.toLowerCase().indexOf( "sunos" ) != -1 ) {
 			UI_PLATFORM	= "Solaris x86 (PKG)";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 			if ( navigator.userAgent.toLowerCase().indexOf( "sun4u" ) != -1 ) {
 				UI_PLATFORM	= "Solaris SPARC (PKG)";
-				PLATFORM	= "no_mirror_platform";
-				EXTENSION	= "no_extension";
+				PLATFORM	= "unknown";
+				EXTENSION	= "unknown";
 			}
 		} else if ( navigator.platform.toLowerCase().indexOf( "freebsd" ) != -1 ) {
 			UI_PLATFORM	= "FreeBSD (PKG)";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		} else if ( navigator.platform.toLowerCase().indexOf( "os/2" ) != -1 ) {
 			UI_PLATFORM	= "OS/2";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		} else if ( navigator.userAgent.toLowerCase().indexOf( "iphone" ) != -1 ||
 			    navigator.userAgent.toLowerCase().indexOf( "ipad" )   != -1 ||
 			    navigator.userAgent.toLowerCase().indexOf( "ipod" )   != -1 ) {
 			UI_PLATFORM	= "Apple mobile device (iPhone/iPad/iPod)";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		} else if ( navigator.userAgent.toLowerCase().indexOf( "android" ) != -1 ) {
 			UI_PLATFORM	= "Android mobile device";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		} else if ( navigator.userAgent.toLowerCase().indexOf( "blackberry" ) != -1 ) {
 			UI_PLATFORM	= "Blackberry mobile device";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		} else if ( navigator.userAgent.toLowerCase().indexOf( "symbian" ) != -1 ) {
 			UI_PLATFORM	= "Symbian mobile device";
-			PLATFORM	= "no_mirror_platform";
-			EXTENSION	= "no_extension";
+			PLATFORM	= "unknown";
+			EXTENSION	= "unknown";
 		}
 	} else {
-		UI_PLATFORM	= "not recognizable";
-		PLATFORM	= "no_mirror_platform";
-		EXTENSION	= "no_extension";
+		UI_PLATFORM	= "unknown";
+		PLATFORM	= "unknown";
+		EXTENSION	= "unknown";
 	}
 }