Author: marcus Date: Fri May 2 22:13:10 2014 New Revision: 1592064 URL: http://svn.apache.org/r1592064 Log: Updates
Modified: openoffice/ooo-site/trunk/content/download/test/download_droplist.js Modified: openoffice/ooo-site/trunk/content/download/test/download_droplist.js URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download_droplist.js?rev=1592064&r1=1592063&r2=1592064&view=diff ============================================================================== --- openoffice/ooo-site/trunk/content/download/test/download_droplist.js (original) +++ openoffice/ooo-site/trunk/content/download/test/download_droplist.js Fri May 2 22:13:10 2014 @@ -1,23 +1,42 @@ /* * Overview of all functions defined below * --------------------------------------- + * function init () * function initVars () + * function alertDbg ( function_name ) * function getLanguage () - * function fillSelOS () - * function fillSelLang () - * function getSelOS () - * function getSelLang () + * function fillOSSel () + * function fillLangSel () + * function fillVerSel () + * function getOSSel () + * function getLangSel () + * function getVerSel () * function resetSel () - * function hasMirrorLink ( rel_mode ) + * function showPopup ( target_url ) + * function hasMirrorLink () * function getLink ( rel_mode ) - * function getLinkAlt ( rel_mode ) - * function getPlatform ( rel_mode ) - * function getFilesize ( rel_mode ) + * function getLinkSel () + * function getPlatform () + * function getFilename ( ver ) + * function getFilesize () * function openItem ( itemid, uri ) */ /* - * Define global variables + * Init function + */ +function init() { + // Fill the OS, language and version drop-down box. + fillOSSel() + fillLangSel(); + fillVerSel(); + + // Set global variables. + initVars(); +} + +/* + * Define all global variables */ function initVars() { // Define variables without "var" to make them globally available @@ -30,6 +49,7 @@ function initVars() { RELEASE_MATRIX_PLATFORM_POS_FULL = 0; // The position of the platform in the release matrix array RELEASE_MATRIX_PLATFORM_POS_LP = 0; // The position of the platform in the release matrix array RELEASE_MATRIX_PLATFORM = ""; // The platform in the release matrix array + RELEASE_MATRIX_LANG = ""; // The language specific data depending on LANG_ISO VERSION_ALT = ""; // The selected version from drop-down-box FILENAME_FULL = ""; // The complete filename of the download URL (for full installation) FILENAME_LP = ""; // The complete filename of the download URL (for language pack) @@ -60,36 +80,47 @@ function alertDbg( function_name ) { alert ( "" + function_name + "\n" + "LANG_ISO: " + "\t\t\t\t\t" + LANG_ISO + "\n" + + "LANG_ARRAY: " + "\t\t\t\t\t" + LANG_ARRAY + "\n" + + "RELEASE_MATRIX_PLATFORM_POS_FULL: " + "\t" + RELEASE_MATRIX_PLATFORM_POS_FULL + "\n" + + "RELEASE_MATRIX_PLATFORM_POS_LP: " + "\t" + RELEASE_MATRIX_PLATFORM_POS_LP + "\n" + + "RELEASE_MATRIX_PLATFORM: " + "\t\t" + RELEASE_MATRIX_PLATFORM + "\n" + + "RELEASE_MATRIX_LANG: " + "\t\t\t" + RELEASE_MATRIX_LANG + "\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" + OLD_PLATFORM + "\n" + "VERSION_ALT: " + "\t\t\t\t\t" + VERSION_ALT + "\n" - + "EXTENSION: " + "\t\t\t\t\t" + EXTENSION + "\n" - + "RELEASE_MATRIX_PLATFORM_POS_FULL: " + "\t" + RELEASE_MATRIX_PLATFORM_POS_FULL + "\n" - + "RELEASE_MATRIX_PLATFORM_POS_LP: " + "\t" + RELEASE_MATRIX_PLATFORM_POS_LP + "\n" - + "RELEASE_MATRIX_PLATFORM: " + "\t\t\t" + RELEASE_MATRIX_PLATFORM + "\n" + "FILENAME_FULL: " + "\t\t\t\t" + FILENAME_FULL + "\n" + "FILENAME_LP: " + "\t\t\t\t\t" + FILENAME_LP + "\n" + "FILESIZE_FULL: " + "\t\t\t\t\t" + FILESIZE_FULL + "\n" + "FILESIZE_LP: " + "\t\t\t\t\t" + FILESIZE_LP + "\n" + + "EXTENSION: " + "\t\t\t\t\t" + EXTENSION + "\n" +// + "TYPE: " + "\t\t\t\t\t\t" + TYPE + "\n" + "BASE_URL: " + "\t\t\t\t\t" + SOURCEFORGE_BASE_URL + "\n" + "LINK: " + "\t\t\t\t\t\t" + LINK + "\n" + "LINK_FULL: " + "\t\t\t\t\t" + LINK_FULL + "\n" + "LINK_LP: " + "\t\t\t\t\t\t" + LINK_LP + "\n" + + "CHECKSUM_ASC_FULL: " + "\t\t\t\t" + CHECKSUM_ASC_FULL + "\n" + + "CHECKSUM_MD5_FULL: " + "\t\t\t\t" + CHECKSUM_MD5_FULL + "\n" + + "CHECKSUM_SHA256_FULL: " + "\t\t\t\t" + CHECKSUM_SHA256_FULL + "\n" + + "CHECKSUM_ASC_LP: " + "\t\t\t\t" + CHECKSUM_ASC_LP + "\n" + + "CHECKSUM_MD5_LP: " + "\t\t\t\t" + CHECKSUM_MD5_LP + "\n" + + "CHECKSUM_SHA256_LP: " + "\t\t\t\t" + CHECKSUM_SHA256_LP + "\n" + + "SOURCEFORGE: " + "\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 array-list and $NL_LANGUAGE + * Depends on $NL_LANGUAGE and array-list */ function getLanguage() { var language = ""; if ( NL_LANGUAGE != "" ) language = NL_LANGUAGE; - else if ( LANG_ISO != "" ) - language = LANG_ISO; else if ( navigator.language ) language = navigator.language; else if ( navigator.userLanguage ) @@ -129,7 +160,7 @@ function getLanguage() { // If an additional region code was found if ( thisLanguageSet[ regionCode ] != null ) { - // Then choose langCode-regionCode + // Choose langCode-regionCode language = languageCode + "-" + regionCode.toUpperCase(); thisLanguage = thisLanguageSet[ regionCode ]; } else { @@ -150,84 +181,98 @@ function getLanguage() { thisLanguage = thisLanguageSet[ "-" ]; } - LANG_ISO = language; - LANG_ARRAY = thisLanguage; + LANG_ISO = language; + LANG_ARRAY = thisLanguage; + + var thisReleaseMatrixSet = release_matrix_410[ LANG_ISO ]; + RELEASE_MATRIX_LANG = thisReleaseMatrixSet[ 0 ]; + + return LANG_ISO; } /* * Set values into the <select> element for OS (drop-down-box) - * Depends on array-lists + * Depends on array-list */ -function fillSelOS() { +function fillOSSel() { var sel_os = document.getElementById( "os" ); var i = 0; var option = ""; - for( i = 0; i < SEL_OS.length; i = i + 4 ) { // fill the <select> element until all OS's are used + // Fill the <select> element until all OS's are used. + for( i = 0; i < SEL_OS.length; i = i + 4 ) { option = document.createElement( "option" ); - option.value = SEL_OS[ i ]; // assign the OS abbreviation - option.text = SEL_OS[ i + 1 ]; // assign the UI name + // Assign the OS abbreviation as index value. + option.value = SEL_OS[ i ]; + // Assign the UI name. + option.text = SEL_OS[ i + 1 ]; sel_os.appendChild( option ); } - sel_os.selectedIndex = 0; // set the first option as default - - // Fill the next drop-down box - fillSelLang(); + // Set the first option as default. + sel_os.selectedIndex = 0; return; } /* * Set values into the <select> element for language (drop-down-box) - * Depends on array-lists + * Depends on array-list */ -function fillSelLang() { +function fillLangSel() { var sel_lang = document.getElementById( "lang" ); var i = 0; var option = ""; - for( i = 0; i < SEL_LANG.length; i = i + 2 ) { // fill the <select> element until all languages are used + // Fill the <select> element until all languages are used. + for( i = 0; i < SEL_LANG.length; i = i + 2 ) { option = document.createElement( "option" ); - option.value = SEL_LANG[ i ]; // assign the language ISO code - option.text = SEL_LANG[ i + 1 ]; // assign the UI name like "English (Native) (ISO code)" + // Assign the language ISO code as index value. + option.value = SEL_LANG[ i ]; + // Assign the UI name like "English (Native) (ISO code)". + option.text = SEL_LANG[ i + 1 ]; sel_lang.appendChild( option ); } - sel_lang.selectedIndex = 0; // set the first option as default + // Set the first option as default. + sel_lang.selectedIndex = 0; /* alert( languages[0]["ast"] + " " + SEL_LANG.length ); - for( i = 0; i < SEL_LANG.length; i = i + 2 ) { // fill the <select> element until all languages are used + // Fill the <select> element until all languages are used. + for( i = 0; i < SEL_LANG.length; i = i + 2 ) { option = document.createElement( "option" ); - option.value = languages[ i ]; // assign the language ISO code - option.text = languages[ i + 1 ] + " (" + languages[ i + 2 ] + ")"; // assign the UI name like "English (Native)" + // Assign the language ISO code as index value. + option.value = languages[ i ]; + // Assign the UI name like "English (Native)". + option.text = languages[ i + 1 ] + " (" + languages[ i + 2 ] + ")"; sel_lang.appendChild( option ); } - sel_lang.selectedIndex = 0; // set the first option as default + // Set the first option as default. + sel_lang.selectedIndex = 0; */ - - // Fill the next drop-down box -// fillSelVer(); - return; } /* * Set values into the <select> element for version (drop-down-box) - * Depends on array-lists + * Depends on array-list */ -function fillSelVer() { +function fillVerSel() { var sel_ver = document.getElementById( "ver" ); var i = 0; var option = ""; - for( i = 0; i < SEL_VER.length; i = i + 2 ) { // fill the <select> element until all versions are used + // Fill the <select> element until all versions are used. + for( i = 0; i < SEL_VER.length; i = i + 2 ) { option = document.createElement( "option" ); - option.value = SEL_VER[ i ]; // assign the version - option.text = SEL_VER[ i + 1 ]; // assign the UI version + // Assign the version as index value. + option.value = SEL_VER[ i ]; + // Assign the UI version. + option.text = SEL_VER[ i + 1 ]; sel_ver.appendChild( option ); } - sel_ver.selectedIndex = 0; // set the first option as default + // Set the first option as default. + sel_ver.selectedIndex = 0; return; } @@ -236,23 +281,24 @@ function fillSelVer() { * Get values from the <select> element for OS (drop-down-box) * Depends on chosen OS */ -function getSelOS() { +function getOSSel() { var os_value = document.download.os.options[document.download.os.selectedIndex].value; var i = 0; + // If one of the first 2 <select> elements was chosen, let the user chose again. if ( os_value == "e1" || os_value == "e2" ) { UI_PLATFORM = ""; URL_PLATFORM = ""; EXTENSION = ""; return; } - + // Search through the <select> element until the chosen OS is found. for( i = 0; i < SEL_OS.length; i = i + 4 ) { if ( SEL_OS[ i ] == os_value ) { - UI_PLATFORM = SEL_OS[ i + 1 ]; - URL_PLATFORM = SEL_OS[ i + 2 ]; - EXTENSION = SEL_OS[ i + 3 ]; - break; + UI_PLATFORM = SEL_OS[ i + 1 ]; + URL_PLATFORM = SEL_OS[ i + 2 ]; + EXTENSION = SEL_OS[ i + 3 ]; + break; } } @@ -263,14 +309,16 @@ function getSelOS() { * Get values from the <select> element for language (drop-down-box) * Depends on chosen language */ -function getSelLang() { +function getLangSel() { var lang_value = document.download.lang.options[document.download.lang.selectedIndex].value; var i = 0; + // If one of the first 2 <select> elements was chosen, let the user chose again. if ( lang_value == "e1" || lang_value == "e2" ) { LANG_ISO = ""; return; } + // Search through the <select> element until the chosen language is found. for( i = 0; i < SEL_LANG.length; i = i + 2 ) { if ( SEL_LANG[ i ] == lang_value ) { LANG_ISO = lang_value; @@ -285,14 +333,16 @@ function getSelLang() { * Get values from the <select> element for version (drop-down-box) * Depends on chosen version */ -function getSelVer() { +function getVerSel() { var ver_value = document.download.ver.options[document.download.ver.selectedIndex].value; var i = 0; + // If one of the first 2 <select> elements was chosen, let the user chose again. if ( ver_value == "e1" || ver_value == "e2" ) { VERSION_ALT = ""; return; } + // Search through the <select> element until the chosen version is found. for( i = 0; i < SEL_VER.length; i = i + 2 ) { if ( SEL_VER[ i ] == ver_value ) { VERSION_ALT = ver_value; @@ -307,17 +357,17 @@ function getSelVer() { * Get values from the <select> element for type (drop-down-box) * Depends on chosen type */ -function getSelType() { +function getTypeSel() { var type_value = document.download.type.options[document.download.type.selectedIndex].value; switch ( type_value ) { case "full": - // If install type == 'install', then exchange it in the 'URL_PLATFORM' variable + // If install type == 'install', then exchange it in the 'URL_PLATFORM' variable. TYPE = "install"; URL_PLATFORM = URL_PLATFORM.replace(/langpack/g, TYPE); break; case "lp": - // If install type == 'langpack', then exchange it in the 'URL_PLATFORM' variable + // If install type == 'langpack', then exchange it in the 'URL_PLATFORM' variable. TYPE = "langpack"; URL_PLATFORM = URL_PLATFORM.replace(/install/g, TYPE); break; @@ -334,97 +384,97 @@ function getSelType() { function resetSel() { var elements = document.getElementsByTagName( "select" ); + // Set the first option as default for all <select> elements. for ( var i = 0; i < elements.length; i++ ) { elements[i].selectedIndex = 0; } - document.getElementById( "dl_full_link" ).href = "#"; + // Set the text and URLs beow the <selects> elements- + document.getElementById( "dl_full_link" ).href = ""; document.getElementById( "dl_full_link" ).text = ""; document.getElementById( "dl_full_link" ).title = ""; document.getElementById( "dl_lp_link" ).href = ""; document.getElementById( "dl_lp_link" ).text = ""; document.getElementById( "dl_lp_link" ).title = ""; document.getElementById( "dl_help" ).href = ""; - document.getElementById( "dl_help" ).text = ""; document.getElementById( "dl_help" ).title = ""; -/* document.getElementById( "dl_full_chk_headline" ).text = ""; + document.getElementById( "dl_help_img" ).src = ""; + document.getElementById( "dl_help_img" ).alt = ""; + document.getElementById( "dl_help_img" ).text = ""; + document.getElementById( "dl_help_img" ).title = ""; + document.getElementById( "dl_rel_data" ).text = ""; + document.getElementById( "dl_rel_data" ).title = ""; + document.getElementById( "dl_full_hl" ).text = "Full installation: "; + document.getElementById( "dl_full_size_hl" ).text = ""; + document.getElementById( "dl_full_size" ).text = ""; document.getElementById( "space1" ).text = ""; - document.getElementById( "space2" ).text = ""; - document.getElementById( "space3" ).text = ""; - document.getElementById( "space4" ).text = ""; - document.getElementById( "space5" ).text = ""; - document.getElementById( "space6" ).text = ""; - document.getElementById( "space7" ).text = ""; + document.getElementById( "dl_full_chk_hl" ).text = "Signatures and hashes: "; document.getElementById( "dl_full_chk_keys" ).href = ""; document.getElementById( "dl_full_chk_keys" ).text = ""; document.getElementById( "dl_full_chk_keys" ).title = ""; + document.getElementById( "space2" ).text = ""; document.getElementById( "dl_full_chk_asc" ).href = ""; document.getElementById( "dl_full_chk_asc" ).text = ""; document.getElementById( "dl_full_chk_asc" ).title = ""; + document.getElementById( "space3" ).text = ""; document.getElementById( "dl_full_chk_md5" ).href = ""; document.getElementById( "dl_full_chk_md5" ).text = ""; document.getElementById( "dl_full_chk_md5" ).title = ""; + document.getElementById( "space4" ).text = ""; document.getElementById( "dl_full_chk_sha256" ).href = ""; document.getElementById( "dl_full_chk_sha256" ).text = ""; document.getElementById( "dl_full_chk_sha256" ).title = ""; - document.getElementById( "dl_lp_chk_headline" ).text = ""; + document.getElementById( "space5" ).text = ""; + document.getElementById( "dl_chk_verify" ).href = ""; + document.getElementById( "dl_chk_verify" ).text = ""; + document.getElementById( "dl_chk_verify" ).title = ""; + document.getElementById( "dl_lp_hl" ).text = "Language pack: "; + document.getElementById( "dl_lp_size_hl" ).text = ""; + document.getElementById( "dl_lp_size" ).text = ""; + document.getElementById( "space6" ).text = ""; + document.getElementById( "dl_lp_chk_hl" ).text = "Signatures and hashes: "; document.getElementById( "dl_lp_chk_keys" ).href = ""; document.getElementById( "dl_lp_chk_keys" ).text = ""; document.getElementById( "dl_lp_chk_keys" ).title = ""; + document.getElementById( "space7" ).text = ""; document.getElementById( "dl_lp_chk_asc" ).href = ""; document.getElementById( "dl_lp_chk_asc" ).text = ""; document.getElementById( "dl_lp_chk_asc" ).title = ""; + document.getElementById( "space8" ).text = ""; document.getElementById( "dl_lp_chk_md5" ).href = ""; document.getElementById( "dl_lp_chk_md5" ).text = ""; document.getElementById( "dl_lp_chk_md5" ).title = ""; + document.getElementById( "space9" ).text = ""; document.getElementById( "dl_lp_chk_sha256" ).href = ""; document.getElementById( "dl_lp_chk_sha256" ).text = ""; document.getElementById( "dl_lp_chk_sha256" ).title = ""; - document.getElementById( "dl_chk_verify" ).href = ""; - document.getElementById( "dl_chk_verify" ).text = ""; - document.getElementById( "dl_chk_verify" ).title = ""; -*/ } /* - * Get flag for mirror link - * Depends on array-list + * Open a popup window + * Depends on received target link */ -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; - } - } +function showPopup( target_url ) { + // Open a popup window to show the file from the "target_url". + popupWindow = window.open( target_url, "", "location=no", "width=600, height=500, left=100, top=200"); + popupWindow.focus(); +} + /* - if ( LANG_ARRAY[ 3 ] == 'y' ) + * Get flag for mirror link + * Depends on array-list and "languages.js" + * Depends on array-list and "release_matrix.js" + */ +function hasMirrorLink() { + // Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage. + // Check the flag in "release_matrix.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage. +// if ( LANG_ARRAY[ 3 ] == 'y' ) { + if ( RELEASE_MATRIX_LANG[ 1 ] == 'y' ) { return true; - else + } else { ERROR = true; return false; -*/ + } } /* @@ -432,221 +482,129 @@ function hasMirrorLink( rel_mode ) { * Depends on array-list */ function getLink( rel_mode ) { - var chk_link_full = ""; - - // reset all global variables + // Reset all global variables. initVars(); - // If no release mode was given, assume it's about the stable release + // If no release mode was given, assume it is about the stable release. if ( rel_mode == undefined ) rel_mode = 1; getLanguage(); - getPlatform( rel_mode ); - if ( hasMirrorLink( rel_mode ) ) { - getFilesize( rel_mode ); - } - /* - if ( NL_LANGUAGE == "" ) - NL_LANGUAGE = LANG_ISO; - */ - /* - Trim timestamp from version, required for RC - if ( version.indexOf( "_" ) > -1 ) - version = version.split( "_" )[0]; - */ - - // If language is supported, then provide a download link. - if ( hasMirrorLink( rel_mode ) ) { - // Release mode - if ( rel_mode == 1 ) { - // If platform is too old, then provide a general download link to the archive. - if ( OLD_PLATFORM ) { - // If platform is Mac OS X <=10.6, then provide a download link with previous AOO version. -/* - if ( UI_PLATFORM == "Mac OS X (10.6 or older)" ) { - - FILENAME_FULL = "Apache_OpenOffice_" + PRE_VERSION + "_" + URL_PLATFORM; - FILENAME_FULL = FILENAME_FULL + "_" + LANG_ISO + EXTENSION; - LINK_FULL = SOURCEFORGE_PREVIOUS_URL + LANG_ISO + "/" + FILENAME_FULL; - LINK_FULL = LINK_FULL + "/download"; - - chk_link_full = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - chk_link_full = chk_link_full + FILENAME_FULL; - - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = chk_link_full + ".asc"; - CHECKSUM_MD5_FULL = chk_link_full + ".md5"; - CHECKSUM_SHA256_FULL = chk_link_full + ".sha256"; - - SOURCEFORGE = false; - OTHER = false; - ARCHIVE = true; - ERROR = true; - return LINK_FULL; - } -*/ - // If platform is Solaris, FreeBSD or OS/2, - // then provide a download link to the porting webpage. - if ( UI_PLATFORM == "Solaris x86 (PKG)" || - UI_PLATFORM == "Solaris SPARC (PKG)" || - UI_PLATFORM == "FreeBSD (PKG)" || - UI_PLATFORM == "OS/2" ) { - - LINK_FULL = "http://www.openoffice.org/porting/index.html"; - - SOURCEFORGE = false; - OTHER = true; - ARCHIVE = false; - ERROR = true; - return LINK_FULL; - } + getPlatform(); + if ( hasMirrorLink() ) { + getFilesize(); + } - LINK_FULL = "http://archive.apache.org/dist/openoffice/"; + // If language is supported, provide a download link. + if ( hasMirrorLink() ) { + // If platform is too old, provide a general download link to the archive. + if ( OLD_PLATFORM ) { + // If platform is 'Mac OS X <= 10.6', provide a download link with previous AOO version. + if ( UI_PLATFORM == "Mac OS X (10.6 or older)" ) { + LINK_FULL = SOURCEFORGE_PREVIOUS_URL + LANG_ISO + "/" + getFilename( PRE_VERSION ) + "/download"; CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = "http://archive.apache.org/dist/openoffice/"; - CHECKSUM_MD5_FULL = "http://archive.apache.org/dist/openoffice/"; - CHECKSUM_SHA256_FULL = "http://archive.apache.org/dist/openoffice/"; + CHECKSUM_ASC_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + getFilename( PRE_VERSION ) + ".asc"; + CHECKSUM_MD5_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + getFilename( PRE_VERSION ) + ".md5"; + CHECKSUM_SHA256_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + getFilename( PRE_VERSION ) + ".sha256"; - SOURCEFORGE = false; - OTHER = true; - ARCHIVE = false; - ERROR = true; - return LINK_FULL; - } - // If no platform was recognized, then provide a general download link to the "other.html" webpage. - if ( URL_PLATFORM == "" ) { - // If no UI string was set, then show it to the user. - if ( UI_PLATFORM == "" ) { - UI_PLATFORM = "unknown platform/OS"; - } - - LINK_FULL = "http://www.openoffice.org/download/other.html"; SOURCEFORGE = false; - OTHER = true; - ARCHIVE = false; + OTHER = false; + ARCHIVE = true; ERROR = true; return LINK_FULL; - } - - // If platform was recognized, assemble the filenames for download and checksums - // FILENAME_FULL = "Apache_OpenOffice_" + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO; - // FILENAME_FULL = FILENAME_FULL + EXTENSION; + // If platform is Solaris, FreeBSD or OS/2, provide a download link to the porting webpage. + } else if ( UI_PLATFORM == "Solaris x86 (PKG)" || + UI_PLATFORM == "Solaris SPARC (PKG)" || + UI_PLATFORM == "FreeBSD (PKG)" || + UI_PLATFORM == "OS/2" ) { - // Assign the file name (column 3) from the release matrix of language and platform - FILENAME_FULL = release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 3 ]; + LINK_FULL = "http://www.openoffice.org/porting/index.html"; - // LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/Apache_OpenOffice_" + VERSION + "_"; - // LINK_FULL = LINK_FULL + URL_PLATFORM + "_" + LANG_ISO + EXTENSION + "/download"; - LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + FILENAME_FULL + "/download"; + SOURCEFORGE = false; + OTHER = true; + ARCHIVE = false; + ERROR = true; - // chk_link = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/Apache_OpenOffice_"; - // chk_link = chk_link + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO + EXTENSION; - chk_link_full = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_FULL; + return LINK_FULL; - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = chk_link_full + ".asc"; - CHECKSUM_MD5_FULL = chk_link_full + ".md5"; - CHECKSUM_SHA256_FULL = chk_link_full + ".sha256"; - - /* - // Used for debugging - LINK_FULL = PEOPLE_BASE_URL + "/binaries/" + LANG_ISO + "/Apache_OpenOffice_"; - LINK_FULL = LINK_FULL + "/Apache_OpenOffice_" + "_" + LANG_ISO + EXTENSION; - chk_link = PEOPLE_BASE_URL + "/binaries/" + LANG_ISO + "/Apache_OpenOffice_"; - chk_link = chk_link + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO + EXTENSION; - */ + // All other cases for old platforms. + } else { + LINK_FULL = "http://archive.apache.org/dist/openoffice/"; - SOURCEFORGE = true; - OTHER = false; - ARCHIVE = false; - ERROR = false; - return LINK_FULL; - } else { - // Beta release mode - // If platform is too old, then provide a general download link to the archive. - if ( OLD_PLATFORM ) { - // If platform is Mac OS X <=10.6, then provide a download link with previous AOO version. - if ( UI_PLATFORM == "Mac OS X (10.6 or older)" ) { - - FILENAME_FULL = "Apache_OpenOffice_" + PRE_VERSION + "_" + URL_PLATFORM; - FILENAME_FULL = FILENAME_FULL + "_" + LANG_ISO + EXTENSION; - LINK_FULL = SOURCEFORGE_PREVIOUS_URL + LANG_ISO + "/" + FILENAME_FULL; - LINK_FULL = LINK_FULL + "/download"; - - chk_link_full = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - chk_link_full = chk_link_full + FILENAME_FULL; - - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = chk_link_full + ".asc"; - CHECKSUM_MD5_FULL = chk_link_full + ".md5"; - CHECKSUM_SHA256_FULL = chk_link_full + ".sha256"; - - SOURCEFORGE = false; - OTHER = false; - ARCHIVE = true; - ERROR = true; - return LINK_FULL; - } + CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; + CHECKSUM_ASC_FULL = "http://archive.apache.org/dist/openoffice/"; + CHECKSUM_MD5_FULL = "http://archive.apache.org/dist/openoffice/"; + CHECKSUM_SHA256_FULL = "http://archive.apache.org/dist/openoffice/"; - LINK_FULL = "http://www.openoffice.org/download/all_beta.html"; SOURCEFORGE = false; OTHER = true; ARCHIVE = false; ERROR = true; return LINK_FULL; } - // Assign the file name (column 3) from the release matrix of language and platform - FILENAME_FULL = release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 3 ]; - // LINK_FULL = BETA_SOURCEFORGE_BASE_URL + LANG_ISO + "/Apache_OpenOffice_Beta_"; - // LINK_FULL = LINK_FULL + VERSION + "_" + URL_PLATFORM + "_" + LANG_ISO + EXTENSION; - // LINK_FULL = LINK_FULL + "/download"; - LINK_FULL = BETA_SOURCEFORGE_BASE_URL + LANG_ISO + "/" + FILENAME_FULL + "/download"; - - // chk_link = BETA_APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO; - // chk_link = chk_link + "/Apache_OpenOffice_Beta_" + VERSION + "_" + URL_PLATFORM + "_"; - // chk_link = chk_link + LANG_ISO + EXTENSION; - chk_link_full = BETA_APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_FULL; + // If language is supported but no platform was recognized, provide a general download link + // to the "other.html" webpage. + } else if ( URL_PLATFORM == "" ) { + // If no UI string was set, show it to the user. + if ( UI_PLATFORM == "" ) { + UI_PLATFORM = "unknown platform/OS"; + } + LINK_FULL = "http://www.openoffice.org/download/other.html"; - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = chk_link_full + ".asc"; - CHECKSUM_MD5_FULL = chk_link_full + ".md5"; - CHECKSUM_SHA256_FULL = chk_link_full + ".sha256"; + SOURCEFORGE = false; + OTHER = true; + ARCHIVE = false; + ERROR = true; + + return LINK_FULL; } + // If language is supported and platform was recognized, assemble the filenames for download and checksums. + LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + getFilename( VERSION ) + "/download"; + + CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; + CHECKSUM_ASC_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ) + ".asc"; + CHECKSUM_MD5_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ) + ".md5"; + CHECKSUM_SHA256_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ) + ".sha256"; + SOURCEFORGE = true; OTHER = false; ARCHIVE = false; ERROR = false; - return LINK_FULL; + + return LINK_FULL; } else { - // Release mode + // If language is not supported, provide an alternative download link. if ( rel_mode == 1 ) { - // If language is not supported, then provide the link from the Native Language (NL) group. - LINK_FULL = LANG_ARRAY[ 4 ]; + // Release mode + // Provide the link from the Native Language (NL) group. +// LINK_FULL = LANG_ARRAY[ 4 ]; + LINK_FULL = "http://www.openoffice.org/" + RELEASE_MATRIX_LANG[ 3 ]; } else { // Beta release mode - // If language is not supported, then provide the "all_beta.html" as download link. + // Provide the "all_beta.html" as download link. LINK_FULL = "http://www.openoffice.org/download/all_beta.html"; } - - ERROR = true; - return LINK_FULL; + SOURCEFORGE = false; + OTHER = true; + ARCHIVE = false; + ERROR = true; } + + return LINK_FULL; } /* * Get link to mirror system for download file and checksum file * Depends on chosen OS, language and type */ -function getLinkAlt( rel_mode ) { - var chk_link_full = ""; - var chk_link_lp = ""; +function getLinkSel( rel_mode ) { + var a, b, c, d = ""; - // Delete any previously set string + // Delete any previously set strings CHECKSUM_ASC_FULL = ""; CHECKSUM_MD5_FULL = ""; CHECKSUM_SHA256_FULL = ""; @@ -654,62 +612,44 @@ function getLinkAlt( rel_mode ) { // reset all global variables initVars(); - getSelOS(); - getSelLang(); -// getSelVer(); + // If no release mode was given, assume it is about the stable release. + if ( rel_mode == undefined ) + rel_mode = 1; - alertDbg( "getLinkAlt()" ); + getOSSel(); + getLangSel(); + getVerSel(); - if ( URL_PLATFORM == "" || LANG_ISO == "" ) { +// if ( URL_PLATFORM == "" || LANG_ISO == "" ) { + if ( URL_PLATFORM == "" || LANG_ISO == "" || VERSION_ALT == "" ) { // When OS or language was not chosen, let the user choose again. - -// if ( URL_PLATFORM == "" || LANG_ISO == "" || VERSION_ALT == "" ) { // When OS, language or version was not chosen, let the user choose again. -/* - resetSel(); - document.getElementById( "dl_full_link" ).href = "#"; - document.getElementById( "dl_full_link" ).text = "Please first choose an OS"; - document.getElementById( "dl_full_link" ).title = "Please first choose an OS"; -*/ +// resetSel(); + return; } - getLanguage(); - getFilesize( rel_mode ); + getFilesize(); + getFilename( VERSION ); -// if ( URL_PLATFORM != "" && LANG_ISO != "" && TYPE != "" ) { - if ( URL_PLATFORM != "" && LANG_ISO != "" ) { +// if ( URL_PLATFORM != "" && LANG_ISO != "" ) { + if ( URL_PLATFORM != "" && LANG_ISO != "" && VERSION_ALT != "" ) { - if ( LANG_ISO != "" && RELEASE_MATRIX_PLATFORM_POS_FULL > 0 ) { - // If platform was recognized, assemble the filenames for download and checksums. + if ( LANG_ISO != "" && RELEASE_MATRIX_PLATFORM_POS_FULL > -1 ) { + // If language and platform are recognized, assemble the filenames for download and checksums. // Assign the file name (column 3) from the release matrix of language and platform. - FILENAME_FULL = release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 3 ]; - FILENAME_LP = release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 3 ]; LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + FILENAME_FULL + "/download"; LINK_LP = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + FILENAME_LP + "/download"; - /* - // Used for debugging - LINK_FULL = PEOPLE_BASE_URL + "/binaries/" + LANG_ISO + "/Apache_OpenOffice_"; - LINK_FULL = LINK_FULL + "/Apache_OpenOffice_" + "_" + LANG_ISO + EXTENSION; - */ - - chk_link_full = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - chk_link_full = chk_link_full + FILENAME_FULL; - - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_FULL = chk_link_full + ".asc"; - CHECKSUM_MD5_FULL = chk_link_full + ".md5"; - CHECKSUM_SHA256_FULL = chk_link_full + ".sha256"; - - chk_link_lp = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - chk_link_lp = chk_link_lp + FILENAME_LP; - CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - CHECKSUM_ASC_LP = chk_link_lp + ".asc"; - CHECKSUM_MD5_LP = chk_link_lp + ".md5"; - CHECKSUM_SHA256_LP = chk_link_lp + ".sha256"; + CHECKSUM_ASC_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_FULL + ".asc"; + CHECKSUM_MD5_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_FULL + ".md5"; + CHECKSUM_SHA256_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_FULL + ".sha256"; + + CHECKSUM_ASC_LP = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_LP + ".asc"; + CHECKSUM_MD5_LP = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_LP + ".md5"; + CHECKSUM_SHA256_LP = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/" + FILENAME_LP + ".sha256"; SOURCEFORGE = true; OTHER = false; @@ -717,52 +657,70 @@ function getLinkAlt( rel_mode ) { ERROR = false; } + a = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: " + REL_DATE; + b = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: " + REL_DATE; + c = FILESIZE_FULL + " MByte"; + d = FILESIZE_LP + " MByte"; + document.getElementById( "dl_full_link" ).href = LINK_FULL; document.getElementById( "dl_full_link" ).text = "Download full install"; document.getElementById( "dl_full_link" ).title = LINK_FULL; document.getElementById( "dl_lp_link" ).href = LINK_LP; document.getElementById( "dl_lp_link" ).text = "Download language pack"; document.getElementById( "dl_lp_link" ).title = LINK_LP; - document.getElementById( "dl_help" ).href = "http://www.openoffice.org/download/other.html#aoo"; - document.getElementById( "dl_help" ).text = "What is the difference?"; - document.getElementById( "dl_help" ).title = "What is the difference?"; -/* document.getElementById( "dl_full_chk_headline" ).text = "Signatures and hashes for full installation : "; - document.getElementById( "space1" ).text = " , "; - document.getElementById( "space2" ).text = " , "; - document.getElementById( "space3" ).text = " , "; - document.getElementById( "space4" ).text = " , "; - document.getElementById( "space5" ).text = " , "; - document.getElementById( "space6" ).text = " , "; - document.getElementById( "space7" ).text = " , "; + document.getElementById( "dl_help" ).href = "full_vs_lp.html"; + document.getElementById( "dl_help" ).title = "What is the difference between full installation and language pack?"; + document.getElementById( "dl_help_img" ).src = "../cachedimages/help-icon.png"; + document.getElementById( "dl_help_img" ).alt = "Help icon"; + document.getElementById( "dl_help_img" ).text = "What is the difference between full install and language pack?"; + document.getElementById( "dl_help_img" ).title = "What is the difference between full install and language pack?"; + document.getElementById( "dl_rel_data" ).text = a; + document.getElementById( "dl_rel_data" ).title = b; + + document.getElementById( "dl_full_hl" ).text = "Full installation: "; + document.getElementById( "dl_full_size_hl" ).text = "Filesize ~ "; + document.getElementById( "dl_full_size" ).text = c; + document.getElementById( "space1" ).text = " | "; + document.getElementById( "dl_full_chk_hl" ).text = "Signatures and hashes: "; document.getElementById( "dl_full_chk_keys" ).href = CHECKSUM_KEYS; document.getElementById( "dl_full_chk_keys" ).text = "KEYS"; document.getElementById( "dl_full_chk_keys" ).title = "KEYS signature"; + document.getElementById( "space2" ).text = " , "; document.getElementById( "dl_full_chk_asc" ).href = CHECKSUM_ASC_FULL; document.getElementById( "dl_full_chk_asc" ).text = "ASC"; document.getElementById( "dl_full_chk_asc" ).title = "ASC signature"; + document.getElementById( "space3" ).text = " , "; document.getElementById( "dl_full_chk_md5" ).href = CHECKSUM_MD5_FULL; document.getElementById( "dl_full_chk_md5" ).text = "MD5"; document.getElementById( "dl_full_chk_md5" ).title = "MD5 hash"; + document.getElementById( "space4" ).text = " , "; document.getElementById( "dl_full_chk_sha256" ).href = CHECKSUM_SHA256_FULL; document.getElementById( "dl_full_chk_sha256" ).text = "SHA256"; document.getElementById( "dl_full_chk_sha256" ).title = "SHA256 hash"; - document.getElementById( "dl_lp_chk_headline" ).text = "Signatures and hashes for language pack: "; + document.getElementById( "space5" ).text = " , "; + document.getElementById( "dl_chk_verify" ).href = "../checksums.html"; + document.getElementById( "dl_chk_verify" ).text = "How to verify?"; + document.getElementById( "dl_chk_verify" ).title = "How to verify the download with checksums?"; + document.getElementById( "dl_lp_hl" ).text = "Language pack: "; + document.getElementById( "dl_lp_size_hl" ).text = "Filesize ~ "; + document.getElementById( "dl_lp_size" ).text = d; + document.getElementById( "space6" ).text = " | "; + document.getElementById( "dl_lp_chk_hl" ).text = "Signatures and hashes: "; document.getElementById( "dl_lp_chk_keys" ).href = CHECKSUM_KEYS; document.getElementById( "dl_lp_chk_keys" ).text = "KEYS"; document.getElementById( "dl_lp_chk_keys" ).title = "KEYS signature"; - document.getElementById( "dl_lp_chk_asc" ).href = CHECKSUM_ASC_FULL; + document.getElementById( "space7" ).text = " , "; + document.getElementById( "dl_lp_chk_asc" ).href = CHECKSUM_ASC_LP; document.getElementById( "dl_lp_chk_asc" ).text = "ASC"; document.getElementById( "dl_lp_chk_asc" ).title = "ASC signature"; - document.getElementById( "dl_lp_chk_md5" ).href = CHECKSUM_MD5_FULL; + document.getElementById( "space8" ).text = " , "; + document.getElementById( "dl_lp_chk_md5" ).href = CHECKSUM_MD5_LP; document.getElementById( "dl_lp_chk_md5" ).text = "MD5"; document.getElementById( "dl_lp_chk_md5" ).title = "MD5 hash"; - document.getElementById( "dl_lp_chk_sha256" ).href = CHECKSUM_SHA256_FULL; + document.getElementById( "space9" ).text = " , "; + document.getElementById( "dl_lp_chk_sha256" ).href = CHECKSUM_SHA256_LP; document.getElementById( "dl_lp_chk_sha256" ).text = "SHA256"; document.getElementById( "dl_lp_chk_sha256" ).title = "SHA256 hash"; - document.getElementById( "dl_chk_verify" ).href = "../checksums.html"; - document.getElementById( "dl_chk_verify" ).text = "How to verify?"; - document.getElementById( "dl_chk_verify" ).title = "How to verify the download with checksums?"; -*/ } return; @@ -772,22 +730,20 @@ function getLinkAlt( rel_mode ) { * Get platform of browser * Depends on internal browser data */ -function getPlatform( rel_mode ) { - // For more help or data see: "http://www.useragentstring.com" +function getPlatform() { + // For more help or data see: "http://www.useragentstring.com". var os = navigator.platform.toLowerCase(); // Get the platform string in lower cases var ua = navigator.userAgent.toLowerCase(); // Get the User Agent string in lower cases var av = navigator.appVersion.toLowerCase(); // Get the application version in lower cases + UI_PLATFORM = ""; // Delete any previously set string + URL_PLATFORM = ""; // Delete any previously set string + EXTENSION = ""; // Delete any previously set string - // Delete any previously set string - UI_PLATFORM = ""; - URL_PLATFORM = ""; - EXTENSION = ""; - - // Add ECMA262-5 Array methods if not supported natively - // To workaround that MSIE 8 and older do not support this function + // 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 ) ) { - Array.prototype.indexOf= function( find, i /*opt*/ ) { + Array.prototype.indexOf= function( find, i ) { // 'i' is an optional parameter if ( i === undefined ) i = 0; if ( i < 0 ) @@ -803,145 +759,156 @@ function getPlatform( rel_mode ) { } if ( os ) { - // Recognized but not supported platforms/OS, set $UI_PLATFORM to show it to the user. - if ( os.indexOf( "os/2" ) != -1 ) UI_PLATFORM = "OS/2"; - if ( os.indexOf( "freebsd" ) != -1 ) UI_PLATFORM = "FreeBSD (PKG)"; - if ( os.indexOf( "openbsd" ) != -1 ) UI_PLATFORM = "OpenBSD"; - if ( os.indexOf( "netbsd" ) != -1 ) UI_PLATFORM = "NetBSD"; - if ( os.indexOf( "pcbsd" ) != -1 ) UI_PLATFORM = "PC-BSD"; - if ( os.indexOf( "dragonfly" ) != -1 ) UI_PLATFORM = "DragonFly BSD"; - if ( os.indexOf( "amiga" ) != -1 ) UI_PLATFORM = "AmigaOS"; - if ( os.indexOf( "darwin" ) != -1 ) UI_PLATFORM = "Darwin"; - if ( os.indexOf( "aix" ) != -1 ) UI_PLATFORM = "IBM AIX"; - if ( os.indexOf( "irix" ) != -1 ) UI_PLATFORM = "IRIX"; - if ( os.indexOf( "vms" ) != -1 ) UI_PLATFORM = "OpenVMS"; - if ( os.indexOf( "alphaserver" ) != -1 ) UI_PLATFORM = "AlphaServer"; - if ( os.indexOf( "qnx" ) != -1 ) UI_PLATFORM = "QNX"; - if ( os.indexOf( "x11" ) != -1 ) UI_PLATFORM = "unknown OS (X11 support)"; - if ( os.indexOf( "arm" ) != -1 ) UI_PLATFORM = "ARM mobile devices"; - if ( os.indexOf( "sunos" ) != -1 ) { UI_PLATFORM = "Solaris x86 (PKG)"; - OLD_PLATFORM = true; - } - if ( ua.indexOf( "sun4u" ) != -1 ) { UI_PLATFORM = "Solaris SPARC (PKG)"; - OLD_PLATFORM = true; - } - if ( ua.indexOf( "ppc" ) != -1 || - ua.indexOf( "power_pc" ) != -1 ) { UI_PLATFORM = "Mac OS PPC (DMG)"; - OLD_PLATFORM = true; - } - if ( ua.indexOf( "iphone" ) != -1 || - ua.indexOf( "ipad" ) != -1 || - ua.indexOf( "ipod" ) != -1 ) UI_PLATFORM = "Apple iPhone/iPad/iPod"; - if ( ua.indexOf( "android" ) != -1 || - av.indexOf( "android" ) != -1 ) UI_PLATFORM = "Android mobile devices"; - if ( ua.indexOf( "blackberry" ) != -1 ) UI_PLATFORM = "Blackberry smartphones"; - if ( ua.indexOf( "nokia" ) != -1 ) UI_PLATFORM = "Nokia mobile devices"; - if ( ua.indexOf( "symbian" ) != -1 ) UI_PLATFORM = "mobile phones (Symbian OS)"; - if ( ua.indexOf( "symbos" ) != -1 ) UI_PLATFORM = "mobile phones (Symbian OS)"; - if ( ua.indexOf( "s60" ) != -1 ) UI_PLATFORM = "mobile phones (Series60/S60)"; - if ( ua.indexOf( "series60" ) != -1 ) UI_PLATFORM = "mobile phones (Series60/S60)"; - if ( ua.indexOf( "palm" ) != -1 ) UI_PLATFORM = "mobile phones (Palm OS)"; - if ( ua.indexOf( "webos" ) != -1 ) UI_PLATFORM = "mobile phones (Palm webOS)"; - if ( ua.indexOf( "pike" ) != -1 ) UI_PLATFORM = "mobile phones (Pike)"; - if ( ua.indexOf( "ce.net" ) != -1 ) UI_PLATFORM = "mobile phones (Windows CE)"; - if ( ua.indexOf( "widerweb" ) != -1 ) UI_PLATFORM = "mobile phones (WiderWeb)"; - if ( ua.indexOf( "brew" ) != -1 ) UI_PLATFORM = "smartphones (BREW)"; - if ( ua.indexOf( "hiptop" ) != -1 ) UI_PLATFORM = "smartphones (Hiptop)"; - if ( ua.indexOf( "playstation" ) != -1 ) UI_PLATFORM = "Sony Playstation"; - if ( ua.indexOf( "psp" ) != -1 ) UI_PLATFORM = "Sony Playstation Portable"; - if ( ua.indexOf( "nintendo" ) != -1 ) UI_PLATFORM = "Nintendo game console"; - if ( ua.indexOf( "wii" ) != -1 ) UI_PLATFORM = "Nintendo Wii game console"; - - // If the $UI_PLATFORM variable is already filled, then something was recognized and no more work is need. - if ( UI_PLATFORM != "" ) - return; - - // Windows, x86 or mobile? - if ( os.indexOf( "windows" ) != -1 || - os.indexOf( "win" ) != -1 ) { UI_PLATFORM = "Windows (EXE)"; - URL_PLATFORM = "Win_x86_install"; - EXTENSION = ".exe"; - if ( ua.indexOf( "phone" ) != -1 || - ua.indexOf( "mobile" ) != -1 ) UI_PLATFORM = "Windows Mobile device"; - } - - // Linux, x86 or x86-64, DEB or RPM? - if ( os.indexOf( "linux" ) != -1 ) { - // 32-bit, DEB or RPM? - if ( os.indexOf( "x86" ) != -1 || - os.indexOf( "i686" ) != -1 || - os.indexOf( "i586" ) != -1 || - os.indexOf( "i486" ) != -1 || - os.indexOf( "i386" ) != -1 || - av.indexOf( "x86" ) != -1 || - av.indexOf( "i686" ) != -1 || - av.indexOf( "i586" ) != -1 || - av.indexOf( "i486" ) != -1 || - av.indexOf( "i386" ) != -1 ) { UI_PLATFORM = "Linux 32-bit (RPM)"; - URL_PLATFORM = "Linux_x86_install-rpm"; - EXTENSION = ".tar.gz"; - if ( ua.indexOf( "debian" ) != -1 || - ua.indexOf( "ubuntu" ) != -1 || - ua.indexOf( "iceweasel" ) != -1 ) { UI_PLATFORM = "Linux Debian 32-bit (DEB)"; - URL_PLATFORM = "Linux_x86_install-deb"; - EXTENSION = ".tar.gz"; - } - } - // 64-bit, DEB or RPM? - if ( os.indexOf( "_64" ) != -1 || - os.indexOf( "-64" ) != -1 || - os.indexOf( "x64" ) != -1 || - os.indexOf( "amd64" ) != -1 || - av.indexOf( "_64" ) != -1 || - av.indexOf( "-64" ) != -1 || - av.indexOf( "x64" ) != -1 || - av.indexOf( "amd64" ) != -1 ) { UI_PLATFORM = "Linux 64-bit (RPM)"; - URL_PLATFORM = "Linux_x86-64_install-rpm"; - EXTENSION = ".tar.gz"; - if ( ua.indexOf( "debian" ) != -1 || - ua.indexOf( "ubuntu" ) != -1 || - ua.indexOf( "iceweasel" ) != -1 ) { UI_PLATFORM = "Linux Debian 64-bit (DEB)"; - URL_PLATFORM = "Linux_x86-64_install-deb"; - EXTENSION = ".tar.gz"; - } - } - } - - // Mac OS X? - if ( os.indexOf( "mac" ) != -1 ) { UI_PLATFORM = "OS X 64-bit Intel (DMG)"; - URL_PLATFORM = "MacOS_x86_install"; - EXTENSION = ".dmg"; - // OS X is 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 ) { UI_PLATFORM = "Mac OS X (10.6 or older)"; - if ( rel_mode > 1 ) - OLD_PLATFORM = true; + // Recognized but not supported platforms/OS, set $UI_PLATFORM to show it to the user. + if ( os.indexOf( "os/2" ) != -1 ) UI_PLATFORM = "OS/2"; + if ( os.indexOf( "freebsd" ) != -1 ) UI_PLATFORM = "FreeBSD (PKG)"; + if ( os.indexOf( "openbsd" ) != -1 ) UI_PLATFORM = "OpenBSD"; + if ( os.indexOf( "netbsd" ) != -1 ) UI_PLATFORM = "NetBSD"; + if ( os.indexOf( "pcbsd" ) != -1 ) UI_PLATFORM = "PC-BSD"; + if ( os.indexOf( "dragonfly" ) != -1 ) UI_PLATFORM = "DragonFly BSD"; + if ( os.indexOf( "amiga" ) != -1 ) UI_PLATFORM = "AmigaOS"; + if ( os.indexOf( "darwin" ) != -1 ) UI_PLATFORM = "Darwin"; + if ( os.indexOf( "aix" ) != -1 ) UI_PLATFORM = "IBM AIX"; + if ( os.indexOf( "irix" ) != -1 ) UI_PLATFORM = "IRIX"; + if ( os.indexOf( "vms" ) != -1 ) UI_PLATFORM = "OpenVMS"; + if ( os.indexOf( "alphaserver" ) != -1 ) UI_PLATFORM = "AlphaServer"; + if ( os.indexOf( "qnx" ) != -1 ) UI_PLATFORM = "QNX"; + if ( os.indexOf( "x11" ) != -1 ) UI_PLATFORM = "unknown OS (X11 support)"; + if ( os.indexOf( "arm" ) != -1 ) UI_PLATFORM = "ARM mobile devices"; + if ( os.indexOf( "sunos" ) != -1 ) { UI_PLATFORM = "Solaris x86 (PKG)"; + OLD_PLATFORM = true; + } + if ( ua.indexOf( "sun4u" ) != -1 ) { UI_PLATFORM = "Solaris SPARC (PKG)"; + OLD_PLATFORM = true; + } + if ( ua.indexOf( "ppc" ) != -1 || + ua.indexOf( "power_pc" ) != -1 ) { UI_PLATFORM = "Mac OS PPC (DMG)"; + OLD_PLATFORM = true; + } + if ( ua.indexOf( "iphone" ) != -1 || + ua.indexOf( "ipad" ) != -1 || + ua.indexOf( "ipod" ) != -1 ) UI_PLATFORM = "Apple iPhone/iPad/iPod"; + if ( ua.indexOf( "android" ) != -1 || + av.indexOf( "android" ) != -1 ) UI_PLATFORM = "Android mobile devices"; + if ( ua.indexOf( "blackberry" ) != -1 ) UI_PLATFORM = "Blackberry smartphones"; + if ( ua.indexOf( "nokia" ) != -1 ) UI_PLATFORM = "Nokia mobile devices"; + if ( ua.indexOf( "symbian" ) != -1 ) UI_PLATFORM = "mobile phones (Symbian OS)"; + if ( ua.indexOf( "symbos" ) != -1 ) UI_PLATFORM = "mobile phones (Symbian OS)"; + if ( ua.indexOf( "s60" ) != -1 ) UI_PLATFORM = "mobile phones (Series60/S60)"; + if ( ua.indexOf( "series60" ) != -1 ) UI_PLATFORM = "mobile phones (Series60/S60)"; + if ( ua.indexOf( "palm" ) != -1 ) UI_PLATFORM = "mobile phones (Palm OS)"; + if ( ua.indexOf( "webos" ) != -1 ) UI_PLATFORM = "mobile phones (Palm webOS)"; + if ( ua.indexOf( "pike" ) != -1 ) UI_PLATFORM = "mobile phones (Pike)"; + if ( ua.indexOf( "ce.net" ) != -1 ) UI_PLATFORM = "mobile phones (Windows CE)"; + if ( ua.indexOf( "widerweb" ) != -1 ) UI_PLATFORM = "mobile phones (WiderWeb)"; + if ( ua.indexOf( "brew" ) != -1 ) UI_PLATFORM = "smartphones (BREW)"; + if ( ua.indexOf( "hiptop" ) != -1 ) UI_PLATFORM = "smartphones (Hiptop)"; + if ( ua.indexOf( "playstation" ) != -1 ) UI_PLATFORM = "Sony Playstation"; + if ( ua.indexOf( "psp" ) != -1 ) UI_PLATFORM = "Sony Playstation Portable"; + if ( ua.indexOf( "nintendo" ) != -1 ) UI_PLATFORM = "Nintendo game console"; + if ( ua.indexOf( "wii" ) != -1 ) UI_PLATFORM = "Nintendo Wii game console"; + + // If the $UI_PLATFORM variable is already filled, something was recognized and no more work is need. + if ( UI_PLATFORM != "" ) + return; + + // Windows, x86 or mobile? + if ( os.indexOf( "windows" ) != -1 || + os.indexOf( "win" ) != -1 ) { UI_PLATFORM = "Windows (EXE)"; + URL_PLATFORM = "Win_x86_install"; + EXTENSION = ".exe"; + if ( ua.indexOf( "phone" ) != -1 || + ua.indexOf( "mobile" ) != -1 ) UI_PLATFORM = "Windows Mobile device"; + } + + // Linux, x86 or x86-64, DEB or RPM? + if ( os.indexOf( "linux" ) != -1 ) { + // 32-bit, DEB or RPM? + if ( os.indexOf( "x86" ) != -1 || + os.indexOf( "i686" ) != -1 || + os.indexOf( "i586" ) != -1 || + os.indexOf( "i486" ) != -1 || + os.indexOf( "i386" ) != -1 || + av.indexOf( "x86" ) != -1 || + av.indexOf( "i686" ) != -1 || + av.indexOf( "i586" ) != -1 || + av.indexOf( "i486" ) != -1 || + av.indexOf( "i386" ) != -1 ) { UI_PLATFORM = "Linux 32-bit (RPM)"; + URL_PLATFORM = "Linux_x86_install-rpm"; + EXTENSION = ".tar.gz"; + if ( ua.indexOf( "debian" ) != -1 || + ua.indexOf( "ubuntu" ) != -1 || + ua.indexOf( "iceweasel" ) != -1 ) { UI_PLATFORM = "Linux Debian 32-bit (DEB)"; + URL_PLATFORM = "Linux_x86_install-deb"; + EXTENSION = ".tar.gz"; + } + } + // 64-bit, DEB or RPM? + if ( os.indexOf( "_64" ) != -1 || + os.indexOf( "-64" ) != -1 || + os.indexOf( "x64" ) != -1 || + os.indexOf( "amd64" ) != -1 || + av.indexOf( "_64" ) != -1 || + av.indexOf( "-64" ) != -1 || + av.indexOf( "x64" ) != -1 || + av.indexOf( "amd64" ) != -1 ) { UI_PLATFORM = "Linux 64-bit (RPM)"; + URL_PLATFORM = "Linux_x86-64_install-rpm"; + EXTENSION = ".tar.gz"; + if ( ua.indexOf( "debian" ) != -1 || + ua.indexOf( "ubuntu" ) != -1 || + ua.indexOf( "iceweasel" ) != -1 ) { UI_PLATFORM = "Linux Debian 64-bit (DEB)"; + URL_PLATFORM = "Linux_x86-64_install-deb"; + EXTENSION = ".tar.gz"; + } + } } - } + + // Mac OS X? + if ( os.indexOf( "mac" ) != -1 ) { UI_PLATFORM = "OS X 64-bit Intel (DMG)"; + URL_PLATFORM = "MacOS_x86-64_install"; + EXTENSION = ".dmg"; + // OS X is 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 ) { UI_PLATFORM = "Mac OS X (10.6 or older)"; + URL_PLATFORM = "MacOS_x86_install"; + OLD_PLATFORM = true; + } + } } - // If nothing was recognized until now, set $UI_PLATFORM to show it to the user + // If nothing was recognized until now, set $UI_PLATFORM to show it to the user. if ( UI_PLATFORM == "" ) { - UI_PLATFORM = "unknown platform/OS"; - ERROR = true; + UI_PLATFORM = "unknown platform/OS"; + ERROR = true; } - return; + return URL_PLATFORM; } /* - * Get file size for download file - * Depends on array-list + * Get file name for download file + * Depends on version, platform, language and extension */ -function getFilesize( rel_mode ) { - // Depending on $URL_PLATFORM assign the platform position of the release matrix +function getFilename( ver ) { + // Assemble the filename for download from the release matrix of language and platform (column 0). + FILENAME_FULL = "Apache_OpenOffice_" + ver + "_" + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 0 ] + "_" + LANG_ISO + EXTENSION; + FILENAME_LP = "Apache_OpenOffice_" + ver + "_" + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 0 ] + "_" + LANG_ISO + EXTENSION; + + return FILENAME_FULL; +} +/* + * Get file size for download file + * Depends on array-list and "release_matrix.js" + */ +function getFilesize() { + // Depending on $URL_PLATFORM assign the platform position of the release matrix. switch ( URL_PLATFORM ) { case "Linux_x86-64_install-deb": case "Linux_x86-64_langpack-deb": @@ -979,34 +946,24 @@ function getFilesize( rel_mode ) { RELEASE_MATRIX_PLATFORM_POS_LP = 12; break; default: - RELEASE_MATRIX_PLATFORM_POS_FULL = 0; - RELEASE_MATRIX_PLATFORM_POS_LP = 0; + RELEASE_MATRIX_PLATFORM_POS_FULL = -1; + RELEASE_MATRIX_PLATFORM_POS_LP = -1; } - // If a platform was found and no error occurred, assign the array data and filesize from the release matrix - if ( RELEASE_MATRIX_PLATFORM_POS_FULL > 0 && !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_FULL ]; - // Assign the file size (column 2) from the release matrix of language and platform - FILESIZE_FULL = release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 2 ]; - FILESIZE_LP = release_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 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_FULL ]; - // Assign the file size (column 2) from the release matrix of language and platform - FILESIZE_FULL = release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 2 ]; - FILESIZE_LP = release_matrix_beta[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 2 ]; - } + // If a platform was found and no error occurred, assign the array data and filesize from the release matrix. + if ( RELEASE_MATRIX_PLATFORM_POS_FULL > -1 && !ERROR ) { + // Assign all values from the release matrix of language and platform. + RELEASE_MATRIX_PLATFORM = release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ]; + // Assign the file size (column 2) from the release matrix of language and platform. + FILESIZE_FULL = release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 2 ]; + FILESIZE_LP = release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 2 ]; } else { - ERROR = true; - FILESIZE_FULL = 0; - FILESIZE_LP = 0; + ERROR = true; + FILESIZE_FULL = 0; + FILESIZE_LP = 0; } - return; + return FILESIZE_FULL; } /*