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 2016/07/22 22:39:52 UTC
svn commit: r993444 - in /websites/staging/ooo-site/trunk: cgi-bin/ content/
content/download/test/download.js
Author: buildbot
Date: Fri Jul 22 22:39:52 2016
New Revision: 993444
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/test/download.js
Propchange: websites/staging/ooo-site/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jul 22 22:39:52 2016
@@ -1 +1 @@
-1753838
+1753839
Propchange: websites/staging/ooo-site/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jul 22 22:39:52 2016
@@ -1 +1 @@
-1753838
+1753839
Modified: websites/staging/ooo-site/trunk/content/download/test/download.js
==============================================================================
--- websites/staging/ooo-site/trunk/content/download/test/download.js (original)
+++ websites/staging/ooo-site/trunk/content/download/test/download.js Fri Jul 22 22:39:52 2016
@@ -1,8 +1,8 @@
/*
- * Overview of all methods (functions) defined below of the global object "DL"
- * ---------------------------------------------------------------------------
- * function DL.init ()
- * function DL.initVariables ()
+ * Overview of all methods (functions) of the global object "DL"
+ * -------------------------------------------------------------
+ * function DL.init ( release_mode )
+ * function DL.initVariables ( init_all )
* function DL.getLanguage ()
* function DL.fillOSSelection ()
* function DL.fillLanguageSelection ()
@@ -21,11 +21,11 @@
* function DL.getLinkSelection ()
* function DL.getPlatform ()
* function DL.getReleaseMatrixPosition ()
- * function DL.getFileData ( version )
+ * function DL.getFileData ()
* function DL.debug ( location )
*
- * Overview of global functions defined below
- * ------------------------------------------
+ * Overview of global functions
+ * ----------------------------------------------------
* function openItem ( itemid, uri )
*/
@@ -93,6 +93,7 @@ DL.initVariables = function( init_all )
DL.UI_PLATFORM_NO_SUP = ""; // The platform as readable string, if not supported.
DL.PLATFORM_SEL = ""; // The selected platform from select box.
DL.VERSION_SEL = ""; // The selected version from select box.
+ DL.VERSION_SEL_RAW = ""; // The selected version from select box without dots.
}
DL.UI_PLATFORM = ""; // The platform as readable string.
@@ -246,7 +247,7 @@ DL.fillOSSelection = function() {
if ( l10n.dl_green_box_select_box_os_values[ 0 ].length > 0 ) {
// Search through the localized names.
for( i = 0, j = l10n.dl_green_box_select_box_os_values.length; i < j; i++ ) {
- // Exchange only the default UI platform name with the localized name.
+ // Exchange the English UI platform name with the localized one.
selection.options[ i ].text = l10n.dl_green_box_select_box_os_values[ i ];
}
}
@@ -274,9 +275,9 @@ DL.fillLanguageSelection = function() {
// Assign the language name as "English name (Native name)".
option.text = DL.SEL_LANG[ i + 1 ];
*/
- // Assign the language name as "Native name" (or English name if localization is not available).
+ // Assign the language name as "English name".
option.text = DL.SEL_LANG[ i + 1 ];
- // Assign the language as "English name (ISO code)" as title.
+ // Assign the language name as "Native name (ISO code)" to show as mouse over title.
option.title = DL.SEL_LANG[ i + 2 ] + " (" + DL.SEL_LANG[ i ] + ")";
// Add the new option to the already existing ones.
selection.appendChild( option );
@@ -287,7 +288,7 @@ DL.fillLanguageSelection = function() {
if ( l10n.dl_green_box_select_box_language_values[ 0 ].length > 0 ) {
// Search through the localized names.
for( i = 0, j = l10n.dl_green_box_select_box_language_values.length; i < j; i++ ) {
- // Exchange only the default language name with the localized name.
+ // Exchange the English language name with the localized one.
selection.options[ i ].text = l10n.dl_green_box_select_box_language_values[ i ];
/*
alert( "i: \t\t" + i + "\n"
@@ -326,7 +327,7 @@ DL.fillVersionSelection = function() {
if ( l10n.dl_green_box_select_box_version_values[ 0 ].length > 0 ) {
// Search through the localized names.
for( i = 0, j = l10n.dl_green_box_select_box_version_values.length; i < j; i++ ) {
- // Exchange only the default version name with the localized name.
+ // Exchange the version name with the localized one.
selection.options[ i ].text = l10n.dl_green_box_select_box_version_values[ i ];
}
}
@@ -379,21 +380,19 @@ DL.setLanguageSelection = function() {
// Depending on $DL.LANG_ISO assign the language position of the release matrix.
var selection = document.getElementById( "language" );
- var found = false;
// Set the recognized browser language as default for the select box.
for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
// If the language was found, set it as pre-selected.
if( DL.SEL_LANG[ i ] === DL.LANG_ISO ) {
selection.selectedIndex = i / 3;
- found = true;
break;
}
}
// If no selected language was set in the select box because it was not recognized from browser data,
// assign "en-US" as default.
- if( ! found ) {
+ if( selection.selectedIndex === 0 ) {
// Default: Assign "en-US".
for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 2 ) {
// If the language was found, set it as pre-selected.
@@ -427,18 +426,7 @@ DL.setVersionSelection = function() {
}
}
- // If no version was set as global variable,
- // assign the most recent version as default.
- if( selection.selectedIndex === 0 ) {
- // Default: Assign "4.1.0".
- for( var i = 0, j = DL.SEL_VER.length; i < j; i = i + 2 ) {
- // If the version was found, set it as pre-selected.
- if( DL.SEL_VER[ i ] === "4.1.0" ) {
- selection.selectedIndex = i / 2;
- break;
- }
- }
- }
+ // No need to assign a default version because the propery "DL.VERSION" must always exist.
DL.VERSION_SEL = selection.value;
return DL.VERSION_SEL;
@@ -502,6 +490,9 @@ DL.getVersionSelection = function() {
}
}
+ // Get the version number without dots (e.g., "412" instead of "4.1.2").
+ DL.VERSION_SEL_RAW = DL.VERSION_SEL.replace( /\./g,'' );
+
return DL.VERSION_SEL;
}
@@ -536,7 +527,9 @@ DL.showWindow = function( target_link )
var popup_window = "";
popup_window = window.open( target_link, "_blank", "location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, titlebar=no, toolbar=no, left=100, top=250, width=800, height=550" );
- window.focus();
+ if (window.focus) {
+ popup_window.focus;
+ }
return;
}
@@ -597,22 +590,16 @@ DL.isLanguageSupported = function() {
DL.VERSION_SEL = DL.VERSION;
}
- // Get the release matrix depending on the version.
- switch( DL.VERSION_SEL ) {
- case "4.1.0":
- DL.RELEASE_LANG = DL.release_matrix_410[ DL.LANG_ISO ][ 0 ];
- break;
- case "4.0.1":
- DL.RELEASE_LANG = DL.release_matrix_401[ DL.LANG_ISO ][ 0 ];
- break;
- case "4.0.0":
- DL.RELEASE_LANG = DL.release_matrix_400[ DL.LANG_ISO ][ 0 ];
- break;
- default:
- DL.RELEASE_LANG = "";
- DL.ERROR = true;
+ // If VERSION != "4.x.y" then exit.
+ if( DL.VERSION_SEL === "3.4.1" || DL.VERSION_SEL === "older" || DL.VERSION_SEL === "other" ) {
+ DL.ERROR = false;
+ return false;
}
+ // Assign the language data of the selected version depending on the ISO code.
+ // Generate variable name: release_matrix_ + version number without dots (e.g., "412" instead of "4.1.2").
+ DL.RELEASE_LANG = DL[ "release_matrix_" + DL.VERSION_SEL_RAW ][ DL.LANG_ISO ][ 0 ];
+
// If the flag = 'y' then the language is supported, otherwise not.
if( DL.RELEASE_LANG[ 3 ] === 'y' ) {
DL.ERROR = false;
@@ -681,7 +668,7 @@ DL.checkForLinkExceptions = function() {
}
// If version is '4.1.0' (or newer) and platform is 'Mac OS X <= 10.6', show the none-availability to the user.
- if( DL.VERSION_SEL === "4.1.0" && DL.PLATFORM === "mac32" ) {
+ if( ( DL.VERSION_SEL === "4.1.2" || DL.VERSION_SEL === "4.1.1" || DL.VERSION_SEL === "4.1.0" ) && DL.PLATFORM === "mac32" ) {
// Show an error message that the chosen items do not lead to a download.
// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
@@ -801,7 +788,7 @@ DL.getLinkSelection = function() {
// Assemble the filenames and text for download and checksums.
DL.getReleaseMatrixPosition();
- DL.getFileData( DL.VERSION_SEL );
+ DL.getFileData();
DL.SF_BASE_URL = DL.SF + DL.VERSION_SEL + "/binaries/";
DL.ASF_ARC_BASE_URL = DL.ASF_ARC + DL.VERSION_SEL;
@@ -811,7 +798,7 @@ DL.getLinkSelection = function() {
DL.LINK_LP = DL.SF_BASE_URL + DL.LANG_SEL + "/" + DL.FILENAME_LP + "/download";
// Assign the checksum links: Base link + language + file name.
- DL.LINK_CHK_KEYS = "http://people.apache.org/keys/group/openoffice.asc";
+ DL.LINK_CHK_KEYS = DL.ASF_DIST + "KEYS";
DL.LINK_CHK_ASC_FULL = DL.ASF_ARC_BASE_URL + "/binaries/" + DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".asc";
DL.LINK_CHK_MD5_FULL = DL.ASF_ARC_BASE_URL + "/binaries/" + DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".md5";
DL.LINK_CHK_SHA256_FULL = DL.ASF_ARC_BASE_URL + "/binaries/" + DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".sha256";
@@ -946,7 +933,7 @@ DL.getPlatform = function() {
// For more help or data see: "http://www.useragentstring.com".
var av, os, ua, ve = "";
-
+
if( navigator.appVersion ) {
av = navigator.appVersion.toLowerCase(); // Get the application version in lower case.
}
@@ -1114,20 +1101,35 @@ DL.getPlatform = function() {
}
// Mac OS X?
- if( os.indexOf( "mac" ) !== -1 ) { DL.UI_PLATFORM = "OS X 64-bit (x86-64) (DMG)";
+ if( os.indexOf( "mac" ) !== -1 ) { DL.UI_PLATFORM = "OS X (version >= 10.7) (DMG)";
DL.PLATFORM = "mac64";
DL.EXTENSION = ".dmg";
+
// OS X: 10.6 or older?
- if( ua.indexOf( "10.6" ) !== -1 ||
- ua.indexOf( "10_6" ) !== -1 ||
- ua.indexOf( "10.5" ) !== -1 ||
- ua.indexOf( "10_5" ) !== -1 ||
- ua.indexOf( "10.4" ) !== -1 ||
- ua.indexOf( "10_4" ) !== -1 ||
- ua.indexOf( "10.3" ) !== -1 ||
- ua.indexOf( "10_3" ) !== -1 ) { DL.UI_PLATFORM = "Mac OS X (Version <= 10.6)";
+ if( ua.indexOf( " 10.6" ) !== -1 ||
+ ua.indexOf( " 10_6" ) !== -1 ||
+ ua.indexOf( " 10.5" ) !== -1 ||
+ ua.indexOf( " 10_5" ) !== -1 ||
+ ua.indexOf( " 10.4" ) !== -1 ||
+ ua.indexOf( " 10_4" ) !== -1 ||
+ ua.indexOf( " 10.3" ) !== -1 ||
+ ua.indexOf( " 10_3" ) !== -1 ) { DL.UI_PLATFORM = "OS X (version <= 10.6) (DMG)";
DL.PLATFORM = "mac32";
}
+
+ // OS X: 10.7 or newer?
+ if( ua.indexOf( " 10.11" ) !== -1 ||
+ ua.indexOf( " 10_11" ) !== -1 ||
+ ua.indexOf( " 10.10" ) !== -1 ||
+ ua.indexOf( " 10_10" ) !== -1 ||
+ ua.indexOf( " 10.9" ) !== -1 ||
+ ua.indexOf( " 10_9" ) !== -1 ||
+ ua.indexOf( " 10.8" ) !== -1 ||
+ ua.indexOf( " 10_8" ) !== -1 ||
+ ua.indexOf( " 10.7" ) !== -1 ||
+ ua.indexOf( " 10_7" ) !== -1 ) { DL.UI_PLATFORM = "OS X (version >= 10.7) (DMG)";
+ DL.PLATFORM = "mac64";
+ }
}
}
@@ -1205,85 +1207,32 @@ DL.getReleaseMatrixPosition = function()
* @param: version - The version to use to get the file data
* @return: None
*/
-DL.getFileData = function( version ) {
+DL.getFileData = function() {
// Depending on $ver, a different release matrix has to be used to assemble the download filenames.
- switch( version ) {
- case "4.1.0":
- // Assign all values from the release matrix of language and platform.
- DL.RELEASE_PLATFORM = DL.release_matrix_410[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ];
-
- // Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
- DL.FILENAME_FULL = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_FULL + "_" + DL.LANG_ISO + DL.EXTENSION;
- DL.FILENAME_LP = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_LP + "_" + DL.LANG_ISO + DL.EXTENSION;
-
- // Assign the file size (column 2) from the release matrix of language and platform.
- DL.FILESIZE_FULL = DL.release_matrix_410[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ][ 1 ];
- DL.FILESIZE_LP = DL.release_matrix_410[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_LP ][ 1 ];
-
- // Assign all values from the release data.
- DL.REL_TEXT = l10n.dl_rel_info_milestone_text + DL.release_matrix_410[ "src" ][ 1 ][ 0 ]
- + " | " + l10n.dl_rel_info_buildid_text + DL.release_matrix_410[ "src" ][ 1 ][ 1 ]
- + " | " + l10n.dl_rel_info_svn_text + DL.release_matrix_410[ "src" ][ 1 ][ 2 ]
- + " | " + l10n.dl_rel_info_rel_date_text + DL.release_matrix_410[ "src" ][ 1 ][ 3 ];
-
- // Assign the link for release notes, depending on the version.
- DL.REL_NOTES = l10n.dl_rel_notes_aoo410_link;
- break;
- case "4.0.1":
- // Assign all values from the release matrix of language and platform.
- DL.RELEASE_PLATFORM = DL.release_matrix_401[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ];
-
- // Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
- DL.FILENAME_FULL = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_FULL + "_" + DL.LANG_ISO + DL.EXTENSION;
- DL.FILENAME_LP = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_LP + "_" + DL.LANG_ISO + DL.EXTENSION;
-
- // Assign the file size (column 2) from the release matrix of language and platform.
- DL.FILESIZE_FULL = DL.release_matrix_401[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ][ 1 ];
- DL.FILESIZE_LP = DL.release_matrix_401[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_LP ][ 1 ];
-
- // Assign all values from the release data.
- DL.REL_TEXT = l10n.dl_rel_info_milestone_text + DL.release_matrix_401[ "src" ][ 1 ][ 0 ]
- + " | " + l10n.dl_rel_info_buildid_text + DL.release_matrix_401[ "src" ][ 1 ][ 1 ]
- + " | " + l10n.dl_rel_info_svn_text + DL.release_matrix_401[ "src" ][ 1 ][ 2 ]
- + " | " + l10n.dl_rel_info_rel_date_text + DL.release_matrix_401[ "src" ][ 1 ][ 3 ];
+ // Generate variable name: string + version number without dots (e.g., "412" instead of "4.1.2").
+ var release_matrix_version = "release_matrix_" + DL.VERSION_SEL_RAW;
- // Assign the link for release notes, depending on the version.
- DL.REL_NOTES = l10n.dl_rel_notes_aoo401_link;
- break;
- case "4.0.0":
- // Assign all values from the release matrix of language and platform.
- DL.RELEASE_PLATFORM = DL.release_matrix_400[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ];
-
- // Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
- DL.FILENAME_FULL = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_FULL + "_" + DL.LANG_ISO + DL.EXTENSION;
- DL.FILENAME_LP = "Apache_OpenOffice_" + version + "_" + DL.PLATFORM_LP + "_" + DL.LANG_ISO + DL.EXTENSION;
-
- // Assign the file size (column 2) from the release matrix of language and platform.
- DL.FILESIZE_FULL = DL.release_matrix_400[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ][ 1 ];
- DL.FILESIZE_LP = DL.release_matrix_400[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_LP ][ 1 ];
-
- // Assign all values from the release data.
- DL.REL_TEXT = l10n.dl_rel_info_milestone_text + DL.release_matrix_400[ "src" ][ 1 ][ 0 ]
- + " | " + l10n.dl_rel_info_buildid_text + DL.release_matrix_400[ "src" ][ 1 ][ 1 ]
- + " | " + l10n.dl_rel_info_svn_text + DL.release_matrix_400[ "src" ][ 1 ][ 2 ]
- + " | " + l10n.dl_rel_info_rel_date_text + DL.release_matrix_400[ "src" ][ 1 ][ 3 ];
+ // Assign all values from the release matrix of language and platform.
+ DL.RELEASE_PLATFORM = DL[ release_matrix_version ][ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ];
- // Assign the link for release notes, depending on the version.
- DL.REL_NOTES = l10n.dl_rel_notes_aoo400_link;
- break;
- default:
- DL.FILENAME_FULL = "";
- DL.FILENAME_LP = "";
- DL.FILESIZE_FULL = -1;
- DL.FILESIZE_LP = -1;
- DL.REL_TEXT = l10n.dl_rel_info_milestone_text + "? | "
- + l10n.dl_rel_info_buildid_text + "? | "
- + l10n.dl_rel_info_svn_text + "? | "
- + l10n.dl_rel_info_rel_date_text + "?";
- DL.REL_NOTES = "";
- DL.ERROR = true;
- }
+ // Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
+ DL.FILENAME_FULL = "Apache_OpenOffice_" + DL.VERSION_SEL + "_" + DL.PLATFORM_FULL + "_" + DL.LANG_ISO + DL.EXTENSION;
+ DL.FILENAME_LP = "Apache_OpenOffice_" + DL.VERSION_SEL + "_" + DL.PLATFORM_LP + "_" + DL.LANG_ISO + DL.EXTENSION;
+
+ // Assign the file size (column 2) from the release matrix of language and platform.
+ DL.FILESIZE_FULL = DL[ release_matrix_version ][ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ][ 1 ];
+ DL.FILESIZE_LP = DL[ release_matrix_version ][ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_LP ][ 1 ];
+
+ // Assign all values from the release data.
+ DL.REL_TEXT = l10n.dl_rel_info_milestone_text + DL[ release_matrix_version ][ "src" ][ 1 ][ 0 ]
+ + " | " + l10n.dl_rel_info_buildid_text + DL[ release_matrix_version ][ "src" ][ 1 ][ 1 ]
+ + " | " + l10n.dl_rel_info_svn_text + DL[ release_matrix_version ][ "src" ][ 1 ][ 2 ]
+ + " | " + l10n.dl_rel_info_rel_date_text + DL[ release_matrix_version ][ "src" ][ 1 ][ 3 ];
+
+ // Assign the link for release notes, depending on the version.
+ // Generate variable name: string + version number without dots (e.g., "412" instead of "4.1.2").
+ DL.REL_NOTES = l10n[ "dl_rel_notes_aoo" + DL.VERSION_SEL_RAW + "_link" ];
return;
}
@@ -1306,16 +1255,18 @@ function openItem( itemid, uri ) {
*/
DL.debug = function( location ) {
// Depending on the current position in the code, show the values for the variables as alert box.
+ // If the alert box is too large, just comment out the lines that are not needed at the moment.
// Usage:
// Call the function in the code position you want to debug.
// Example:
- // debug( "name the exact code position");
+ // DL.debug( "name the exact code position");
if( location === "" ) {
location = "No location named!";
}
alert( location + "\n"
+ + "RELEASE_MODE: " + "\t\t\t\t\t\t" + DL.RELEASE_MODE + "\n"
+ "NL_LANG: " + "\t\t\t\t\t\t\t" + DL.NL_LANG + "\n"
+ "LANG_ISO: " + "\t\t\t\t\t\t" + DL.LANG_ISO + "\n"
+ "LANG_SEL: " + "\t\t\t\t\t\t" + DL.LANG_SEL + "\n"
@@ -1332,6 +1283,7 @@ DL.debug = function( location ) {
+ "REL_TEXT: " + "\t\t\t\t\t\t\t" + DL.REL_TEXT + "\n"
+ "REL_NOTES: " + "\t\t\t\t\t\t" + DL.REL_NOTES + "\n"
+ "VERSION_SEL: " + "\t\t\t\t\t\t" + DL.VERSION_SEL + "\n"
+ + "VERSION_SEL_RAW: " + "\t\t\t\t\t" + DL.VERSION_SEL_RAW + "\n"
+ "FILENAME_FULL: " + "\t\t\t\t\t" + DL.FILENAME_FULL + "\n"
+ "FILENAME_LP: " + "\t\t\t\t\t\t" + DL.FILENAME_LP + "\n"
+ "FILESIZE_FULL: " + "\t\t\t\t\t\t" + DL.FILESIZE_FULL + "\n"