You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by bu...@apache.org on 2014/05/01 15:08:19 UTC

svn commit: r907636 - in /websites/staging/ooo-site/trunk: cgi-bin/ content/ content/download/download.js

Author: buildbot
Date: Thu May  1 13:08:18 2014
New Revision: 907636

Log:
Staging update by buildbot for ooo-site

Modified:
    websites/staging/ooo-site/trunk/cgi-bin/   (props changed)
    websites/staging/ooo-site/trunk/content/   (props changed)
    websites/staging/ooo-site/trunk/content/download/download.js

Propchange: websites/staging/ooo-site/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu May  1 13:08:18 2014
@@ -1 +1 @@
-1591647
+1591648

Propchange: websites/staging/ooo-site/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu May  1 13:08:18 2014
@@ -1 +1 @@
-1591647
+1591648

Modified: websites/staging/ooo-site/trunk/content/download/download.js
==============================================================================
--- websites/staging/ooo-site/trunk/content/download/download.js (original)
+++ websites/staging/ooo-site/trunk/content/download/download.js Thu May  1 13:08:18 2014
@@ -2,9 +2,10 @@
  * Overview of all functions defined below
  * ---------------------------------------
  * function getLanguage   ()
- * function hasMirrorLink ( rel_mode )
+ * function hasMirrorLink ()
  * function getLink       ( rel_mode )
- * function getPlatform   ( rel_mode )
+ * function getPlatform   ()
+ * function getFilesize   ()
  * function openItem      ( itemid, uri )
  */
 
@@ -32,6 +33,30 @@ var ARCHIVE			= false; // The download U
 var ERROR			= false; // The download URL is correct (false) or not (true)?
 
 /*
+ * Output values of variables for debugging
+ */
+function alertDbg( function_name ) {
+	alert ( ""
+	+ function_name												+ "\n"
+	+ "LANG_ISO: "				+ "\t\t\t\t\t"		+ LANG_ISO				+ "\n"
+	+ "RELEASE_MATRIX_PLATFORM_POS: "	+ "\t"			+ RELEASE_MATRIX_PLATFORM_POS		+ "\n"
+	+ "RELEASE_MATRIX_PLATFORM: "		+ "\t\t\t"		+ RELEASE_MATRIX_PLATFORM		+ "\n"
+	+ "UI_PLATFORM: "			+ "\t\t\t\t\t"		+ UI_PLATFORM				+ "\n"
+	+ "URL_PLATFORM: "			+ "\t\t\t\t\t"		+ URL_PLATFORM				+ "\n"
+	+ "OLD_PLATFORM: "			+ "\t\t\t\t\t"		+ OLD_PLATFORM				+ "\n"
+	+ "FILENAME: "				+ "\t\t\t\t"		+ FILENAME				+ "\n"
+	+ "FILESIZE: "				+ "\t\t\t\t\t"		+ FILESIZE				+ "\n"
+	+ "EXTENSION: "				+ "\t\t\t\t\t"		+ EXTENSION				+ "\n"
+	+ "BASE_URL: "				+ "\t\t\t\t\t"		+ SOURCEFORGE_BASE_URL			+ "\n"
+	+ "LINK: "				+ "\t\t\t\t\t\t"	+ LINK					+ "\n"
+	+ "SOURCEFORGE: "			+ "\t\t\t\t\t\t"	+ SOURCEFORGE				+ "\n"
+	+ "OTHER: "				+ "\t\t\t\t\t\t"	+ OTHER					+ "\n"
+	+ "ARCHIVE: "				+ "\t\t\t\t\t\t"	+ ARCHIVE				+ "\n"
+	+ "ERROR: "				+ "\t\t\t\t\t\t"	+ ERROR					+ "\n"
+	+ "" );
+}
+
+/*
  * Get array and ISO code for language
  * Depends on $NL_LANGUAGE
  */
@@ -108,42 +133,14 @@ function getLanguage() {
  * Get flag for mirror link
  * Depends on array-list
  */
-function hasMirrorLink( rel_mode ) {
-
-	if ( rel_mode == 1 ) {
-		// Release mode
-		// First check if the Beta release languages (not available as current stable release !) are set in browser
-		if ( LANG_ISO == "bg" || LANG_ISO == "da" || LANG_ISO == "hi" || LANG_ISO == "nb" || LANG_ISO == "th" ) {
-			SOURCEFORGE	= false;
-			OTHER		= true;
-			ARCHIVE		= false;
-			ERROR		= true;
-			return false;
-		}
-		// Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage
-		if ( LANG_ARRAY[ 3 ] == 'y' ) {
-			return true;
-		} else {
-			ERROR = true;
-			return false;
-		}
-	} else {
-		// Beta release mode
-		// Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage
-		if ( LANG_ARRAY[ 3 ] == 'y' ) {
-			return true;
-		} else {
-			ERROR = true;
-			return false;
-		}
-	}
-/*
-	if ( LANG_ARRAY[ 3 ] == 'y' )
+function hasMirrorLink() {
+	// Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage
+	if ( LANG_ARRAY[ 3 ] == 'y' ) {
 		return true;
-	else
+	} else {
 		ERROR = true;
 		return false;
-*/
+	}
 }
 
 /*
@@ -158,9 +155,9 @@ function getLink( rel_mode ) {
 		rel_mode = 1;
 
 	getLanguage();
-	getPlatform( rel_mode );
-	if ( hasMirrorLink( rel_mode ) ) {
-		getFilesize( rel_mode );
+	getPlatform();
+	if ( hasMirrorLink() ) {
+		getFilesize();
 	}
 	/*
 	if ( NL_LANGUAGE == "" )
@@ -173,7 +170,7 @@ function getLink( rel_mode ) {
 	*/
 
 	// If language is supported, then provide a download link. 
