Author: buildbot Date: Tue Sep 23 18:51:22 2014 New Revision: 923281 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 Tue Sep 23 18:51:22 2014 @@ -1 +1 @@ -1627084 +1627114 Propchange: websites/staging/ooo-site/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Tue Sep 23 18:51:22 2014 @@ -1 +1 @@ -1627084 +1627114 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 Tue Sep 23 18:51:22 2014 @@ -1,6 +1,6 @@ /* - * Overview of all methods (functions) defined below of the global object "DL" - * --------------------------------------------------------------------------- + * Overview of all methods (functions) of the global object "DL" + * ------------------------------------------------------------- * function DL.init ( release_mode ) * function DL.initVariables ( init_all ) * function DL.getLanguage () @@ -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.1" ) { - 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., "411" instead of "4.1.1"). + DL.VERSION_SEL_RAW = DL.VERSION_SEL.replace( /\./g,'' ); + return DL.VERSION_SEL; } @@ -597,25 +588,16 @@ DL.isLanguageSupported = function() { DL.VERSION_SEL = DL.VERSION; } - // Get the release matrix depending on the version. - switch( DL.VERSION_SEL ) { - case "4.1.1": - DL.RELEASE_LANG = DL.release_matrix_411[ DL.LANG_ISO ][ 0 ]; - break; - 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., "411" instead of "4.1.1"). + 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; @@ -804,7 +786,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; @@ -1208,107 +1190,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.1": - // Assign all values from the release matrix of language and platform. - DL.RELEASE_PLATFORM = DL.release_matrix_411[ 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_411[ DL.LANG_ISO ][ DL.RELEASE_PLATFORM_POS_FULL ][ 1 ]; - DL.FILESIZE_LP = DL.release_matrix_411[ 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_411[ "src" ][ 1 ][ 0 ] - + " | " + l10n.dl_rel_info_buildid_text + DL.release_matrix_411[ "src" ][ 1 ][ 1 ] - + " | " + l10n.dl_rel_info_svn_text + DL.release_matrix_411[ "src" ][ 1 ][ 2 ] - + " | " + l10n.dl_rel_info_rel_date_text + DL.release_matrix_411[ "src" ][ 1 ][ 3 ]; - - // Assign the link for release notes, depending on the version. - DL.REL_NOTES = l10n.dl_rel_notes_aoo411_link; - break; - - 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., "411" instead of "4.1.1"). + 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., "411" instead of "4.1.1"). + DL.REL_NOTES = l10n[ "dl_rel_notes_aoo" + DL.VERSION_SEL_RAW + "_link" ]; return; } @@ -1331,16 +1238,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" @@ -1357,6 +1266,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"