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 2014/03/25 23:03:30 UTC

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

Author: marcus
Date: Tue Mar 25 22:03:29 2014
New Revision: 1581556

URL: http://svn.apache.org/r1581556
Log:
First check if browser language is available for Beta release but not for stable release, then check if language build is available on mirror

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

Modified: openoffice/ooo-site/trunk/content/download/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/download.js?rev=1581556&r1=1581555&r2=1581556&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/download.js Tue Mar 25 22:03:29 2014
@@ -2,9 +2,9 @@
  * Overview of all functions defined below
  * ---------------------------------------
  * function getLanguage   ()
- * function hasMirrorLink ()
- * function getLink       ()
- * function getPlatform   ()
+ * function hasMirrorLink ( rel_mode )
+ * function getLink       ( rel_mode )
+ * function getPlatform   ( rel_mode )
  * function openItem      ( itemid, uri )
  */
 
@@ -108,13 +108,42 @@ function getLanguage() {
  * Get flag for mirror link
  * Depends on array-list
  */
-function hasMirrorLink() {
-	// Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage
+function hasMirrorLink( rel_mode ) {
+
+	if ( rel_mode == 0 ) {
+		// 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' )
 		return true;
 	else
 		ERROR = true;
 		return false;
+*/
 }
 
 /*
@@ -130,7 +159,7 @@ function getLink( rel_mode ) {
 
 	getLanguage();
 	getPlatform( rel_mode );
-	if ( hasMirrorLink() ) {
+	if ( hasMirrorLink( rel_mode ) ) {
 		getFilesize( rel_mode );
 	}
 	/*
@@ -144,7 +173,7 @@ function getLink( rel_mode ) {
 	*/
 
 	// If language is supported, then provide a download link. 
-	if ( hasMirrorLink() ) {
+	if ( hasMirrorLink( rel_mode ) ) {
 		// Release mode
 		if ( rel_mode == 0 ) {
 			// If platform is too old, then provide a general download link to the archive.