-	if ( hasMirrorLink( rel_mode ) ) {
+	if ( hasMirrorLink() ) {
 		// Release mode
 		if ( rel_mode == 1 ) {
 			// If platform is too old, then provide a general download link to the archive.
@@ -246,12 +243,11 @@ function getLink( rel_mode ) {
 			}
 
 			// If platform was recognized, assemble the filenames for download and checksums
-
-			// FILENAME	= "Apache_OpenOffice_" + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO;
-			// FILENAME	= FILENAME + EXTENSION;
+			FILENAME	= "Apache_OpenOffice_" + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO;
+			FILENAME	= FILENAME + EXTENSION;
 
 			// Assign the file name (column 3) from the release matrix of language and platform
-			FILENAME	= release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ];
+			// FILENAME	= release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ];
 
 			// LINK	= SOURCEFORGE_BASE_URL + LANG_ISO + "/Apache_OpenOffice_" + VERSION + "_";
 			// LINK	= LINK + URL_PLATFORM + "_" + LANG_ISO + EXTENSION + "/download";
@@ -313,8 +309,13 @@ function getLink( rel_mode ) {
 				ERROR		= true;
 				return LINK;
 			}
+
+			// If platform was recognized, assemble the filenames for download and checksums
+			FILENAME	= "Apache_OpenOffice_" + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO;
+			FILENAME	= FILENAME + EXTENSION;
+
 			// Assign the file name (column 3) from the release matrix of language and platform
-			FILENAME	= release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ];
+			// FILENAME	= release_matrix_410_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ];
 
 			// LINK	= BETA_SOURCEFORGE_BASE_URL + LANG_ISO + "/Apache_OpenOffice_Beta_" + VERSION + "_";
 			// LINK	= LINK + URL_PLATFORM + "_" + LANG_ISO + EXTENSION + "/download";
@@ -354,7 +355,7 @@ function getLink( rel_mode ) {
  * Get platform of browser
  * Depends on internal browser data
  */
-function getPlatform( rel_mode ) {
+function getPlatform() {
 	// For more help or data see: "http://www.useragentstring.com"
 
 	var os		= navigator.platform.toLowerCase();	// Get the platform string in lower cases
@@ -501,8 +502,7 @@ function getPlatform( rel_mode ) {
 		     ua.indexOf( "10.3"		) != -1 ||
 		     ua.indexOf( "10_3"		) != -1 ) {	UI_PLATFORM	= "Mac OS X (10.6 or older)";
 								URL_PLATFORM	= "MacOS_x86_install";
-								if ( rel_mode > 0 )
-									OLD_PLATFORM = true;
+								OLD_PLATFORM	= true;
 		}
 	  } 
 	} 
@@ -520,29 +520,29 @@ function getPlatform( rel_mode ) {
  * Get file size for download file
  * Depends on array-list
  */
-function getFilesize( rel_mode ) {
+function getFilesize() {
 	// Depending on $URL_PLATFORM assign the platform position of the release matrix
 	switch ( URL_PLATFORM ) {
 		case "Linux_x86-64_install-deb":
-			RELEASE_MATRIX_PLATFORM_POS = 0;
+			RELEASE_MATRIX_PLATFORM_POS = 1;
 			break;
 		case "Linux_x86-64_install-rpm":
-			RELEASE_MATRIX_PLATFORM_POS = 1;
+			RELEASE_MATRIX_PLATFORM_POS = 3;
 			break;
 		case "Linux_x86_install-deb":
-			RELEASE_MATRIX_PLATFORM_POS = 4;
+			RELEASE_MATRIX_PLATFORM_POS = 5;
 			break;
 		case "Linux_x86_install-rpm":
-			RELEASE_MATRIX_PLATFORM_POS = 5;
+			RELEASE_MATRIX_PLATFORM_POS = 7;
 			break;
 		case "MacOS_x86-64_install":
-			RELEASE_MATRIX_PLATFORM_POS = 8;
+			RELEASE_MATRIX_PLATFORM_POS = 9;
 			break;
 		case "MacOS_x86_install":
-			RELEASE_MATRIX_PLATFORM_POS = 8;
+			RELEASE_MATRIX_PLATFORM_POS = 9;
 			break;
 		case "Win_x86_install":
-			RELEASE_MATRIX_PLATFORM_POS = 10;
+			RELEASE_MATRIX_PLATFORM_POS = 11;
 			break;
 		default:
 			RELEASE_MATRIX_PLATFORM_POS = -1;
@@ -550,19 +550,10 @@ function getFilesize( rel_mode ) {
 
 	// If a platform was found and no error occurred, assign the array data and filesize from the release matrix
 	if ( RELEASE_MATRIX_PLATFORM_POS > -1 && !ERROR ) {
-		if ( rel_mode == 1 ) {
-			// Release mode
-			// Assign all values from the release matrix of language and platform
-			RELEASE_MATRIX_PLATFORM	= release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ];
-			// Assign the file size (column 2) from the release matrix of language and platform
-			FILESIZE		= release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 2 ];
-		} else {
-			// Beta release mode
-			// Assign all values from the release matrix of language and platform
-			RELEASE_MATRIX_PLATFORM	= release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ];
-			// Assign the file size (column 2) from the release matrix of language and platform
-			FILESIZE		= release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 2 ];
-		}
+		// Assign all values from the release matrix of language and platform
+		RELEASE_MATRIX_PLATFORM	= release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ];
+		// Assign the file size (column 2) from the release matrix of language and platform
+		FILESIZE		= release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 2 ];
 	} else {
 		ERROR	 = true;
 		FILESIZE = 0;