openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1570396 - /openoffice/ooo-site/trunk/content/download/test/download_other.js
Date Fri, 21 Feb 2014 00:15:20 GMT
Author: marcus
Date: Fri Feb 21 00:15:20 2014
New Revision: 1570396

URL: http://svn.apache.org/r1570396
Log:
Updated DL logic with beta mode

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

Modified: openoffice/ooo-site/trunk/content/download/test/download_other.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download_other.js?rev=1570396&r1=1570395&r2=1570396&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download_other.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download_other.js Fri Feb 21 00:15:20
2014
@@ -22,28 +22,52 @@ var LANG_MAX		= 133;	// The maximal avai
  * Define base variables
  * The main entry for writting the table into the webpage 
  */
-function write_table() {
+function write_table( rel_mode ) {
 	var AOO		= "Apache_OpenOffice_";
 	var AOO_SDK	= "Apache_OpenOffice-SDK_";
-	var AOO_SRC	= "/source/apache-openoffice-" + VERSION + "-" + SVN_REV + "-src";
-	var URL_AOO	= SOURCEFORGE_BASE_URL;
-	var URL_SDK	= SOURCEFORGE_BASE_URL + "SDK/Apache_OpenOffice-SDK_" + VERSION;
-	var URL_SRC	= APACHE_DIST_BASE_URL + AOO_SRC;
+	if ( rel_mode == 0 ) {
+		// Release mode
+		var AOO_SRC	= "/source/apache-openoffice-" + VERSION + "-" + SVN_REV + "-src";
+		var URL_AOO	= SOURCEFORGE_BASE_URL;
+		var URL_SDK	= SOURCEFORGE_BASE_URL + "SDK/Apache_OpenOffice-SDK_" + VERSION;
+		var URL_SRC	= APACHE_DIST_BASE_URL + AOO_SRC;
 
 // Debug: Uncomment to use different base URLs
 /*
-	var URL_AOO	= PEOPLE_BASE_URL + "/binaries/";
-	var URL_SDK	= PEOPLE_BASE_URL + "/binaries/SDK/Apache_OpenOffice-SDK_" + VERSION;
-	var URL_SRC	= PEOPLE_BASE_URL + "/source/" + AOO_SRC + VERSION + "-" + SVN_REV;
+		var URL_AOO	= PEOPLE_BASE_URL + "/binaries/";
+		var URL_SDK	= PEOPLE_BASE_URL + "/binaries/SDK/Apache_OpenOffice-SDK_" + VERSION;
+		var URL_SRC	= PEOPLE_BASE_URL + "/source/" + AOO_SRC + VERSION + "-" + SVN_REV;
 */
-	var URL_HASH	= APACHE_DIST_BASE_URL;
+		var URL_HASH	= APACHE_DIST_BASE_URL;
+
+	} else {
+		// Beta release mode
+		var AOO_SRC	= "/source/apache-openoffice-" + BETA_VERSION + "-" + SVN_REV + "-src";
+		var URL_AOO	= SOURCEFORGE_BASE_URL_BETA;
+		var URL_SDK	= SOURCEFORGE_BASE_URL_BETA + "SDK/Apache_OpenOffice-SDK_" + BETA_VERSION;
+		var URL_SRC	= APACHE_DIST_BASE_URL_BETA + AOO_SRC;
+
+// Debug: Uncomment to use different base URLs
+/*
+		var URL_AOO	= PEOPLE_BASE_URL + "/binaries/";
+		var URL_SDK	= PEOPLE_BASE_URL + "/binaries/SDK/Apache_OpenOffice-SDK_" + BETA_VERSION;
+		var URL_SRC	= PEOPLE_BASE_URL + "/source/" + AOO_SRC + BETA_VERSION + "-" + SVN_REV;
+*/
+		var URL_HASH	= APACHE_DIST_BASE_URL_BETA;
+
+		VERSION		= BETA_VERSION;
+		PLATFORM	= BETA_PLATFORM;
+		FULL_LANG	= BETA_FULL_LANG;
+		LP_LANG		= BETA_LP_LANG;
+		SDK_LANG	= BETA_SDK_LANG;
+	}
 
 	document.write( "<table class='builds' cellpadding='2' cellspacing='2'>" );
 
-	write_header( 1 );
+	write_header( rel_mode, 1 );
 	document.write( "<tbody>" );
-	write_lang( URL_AOO,                   URL_HASH,          PLATFORM, FULL_LANG, LP_LANG,
VERSION, AOO     );
-	write_sdk(           URL_SDK, URL_SRC, URL_HASH, AOO_SRC, PLATFORM, SDK_LANG,          
VERSION, AOO_SDK );
+	write_lang( rel_mode, URL_AOO,                   URL_HASH,          PLATFORM, FULL_LANG,
LP_LANG, VERSION, AOO     );
+	write_sdk(  rel_mode,          URL_SDK, URL_SRC, URL_HASH, AOO_SRC, PLATFORM, SDK_LANG,
          VERSION, AOO_SDK );
 	write_top();
 
 	document.write( "</tbody>" );
@@ -79,7 +103,7 @@ function write_top() {
 /*
  * This writes the header row with the OS headlines
  */
-function write_header( FIRST_HEADER ) {
+function write_header( rel_mode, FIRST_HEADER ) {
 	// Add ECMA262-5 Array methods if not supported natively
 	// To workaround that MSIE 8 and older do not support this function
 	if ( !( 'indexOf' in Array.prototype ) ) {
@@ -121,15 +145,23 @@ function write_header( FIRST_HEADER ) {
 		document.write( "<th><span style='text-align: center' class='builds'>" + SMALL1
+ "Linux      <br />x86-64<br />RPM" + SMALL2 + "</span></th>" );
 	if ( PLATFORM.indexOf( "Linux_x86-64_deb" ) > -1 )
 		document.write( "<th><span style='text-align: center' class='builds'>" + SMALL1
+ "Linux      <br />x86-64<br />DEB" + SMALL2 + "</span></th>" );
-	if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 )
-		document.write( "<th><span style='text-align: center' class='builds'>" + SMALL1
+ "OS&nbsp;X<br />Intel <br />DMG" + SMALL2 + "</span></th>" );
+	if ( rel_mode == 0 ) {
+		// Release mode
+		if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 )
+			document.write( "<th><span style='text-align: center' class='builds'>" + SMALL1
+ "OS&nbsp;X  <br />Intel <br />DMG" + SMALL2 + "</span></th>"
);
+	} else {
+		// Beta release mode
+		PLATFORM = BETA_PLATFORM;
+		if ( PLATFORM.indexOf( "MacOS_x86-64" ) > -1 )
+			document.write( "<th><span style='text-align: center' class='builds'>" + SMALL1
+ "OS&nbsp;X  <br />x86-64<br />DMG" + SMALL2 + "</span></th>"
);
+	}
 	document.write( "</tr></thead>" );
 }
 
 /*
  * This writes the build rows (full install, langpack, SDK)
  */
-function write_build( URL_AOO, URL_HASH, PLATFORM, INSTALL_LANG, i, k, VERSION, AOO, TYPE
) {
+function write_build( rel_mode, URL_AOO, URL_HASH, PLATFORM, INSTALL_LANG, i, k, VERSION,
AOO, TYPE ) {
 	// Show the checksum links in smaller font size than the binary links
 	var SMALL = "style='font-size: x-small'";
 
@@ -185,12 +217,23 @@ function write_build( URL_AOO, URL_HASH,
 			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_Linux_x86-64_" + TYPE + "-deb"
+ "_" + INSTALL_LANG[ k ] + ".tar.gz.md5'>MD5</a><br />" );
 			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_Linux_x86-64_" + TYPE + "-deb"
+ "_" + INSTALL_LANG[ k ] + ".tar.gz.sha256'>SHA256</a></td>" );
 		}
-		if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 ) {
-			document.write( "<td style='text-align: center'><a href='"              + URL_AOO
                + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE      
   + "_" + INSTALL_LANG[ k ] + ".dmg'><b>dmg</b></a><br /><br
/>" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE       
  + "_" + INSTALL_LANG[ k ] + ".dmg.asc'>ASC</a>" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE       
  + "_" + INSTALL_LANG[ k ] + ".dmg.md5'>MD5</a><br />" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE       
  + "_" + INSTALL_LANG[ k ] + ".dmg.sha256'>SHA256</a></td>" );
+		if ( rel_mode == 0 ) {
+			// Release mode
+			if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 ) {
+				document.write( "<td style='text-align: center'><a href='"              + URL_AOO
                + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg'><b>dmg</b></a><br /><br />"
);
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.asc'>ASC</a>" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.md5'>MD5</a><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.sha256'>SHA256</a></td>" );
+			}
+		} else {
+			// Beta release mode
+			if ( PLATFORM.indexOf( "MacOS_x86-64" ) > -1 ) {
+				document.write( "<td style='text-align: center'><a href='"              + URL_AOO
                + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg'><b>dmg</b></a><br /><br />"
);
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.asc'>ASC</a>" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.md5'>MD5</a><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/" + INSTALL_LANG[ k ] + "/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_"
+ INSTALL_LANG[ k ] + ".dmg.sha256'>SHA256</a></td>" );
 		}
+			}
 	} else {
 
 
@@ -225,11 +268,22 @@ function write_build( URL_AOO, URL_HASH,
 			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_Linux_x86-64_" + TYPE + "-deb" + "_" + INSTALL_LANG[
k ] + ".tar.gz.md5'>MD5</a><br />" );
 			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_Linux_x86-64_" + TYPE + "-deb" + "_" + INSTALL_LANG[
k ] + ".tar.gz.sha256'>SHA256</a></td>" );
 		}
-		if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 ) {
-			document.write( "<td style='text-align: center'><a href='"              + URL_AOO
 +                                    "_MacOS_x86_"    + TYPE          + "_" + INSTALL_LANG[
k ] + ".dmg'><b>dmg</b></a><br /><br />" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE          + "_" + INSTALL_LANG[
k ] + ".dmg.asc'>ASC</a>" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE          + "_" + INSTALL_LANG[
k ] + ".dmg.md5'>MD5</a><br />" );
-			document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE          + "_" + INSTALL_LANG[
k ] + ".dmg.sha256'>SHA256</a></td>" );
+		if ( rel_mode == 0 ) {
+			// Release mode
+			if ( PLATFORM.indexOf( "MacOS_x86" ) > -1 ) {
+				document.write( "<td style='text-align: center'><a href='"              + URL_AOO
 +                                    "_MacOS_x86_"    + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg'><b>dmg</b></a><br /><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.asc'>ASC</a>" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.md5'>MD5</a><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86_"    + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.sha256'>SHA256</a></td>" );
+			}
+		} else {
+			// Beta release mode
+			if ( PLATFORM.indexOf( "MacOS_x86-64" ) > -1 ) {
+				document.write( "<td style='text-align: center'><a href='"              + URL_AOO
 +                                    "_MacOS_x86-64_" + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg'><b>dmg</b></a><br /><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.asc'>ASC</a>" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.md5'>MD5</a><br />" );
+				document.write( "                               <a " + SMALL + "href='" + URL_HASH
+ "/binaries/SDK/" + AOO + VERSION + "_MacOS_x86-64_" + TYPE  + "_" + INSTALL_LANG[ k ] +
".dmg.sha256'>SHA256</a></td>" );
+			}
 		}
 	}
 
@@ -239,7 +293,7 @@ function write_build( URL_AOO, URL_HASH,
 	ROW_COUNT++;
 	if ( ROW_COUNT == 9 ) {
 		write_top();
-		write_header( 0 );
+		write_header( rel_mode, 0 );
 		ROW_COUNT = 1;
 	}
 }
@@ -247,7 +301,7 @@ function write_build( URL_AOO, URL_HASH,
 /*
  * This writes the English and native name of a language and all download links
  */
-function write_lang( URL_AOO, URL_HASH, PLATFORM, FULL_LANG, LP_LANG, VERSION, AOO ) {
+function write_lang( rel_mode, URL_AOO, URL_HASH, PLATFORM, FULL_LANG, LP_LANG, VERSION,
AOO ) {
 	ROW_COUNT	= 1;
 	FULL_LANG_COUNT	= 1;
 	LP_LANG_COUNT	= 1;
@@ -268,7 +322,7 @@ function write_lang( URL_AOO, URL_HASH, 
 			for ( var k = 0; k < FULL_LANG.length; k++ ) {
 				if ( FULL_LANG[ k ] == LANG[ i ][ "ISO" ] ) {
 					if ( FULL_LANG[ k ] == "en-US" ) {
-						write_build( URL_AOO, URL_HASH, PLATFORM, FULL_LANG, i, k, VERSION, AOO, "install"
);
+						write_build( rel_mode, URL_AOO, URL_HASH, PLATFORM, FULL_LANG, i, k, VERSION, AOO,
"install" );
 					}
 					FULL_LANG_COUNT++;
 
@@ -285,12 +339,12 @@ function write_lang( URL_AOO, URL_HASH, 
 			if ( LP_LANG[ j ] == LANG[ i ][ "ISO" ] ) {
 				for ( var k = 0; k < FULL_LANG.length; k++ ) {
 					if ( FULL_LANG.length > 1 && FULL_LANG[ k ] == LANG[ i ][ "ISO" ] ) {
-						write_build( URL_AOO, URL_HASH, PLATFORM, FULL_LANG, i, k, VERSION, AOO, "install"
);
+						write_build( rel_mode, URL_AOO, URL_HASH, PLATFORM, FULL_LANG, i, k, VERSION, AOO,
"install" );
 						FULL_LANG_COUNT++;
 					}
 				}
 				if ( URL_AOO.indexOf( "SDK" ) == -1 ) {
-					write_build( URL_AOO, URL_HASH, PLATFORM, LP_LANG, i, j, VERSION, AOO, "langpack" );
+					write_build( rel_mode, URL_AOO, URL_HASH, PLATFORM, LP_LANG, i, j, VERSION, AOO, "langpack"
);
 					LP_LANG_COUNT++;
 				}
 			}
@@ -304,7 +358,7 @@ function write_lang( URL_AOO, URL_HASH, 
 /*
  * This writes the column names and download links for SDK builds, source tarballs and other
files
  */
-function write_sdk( URL_SDK, URL_SRC, URL_HASH, AOO_SRC, PLATFORM, SDK_LANG, VERSION, AOO_SDK
) {
+function write_sdk( rel_mode, URL_SDK, URL_SRC, URL_HASH, AOO_SRC, PLATFORM, SDK_LANG, VERSION,
AOO_SDK ) {
 	// Show the checksum links in smaller font size than the binary links
 	var SMALL = "style='font-size: x-small'";
 
@@ -316,8 +370,7 @@ function write_sdk( URL_SDK, URL_SRC, UR
 		document.write( "<tr id='source' class='a'><td class='footer' colspan='" + COLSPAN
+ "'>&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;</td></tr>"
);
 
 	// Then write the row with the SDK builds
-	write_lang( URL_SDK, URL_HASH, PLATFORM, SDK_LANG, SDK_LANG, VERSION, AOO_SDK );
-
+	write_lang( rel_mode, URL_SDK, URL_HASH, PLATFORM, SDK_LANG, SDK_LANG, VERSION, AOO_SDK
);
 
 	// Then write the row with the source tarballs
 	if ( ROW_COUNT ==  1 || ROW_COUNT ==  3 || ROW_COUNT ==  5 || ROW_COUNT ==  7 || ROW_COUNT
==  9 ||



Mime
View raw message