Author: marcus Date: Tue May 27 20:02:42 2014 New Revision: 1597864 URL: http://svn.apache.org/r1597864 Log: Continued the implemented exceptions for not available languages or platforms
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=1597864&r1=1597863&r2=1597864&view=diff ============================================================================== --- openoffice/ooo-site/trunk/content/download/test/download_droplist.js (original) +++ openoffice/ooo-site/trunk/content/download/test/download_droplist.js Tue May 27 20:02:42 2014 @@ -14,14 +14,17 @@ * function setOSSel () * function setLangSel () * function setVerSel () + * function getTypeSel () * function resetSel () - * function showPopup ( target_url ) + * function showWindow ( target_url ) + * function showErrorMessage( error_text ) * function isLangSupported () * function getLink ( rel_mode ) - * function getLinkSel () + * function getLinkSel ( rel_mode ) * function getPlatform () - * function getFilename ( ver ) - * function getFilesize () + * function getDLFilename ( ver ) + * function getChkFilename ( ver ) + * function getFilesize ( ver ) * function openItem ( itemid, uri ) */ @@ -36,6 +39,9 @@ function init() { fillOSSel() fillLangSel(); fillVerSel(); + setOSSel(); + setLangSel(); + setVerSel(); // Get the download link from the selected elements. getLinkSel( 1 ); @@ -80,7 +86,6 @@ function initVars() { APACHE_BASE_URL = ""; // The base URL for all binary files on Apache APACHE_DIST_BASE_URL = ""; // The base URL for all checksum files on Apache APACHE_DIST_PREVIOUS_URL = ""; // The base URL for all checksum files (prev. version) on Apache - SF = false; // Does the download URL points to Soureforge? OTHER = false; // Does the download URL points to 'other.html'? ARCHIVE = false; // Does the download URL points to the ASF archive? @@ -245,11 +250,10 @@ function getLanguage() { */ function fillOSSel() { var sel_os = document.getElementById( "os" ); - var i = 0; var option = ""; // Fill the <select> element until all OS's are used. - for( i = 0; i < SEL_OS.length; i = i + 3 ) { + for( var i = 0; i < SEL_OS.length; i = i + 3 ) { option = document.createElement( "option" ); // Assign the platform abbreviation as index value. option.value = SEL_OS[ i ]; @@ -262,7 +266,7 @@ function fillOSSel() { getPlatform(); // Set the recognized platform as default. - setOSSel(); +// setOSSel(); return; } @@ -273,11 +277,10 @@ function fillOSSel() { */ function fillLangSel() { var sel_lang = document.getElementById( "lang" ); - var i = 0; var option = ""; // Fill the <select> element until all languages are used. - for( i = 0; i < SEL_LANG.length; i = i + 2 ) { + for( var i = 0; i < SEL_LANG.length; i = i + 2 ) { option = document.createElement( "option" ); // Assign the language ISO code as index value. option.value = SEL_LANG[ i ]; @@ -290,7 +293,7 @@ function fillLangSel() { getLanguage(); // Set the recognized language as default. - setLangSel(); +// setLangSel(); /* alert( languages[0]["ast"] + " " + SEL_LANG.length ); @@ -313,11 +316,10 @@ function fillLangSel() { */ function fillVerSel() { var sel_ver = document.getElementById( "ver" ); - var i = 0; var option = ""; // Fill the <select> element until all versions are used. - for( i = 0; i < SEL_VER.length; i = i + 2 ) { + for( var i = 0; i < SEL_VER.length; i = i + 2 ) { option = document.createElement( "option" ); // Assign the version as index value. option.value = SEL_VER[ i ]; @@ -327,7 +329,7 @@ function fillVerSel() { } // Set the version from the $VERSION variable as default. - setVerSel(); +// setVerSel(); return; } @@ -430,7 +432,7 @@ function setOSSel() { + "URL_PLATFORM: " + "\t\t\t" + URL_PLATFORM + "\n" + "sel_os.selectedIndex: " + "\t" + sel_os.selectedIndex + "\n" + "sel_os.value: " + "\t\t\t" + sel_os.value + "\n" - + "sel_os_text: " + "\t\t\t" + sel_os_text + "\n" +// + "sel_os_text: " + "\t\t\t" + sel_os_text + "\n" + "PLATFORM_SEL: " + "\t\t\t" + PLATFORM_SEL + "\n" + "\n\n" + "" ); @@ -609,9 +611,8 @@ function setVerSel() { * Depends on chosen OS */ function getOSSel() { - var sel_os = document.getElementById( "os" ); +// var sel_os = document.getElementById( "os" ); var os_value = document.download.os.options[document.download.os.selectedIndex].value; - var i = 0; /* alert( "" + "getOSSel() : Before if + for" + "\n\n" @@ -633,7 +634,7 @@ function getOSSel() { } */ // Search through the <select> element until the chosen OS is found. - for( i = 0; i < SEL_OS.length; i = i + 3 ) { + for( var i = 0; i < SEL_OS.length; i = i + 3 ) { if( SEL_OS[ i ] == os_value ) { PLATFORM_SEL = SEL_OS[ i ]; UI_PLATFORM = SEL_OS[ i + 1 ]; @@ -674,9 +675,8 @@ function getOSSel() { * Depends on chosen language */ function getLangSel() { - var sel_lang = document.getElementById( "lang" ); +// var sel_lang = document.getElementById( "lang" ); var lang_value = document.download.lang.options[document.download.lang.selectedIndex].value; - var i = 0; // alert( "getLangSel() : Before if + for" + "\n\n" + "LANG_ISO: " + LANG_ISO + "\n" + "LANG_SEL: " + LANG_SEL ); @@ -698,7 +698,7 @@ function getLangSel() { } */ // Search through the <select> element until the chosen language is found. - for( i = 0; i < SEL_LANG.length; i = i + 2 ) { + for( var i = 0; i < SEL_LANG.length; i = i + 2 ) { if( SEL_LANG[ i ] == lang_value ) { LANG_SEL = lang_value; /* @@ -717,6 +717,7 @@ function getLangSel() { LANG_ISO = LANG_SEL; getLanguage(); + // alert( "getLangSel() : End" + "\n\n" + "LANG_ISO: " + LANG_ISO + "\n" + "LANG_SEL: " + LANG_SEL ); // alertDbg( "getLangSel() : After if + for" ); @@ -735,7 +736,7 @@ function getLangSel() { * Depends on chosen version */ function getVerSel() { - var sel_ver = document.getElementById( "ver" ); +// var sel_ver = document.getElementById( "ver" ); var ver_value = document.download.ver.options[document.download.ver.selectedIndex].value; var i = 0; /* @@ -748,7 +749,7 @@ function getVerSel() { } */ // Search through the <select> element until the chosen version is found. - for( i = 0; i < SEL_VER.length; i = i + 2 ) { + for( var i = 0; i < SEL_VER.length; i = i + 2 ) { if( SEL_VER[ i ] == ver_value ) { VERSION_SEL = ver_value; break; @@ -799,7 +800,7 @@ function resetSel() { "space1", "dl_f_chk_hl", "dl_f_chk_keys", "space2", "dl_f_chk_asc", "space3", "dl_f_chk_md5", "space4", "dl_f_chk_sha256", "space5", "dl_chk_verify", "dl_lp_hl", "dl_lp_size_hl", "dl_lp_size", "space6", "dl_lp_chk_hl", "dl_lp_chk_keys", "space7", "dl_lp_chk_asc", "space8", "dl_lp_chk_md5", "space9", "dl_lp_chk_sha256", "dl_hlp", - "dl_hlp_img", "dl_rpt", "dl_rpt_img", "dl_hlp", "dl_hlp_img", "dl_rpt", "dl_rpt_img" ]; + "dl_hlp_img", "dl_hlp_img2", "dl_rpt", "dl_rpt_img", "dl_rpt_img2", "dl_hlp", "dl_hlp_img", "dl_rpt", "dl_rpt_img" ]; // Emtpy the values for all elements in the green and sub-green colored boxes. for( var i = 0; i < element_names.length; i++ ) { @@ -810,7 +811,7 @@ function resetSel() { document.getElementById( element_names[ i ] ).innerHTML = ""; } else { // Emtpy the values for all image elements. - document.getElementById( element_names[ i ] ).src = ""; + document.getElementById( element_names[ i ] ).src = "javascript:void( 0 )"; document.getElementById( element_names[ i ] ).title = ""; document.getElementById( element_names[ i ] ).alt = ""; } @@ -912,7 +913,7 @@ function resetSel() { } /* - * Open a popup window + * Show a popup window * Depends on received target link */ function showWindow( target_link ) { @@ -928,9 +929,34 @@ function showWindow( target_link ) { } /* - * Get flag for mirror link - * Depends on array-list and "languages.js" - * Depends on array-list and "release_matrix.js" + * Show error message + * Depends on set text data + */ +function showErrorMessage( error_text ) { + // The chosen items from select boxes lead to no download link, show an error message about reason and alternative. + + // In general, reset the data for link, text and title of all elements. + resetSel(); + + // Now set again the values for all elements that should be shown. + document.getElementById( "dl_f_lnk" ).innerHTML = error_text[ 0 ]; + document.getElementById( "dl_f_lnk" ).title = error_text[ 1 ]; + document.getElementById( "dl_lp_lnk" ).innerHTML = error_text[ 2 ]; + document.getElementById( "dl_lp_lnk" ).title = error_text[ 3 ]; + document.getElementById( "dl_f_size_hl" ).innerHTML = error_text[ 4 ]; + + SF = false; + OTHER = true; + ARCHIVE = false; + ERROR = true; + + return; +} + +/* + * Is flag set for chosen language (y/n)? + * Depends on array-list of "languages.js" + * Depends on language and array-list of "release_matrix.js" */ function isLangSupported() { // Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage. @@ -970,7 +996,7 @@ function getLink( rel_mode ) { initVars(); // If no release mode was given, assume it is about the stable release. - if( rel_mode == undefined ) + if( rel_mode == undefined || rel_mode == "" ) rel_mode = 1; getLanguage(); @@ -989,19 +1015,19 @@ function getLink( rel_mode ) { APACHE_DIST_PREVIOUS_URL = APACHE_DIST + PRE_VERSION; LINK_FULL = SOURCEFORGE_PREVIOUS_URL + LANG_ISO + "/"; - LINK_FULL = LINK_FULL + getFilename( PRE_VERSION ); + LINK_FULL = LINK_FULL + getDLFilename( PRE_VERSION ); LINK_FULL = LINK_FULL + "/download" LINK_CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; LINK_CHECKSUM_ASC_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - LINK_CHECKSUM_ASC_FULL = LINK_CHECKSUM_ASC_FULL + getFilename( PRE_VERSION ) + ".asc"; + LINK_CHECKSUM_ASC_FULL = LINK_CHECKSUM_ASC_FULL + getDLFilename( PRE_VERSION ) + ".asc"; LINK_CHECKSUM_MD5_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - LINK_CHECKSUM_MD5_FULL = LINK_CHECKSUM_MD5_FULL + getFilename( PRE_VERSION ) + ".md5"; + LINK_CHECKSUM_MD5_FULL = LINK_CHECKSUM_MD5_FULL + getDLFilename( PRE_VERSION ) + ".md5"; LINK_CHECKSUM_SHA256_FULL = APACHE_DIST_PREVIOUS_URL + "/binaries/" + LANG_ISO + "/"; - LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + getFilename( PRE_VERSION ); + LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + getDLFilename( PRE_VERSION ); LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + ".sha256" SF = false; @@ -1062,17 +1088,17 @@ function getLink( rel_mode ) { SOURCEFORGE_BASE_URL = SOURCEFORGE + VERSION + "/binaries/"; SOURCEFORGE_PREVIOUS_URL = SOURCEFORGE + PRE_VERSION + "/binaries/"; - LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + getFilename( VERSION ) + "/download"; + LINK_FULL = SOURCEFORGE_BASE_URL + LANG_ISO + "/" + getDLFilename( VERSION ) + "/download"; LINK_CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - LINK_CHECKSUM_ASC_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ); + LINK_CHECKSUM_ASC_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getDLFilename( VERSION ); LINK_CHECKSUM_ASC_FULL = LINK_CHECKSUM_ASC_FULL + ".asc"; - LINK_CHECKSUM_MD5_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ); + LINK_CHECKSUM_MD5_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getDLFilename( VERSION ); LINK_CHECKSUM_MD5_FULL = LINK_CHECKSUM_MD5_FULL + ".md5"; - LINK_CHECKSUM_SHA256_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getFilename( VERSION ); + LINK_CHECKSUM_SHA256_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_ISO + "/" + getDLFilename( VERSION ); LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + ".sha256"; SF = true; @@ -1109,7 +1135,7 @@ function getLink( rel_mode ) { * Depends on chosen OS, language and type */ function getLinkSel( rel_mode ) { - var text = ""; + var error_text; // If no release mode was given, assume it is about the stable release. if( rel_mode == undefined ) @@ -1130,152 +1156,52 @@ function getLinkSel( rel_mode ) { */ // if( URL_PLATFORM == "" || LANG_ISO == "" ) { // if( URL_PLATFORM == "" || LANG_ISO == "" || VERSION_SEL == "" ) { - if( PLATFORM_SEL == "" || LANG_SEL == "" || VERSION_SEL == "" ) { +/* if( PLATFORM_SEL == "" || LANG_SEL == "" || VERSION_SEL == "" ) { // When OS or language was not chosen, let the user choose again. // When OS, language or version was not chosen, let the user choose again. // resetSel(); return; } +*/ + // If version is '4.1.0' (or newer) + platform is 'Mac OS X <= 10.6', show the none-availability to the user. + if( VERSION_SEL == "4.1.0" && URL_PLATFORM == "MacOS_x86_install" ) { + // Show an error message that the chosen items do not lead to a download. + error_text = [ "No full installation available", "Please select another language, platform or version.", + "No language pack available", "Please select another language, platform or version.", + "Apache OpenOffice " + VERSION_SEL + " for <b>" + UI_PLATFORM + "</b> is not available. " + + "<br />Please select version 4.0.1 or older." ]; - // If language is supported, provide a download link. - if( isLangSupported() ) { - // If platform is 'Mac OS X <= 10.6', show the none-availability to the user. - if( VERSION_SEL == "4.1.0" && URL_PLATFORM == "MacOS_x86_install" ) { - // Reset the link, text and title of all elements that are not available. - resetSel(); - - // Set the values for all elements that should not be empty. - text = "Apache OpenOffice " + VERSION_SEL + " for " + UI_PLATFORM + " is not available. "; - text = text + "<br />Please select the previous version " + PRE_VERSION + "."; - document.getElementById( "dl_f_lnk" ).href = "javascript:void( 0 )"; - document.getElementById( "dl_f_lnk" ).innerHTML = "No full installation available"; - document.getElementById( "dl_f_lnk" ).title = "Please select another language, platform or version."; - document.getElementById( "dl_lp_lnk" ).href = "javascript:void( 0 )"; - document.getElementById( "dl_lp_lnk" ).innerHTML = "No language pack available"; - document.getElementById( "dl_lp_lnk" ).title = "Please select another language, platform or version."; - document.getElementById( "dl_f_hl" ).innerHTML = text; - - SF = false; - OTHER = true; - ARCHIVE = false; - ERROR = true; - return; - } + showErrorMessage( error_text ); + return; + } -// if( URL_PLATFORM != "" && LANG_ISO != "" ) { -// if( URL_PLATFORM != "" && LANG_ISO != "" && VERSION_SEL != "" ) { - if( PLATFORM_SEL != "" && LANG_SEL != "" && VERSION_SEL != "" ) { - // If language and platform are recognized, assemble the filenames for download and checksums. - - getFilesize( VERSION_SEL ); - getFilename( VERSION_SEL ); - - if( LANG_SEL != "" && RELEASE_MATRIX_PLATFORM_POS_FULL > -1 ) { - - SOURCEFORGE_BASE_URL = SOURCEFORGE + VERSION_SEL + "/binaries/"; - APACHE_DIST_BASE_URL = APACHE_DIST + VERSION_SEL; - - // Assign the file name (column 3) from the release matrix of language and platform. - LINK_FULL = SOURCEFORGE_BASE_URL + LANG_SEL + "/" + FILENAME_FULL + "/download"; - LINK_LP = SOURCEFORGE_BASE_URL + LANG_SEL + "/" + FILENAME_LP + "/download"; + // If version is '4.0.1' (or older) + platform is 'Mac OS X => 10.7', show the none-availability to the user. + if( ( VERSION_SEL == "4.0.1" || VERSION_SEL == "4.0.0" ) && URL_PLATFORM == "MacOS_x86-64_install" ) { + // Set the values for all elements that should not be empty. + error_text = [ "No full installation available", "Please select another language, platform or version.", + "No language pack available", "Please select another language, platform or version.", + "Apache OpenOffice " + VERSION_SEL + " for <b>" + UI_PLATFORM + "</b> is not available. " + + "<br />Please select version 4.1.0 or newer." ]; - LINK_CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; - LINK_CHECKSUM_ASC_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; - LINK_CHECKSUM_ASC_FULL = LINK_CHECKSUM_ASC_FULL + ".asc"; - LINK_CHECKSUM_MD5_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; - LINK_CHECKSUM_MD5_FULL = LINK_CHECKSUM_MD5_FULL + ".md5"; - LINK_CHECKSUM_SHA256_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; - LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + ".sha256"; - - LINK_CHECKSUM_ASC_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; - LINK_CHECKSUM_ASC_LP = LINK_CHECKSUM_ASC_LP + ".asc"; - LINK_CHECKSUM_MD5_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; - LINK_CHECKSUM_MD5_LP = LINK_CHECKSUM_MD5_LP + ".md5"; - LINK_CHECKSUM_SHA256_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; - LINK_CHECKSUM_SHA256_LP = LINK_CHECKSUM_SHA256_LP + ".sha256"; - - SF = true; - OTHER = false; - ARCHIVE = false; - ERROR = false; - } + showErrorMessage( error_text ); + return; + } - text = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: "; - text = text + REL_DATE; + // If recognized platform is not 'Windows', 'Linux' or 'Mac', show the none-availability to the user. + if( URL_PLATFORM == "" ) { + // Show an error message that the chosen items do not lead to a download. + error_text = [ "No full installation available", "Please select another language, platform or version.", + "No language pack available", "Please select another language, platform or version.", + "Apache OpenOffice " + VERSION_SEL + " for <b>" + UI_PLATFORM + "</b> is not available. " + + "<br />Please select a platform for Windows, Linux or OS X." ]; - // Set the values for the both download text buttons. - document.getElementById( "dl_f_lnk" ).href = LINK_FULL; - document.getElementById( "dl_f_lnk" ).innerHTML = "Download full installation"; - document.getElementById( "dl_f_lnk" ).title = "Click to download: " + FILENAME_FULL; - document.getElementById( "dl_lp_lnk" ).href = LINK_LP; - document.getElementById( "dl_lp_lnk" ).innerHTML = "Download language pack"; - document.getElementById( "dl_lp_lnk" ).title = "Click to download: " + FILENAME_LP; - - // Set the values in the sub-green box on the left hand side. - document.getElementById( "dl_rel_dta_hl" ).innerHTML = "Release data: "; - document.getElementById( "dl_rel_dta" ).innerHTML = text; - document.getElementById( "dl_f_hl" ).innerHTML = "Full installation: "; - document.getElementById( "dl_f_size_hl" ).innerHTML = "Filesize ~ "; - document.getElementById( "dl_f_size" ).innerHTML = FILESIZE_FULL + " MByte"; - document.getElementById( "space1" ).innerHTML = " | "; - document.getElementById( "dl_f_chk_hl" ).innerHTML = "Signatures and hashes: "; - document.getElementById( "dl_f_chk_keys" ).href = LINK_CHECKSUM_KEYS; - document.getElementById( "dl_f_chk_keys" ).innerHTML = "KEYS"; - document.getElementById( "dl_f_chk_keys" ).title = "KEYS signature file"; - document.getElementById( "space2" ).innerHTML = " , "; - document.getElementById( "dl_f_chk_asc" ).href = LINK_CHECKSUM_ASC_FULL; - document.getElementById( "dl_f_chk_asc" ).innerHTML = "ASC"; - document.getElementById( "dl_f_chk_asc" ).title = "ASC signature for: " + FILENAME_FULL; - document.getElementById( "space3" ).innerHTML = " , "; - document.getElementById( "dl_f_chk_md5" ).href = LINK_CHECKSUM_MD5_FULL; - document.getElementById( "dl_f_chk_md5" ).innerHTML = "MD5"; - document.getElementById( "dl_f_chk_md5" ).title = "MD5 hash for: " + FILENAME_FULL; - document.getElementById( "space4" ).innerHTML = " , "; - document.getElementById( "dl_f_chk_sha256" ).href = LINK_CHECKSUM_SHA256_FULL; - document.getElementById( "dl_f_chk_sha256" ).innerHTML = "SHA256"; - document.getElementById( "dl_f_chk_sha256" ).title = "SHA256 hash for: " + FILENAME_FULL; - document.getElementById( "space5" ).innerHTML = " , "; - document.getElementById( "dl_chk_verify" ).href = "../checksums.html"; - document.getElementById( "dl_chk_verify" ).innerHTML = "How to verify?"; - document.getElementById( "dl_chk_verify" ).title = "How to verify the download with checksums?"; - document.getElementById( "dl_lp_hl" ).innerHTML = "Language pack: "; - document.getElementById( "dl_lp_size_hl" ).innerHTML = "Filesize ~ "; - document.getElementById( "dl_lp_size" ).innerHTML = FILESIZE_LP + " MByte"; - document.getElementById( "space6" ).innerHTML = " | "; - document.getElementById( "dl_lp_chk_hl" ).innerHTML = "Signatures and hashes: "; - document.getElementById( "dl_lp_chk_keys" ).href = LINK_CHECKSUM_KEYS; - document.getElementById( "dl_lp_chk_keys" ).innerHTML = "KEYS"; - document.getElementById( "dl_lp_chk_keys" ).title = "KEYS signature file"; - document.getElementById( "space7" ).innerHTML = " , "; - document.getElementById( "dl_lp_chk_asc" ).href = LINK_CHECKSUM_ASC_LP; - document.getElementById( "dl_lp_chk_asc" ).innerHTML = "ASC"; - document.getElementById( "dl_lp_chk_asc" ).title = "ASC signature for: " + FILENAME_LP; - document.getElementById( "space8" ).innerHTML = " , "; - document.getElementById( "dl_lp_chk_md5" ).href = LINK_CHECKSUM_MD5_LP; - document.getElementById( "dl_lp_chk_md5" ).innerHTML = "MD5"; - document.getElementById( "dl_lp_chk_md5" ).title = "MD5 hash for: " + FILENAME_LP; - document.getElementById( "space9" ).innerHTML = " , "; - document.getElementById( "dl_lp_chk_sha256" ).href = LINK_CHECKSUM_SHA256_LP; - document.getElementById( "dl_lp_chk_sha256" ).innerHTML = "SHA256"; - document.getElementById( "dl_lp_chk_sha256" ).title = "SHA256 hash for: " + FILENAME_LP; - - // Set the values in the sub-green box on the right hand side. - document.getElementById( "dl_hlp" ).href = "full_vs_lp.html"; - document.getElementById( "dl_hlp" ).innerHTML = "What is a language pack?"; - document.getElementById( "dl_hlp" ).title = "What is the difference between full installation and language pack?"; - document.getElementById( "dl_hlp_img" ).src = "../cachedimages/help-information-icon.png"; - document.getElementById( "dl_hlp_img" ).title = "What is the difference between full installation and language pack?"; - document.getElementById( "dl_hlp_img" ).alt = "Info"; - document.getElementById( "dl_rpt" ).href = "analyze.html"; - document.getElementById( "dl_rpt" ).innerHTML = "Report broken link"; - document.getElementById( "dl_rpt" ).title = "Broken download link? Click here to report."; - document.getElementById( "dl_rpt_img" ).src = "../cachedimages/help-report-broken-link-icon.png"; - document.getElementById( "dl_rpt_img" ).title = "Broken download link? Click here to report."; - document.getElementById( "dl_rpt_img" ).alt = "Broken link"; - } - } else { - // If language is not supported, show the none-availability to the user. + showErrorMessage( error_text ); + return; + } + + // If language is not supported, show the none-availability to the user. + if( ! isLangSupported() ) { if( rel_mode == 1 ) { // Release mode // Provide the link from the Native Language (NL) group. @@ -1290,28 +1216,126 @@ function getLinkSel( rel_mode ) { LINK_FULL = "http://www.openoffice.org/download/all_beta.html"; LINK_LP = LINK_LP; } - // Reset the link, text and title of all elements that are not available. - resetSel(); + // Show an error message that the chosen items do not lead to a download. + error_text = [ "No full installation available", "Please select another language, platform or version.", + "No language pack available", "Please select another language, platform or version.", + "Apache OpenOffice " + VERSION_SEL + " for <b>" + RELEASE_MATRIX_LANG[ 1 ] + + " (" + RELEASE_MATRIX_LANG[ 2 ] + ")</b> is not available. " + + "<br />Please choose another language or version." ]; + showErrorMessage( error_text ); + return; + } else { + // If language is supported, assemble the filenames and text for download and checksums. + getFilesize( VERSION_SEL ); + getDLFilename( VERSION_SEL ); + + SOURCEFORGE_BASE_URL = SOURCEFORGE + VERSION_SEL + "/binaries/"; + APACHE_DIST_BASE_URL = APACHE_DIST + VERSION_SEL; + + // Assign the file name (column 3) from the release matrix of language and platform. + LINK_FULL = SOURCEFORGE_BASE_URL + LANG_SEL + "/" + FILENAME_FULL + "/download"; + LINK_LP = SOURCEFORGE_BASE_URL + LANG_SEL + "/" + FILENAME_LP + "/download"; - // Set the values for all elements that should not be empty. - text = "Apache OpenOffice " + VERSION_SEL + " for " + RELEASE_MATRIX_LANG[ 1 ]; - text = text + " (" + RELEASE_MATRIX_LANG[ 2 ] + ") is not available. "; - text = text + "<br />Please choose another language or version."; - document.getElementById( "dl_f_lnk" ).href = "javascript:void( 0 )"; - document.getElementById( "dl_f_lnk" ).innerHTML = "No full installation available"; - document.getElementById( "dl_f_lnk" ).title = "Please select another language or version."; - document.getElementById( "dl_lp_lnk" ).href = "javascript:void( 0 )"; - document.getElementById( "dl_lp_lnk" ).innerHTML = "No language pack available"; - document.getElementById( "dl_lp_lnk" ).title = "Please select another language or version."; - document.getElementById( "dl_f_hl" ).innerHTML = text; - - SF = false; - OTHER = true; - ARCHIVE = false; - ERROR = true; + LINK_CHECKSUM_KEYS = "https://people.apache.org/keys/group/openoffice.asc"; + LINK_CHECKSUM_ASC_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; + LINK_CHECKSUM_ASC_FULL = LINK_CHECKSUM_ASC_FULL + ".asc"; + LINK_CHECKSUM_MD5_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; + LINK_CHECKSUM_MD5_FULL = LINK_CHECKSUM_MD5_FULL + ".md5"; + LINK_CHECKSUM_SHA256_FULL = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_FULL; + LINK_CHECKSUM_SHA256_FULL = LINK_CHECKSUM_SHA256_FULL + ".sha256"; -// alertDbg( "getLinkSel()" ); + LINK_CHECKSUM_ASC_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; + LINK_CHECKSUM_ASC_LP = LINK_CHECKSUM_ASC_LP + ".asc"; + LINK_CHECKSUM_MD5_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; + LINK_CHECKSUM_MD5_LP = LINK_CHECKSUM_MD5_LP + ".md5"; + LINK_CHECKSUM_SHA256_LP = APACHE_DIST_BASE_URL + "/binaries/" + LANG_SEL + "/" + FILENAME_LP; + LINK_CHECKSUM_SHA256_LP = LINK_CHECKSUM_SHA256_LP + ".sha256"; + + SF = true; + OTHER = false; + ARCHIVE = false; + ERROR = false; + + text = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: "; + text = text + REL_DATE; + + // Set the values for the both download text buttons. + document.getElementById( "dl_f_lnk" ).href = LINK_FULL; + document.getElementById( "dl_f_lnk" ).innerHTML = "Download full installation"; + document.getElementById( "dl_f_lnk" ).title = "Click to download: " + FILENAME_FULL; + document.getElementById( "dl_lp_lnk" ).href = LINK_LP; + document.getElementById( "dl_lp_lnk" ).innerHTML = "Download language pack"; + document.getElementById( "dl_lp_lnk" ).title = "Click to download: " + FILENAME_LP; + + // Set the values in the sub-green box on the left hand side. + document.getElementById( "dl_rel_dta_hl" ).innerHTML = "Release data: "; + document.getElementById( "dl_rel_dta" ).innerHTML = text; + document.getElementById( "dl_f_hl" ).innerHTML = "Full installation: "; + document.getElementById( "dl_f_size_hl" ).innerHTML = "Filesize ~ "; + document.getElementById( "dl_f_size" ).innerHTML = FILESIZE_FULL + " MByte"; + document.getElementById( "space1" ).innerHTML = " | "; + document.getElementById( "dl_f_chk_hl" ).innerHTML = "Signatures and hashes: "; + document.getElementById( "dl_f_chk_keys" ).href = LINK_CHECKSUM_KEYS; + document.getElementById( "dl_f_chk_keys" ).innerHTML = "KEYS"; + document.getElementById( "dl_f_chk_keys" ).title = "KEYS signature file"; + document.getElementById( "space2" ).innerHTML = " , "; + document.getElementById( "dl_f_chk_asc" ).href = LINK_CHECKSUM_ASC_FULL; + document.getElementById( "dl_f_chk_asc" ).innerHTML = "ASC"; + document.getElementById( "dl_f_chk_asc" ).title = "ASC signature for: " + FILENAME_FULL; + document.getElementById( "space3" ).innerHTML = " , "; + document.getElementById( "dl_f_chk_md5" ).href = LINK_CHECKSUM_MD5_FULL; + document.getElementById( "dl_f_chk_md5" ).innerHTML = "MD5"; + document.getElementById( "dl_f_chk_md5" ).title = "MD5 hash for: " + FILENAME_FULL; + document.getElementById( "space4" ).innerHTML = " , "; + document.getElementById( "dl_f_chk_sha256" ).href = LINK_CHECKSUM_SHA256_FULL; + document.getElementById( "dl_f_chk_sha256" ).innerHTML = "SHA256"; + document.getElementById( "dl_f_chk_sha256" ).title = "SHA256 hash for: " + FILENAME_FULL; + document.getElementById( "space5" ).innerHTML = " , "; + document.getElementById( "dl_chk_verify" ).href = "../checksums.html"; + document.getElementById( "dl_chk_verify" ).innerHTML = "How to verify?"; + document.getElementById( "dl_chk_verify" ).title = "How to verify the download with checksums?"; + document.getElementById( "dl_lp_hl" ).innerHTML = "Language pack: "; + document.getElementById( "dl_lp_size_hl" ).innerHTML = "Filesize ~ "; + document.getElementById( "dl_lp_size" ).innerHTML = FILESIZE_LP + " MByte"; + document.getElementById( "space6" ).innerHTML = " | "; + document.getElementById( "dl_lp_chk_hl" ).innerHTML = "Signatures and hashes: "; + document.getElementById( "dl_lp_chk_keys" ).href = LINK_CHECKSUM_KEYS; + document.getElementById( "dl_lp_chk_keys" ).innerHTML = "KEYS"; + document.getElementById( "dl_lp_chk_keys" ).title = "KEYS signature file"; + document.getElementById( "space7" ).innerHTML = " , "; + document.getElementById( "dl_lp_chk_asc" ).href = LINK_CHECKSUM_ASC_LP; + document.getElementById( "dl_lp_chk_asc" ).innerHTML = "ASC"; + document.getElementById( "dl_lp_chk_asc" ).title = "ASC signature for: " + FILENAME_LP; + document.getElementById( "space8" ).innerHTML = " , "; + document.getElementById( "dl_lp_chk_md5" ).href = LINK_CHECKSUM_MD5_LP; + document.getElementById( "dl_lp_chk_md5" ).innerHTML = "MD5"; + document.getElementById( "dl_lp_chk_md5" ).title = "MD5 hash for: " + FILENAME_LP; + document.getElementById( "space9" ).innerHTML = " , "; + document.getElementById( "dl_lp_chk_sha256" ).href = LINK_CHECKSUM_SHA256_LP; + document.getElementById( "dl_lp_chk_sha256" ).innerHTML = "SHA256"; + document.getElementById( "dl_lp_chk_sha256" ).title = "SHA256 hash for: " + FILENAME_LP; + + // Set the values in the sub-green box on the right hand side. + document.getElementById( "dl_hlp" ).href = "full_vs_lp.html"; + document.getElementById( "dl_hlp" ).innerHTML = "What is a language pack?"; + document.getElementById( "dl_hlp" ).title = "What is the difference between full installation and language pack?"; + document.getElementById( "dl_hlp_img" ).src = "../cachedimages/help-information-icon.png"; + document.getElementById( "dl_hlp_img" ).title = "What is the difference between full installation and language pack?"; + document.getElementById( "dl_hlp_img" ).alt = "Info"; + document.getElementById( "dl_hlp_img2" ).src = "../cachedimages/help-information-icon.png"; + document.getElementById( "dl_hlp_img2" ).title = "What is the difference between full installation and language pack?"; + document.getElementById( "dl_hlp_img2" ).alt = "Info"; + document.getElementById( "dl_rpt" ).href = "analyze.html"; + document.getElementById( "dl_rpt" ).innerHTML = "Report broken link"; + document.getElementById( "dl_rpt" ).title = "Broken download link? Click here to report."; + document.getElementById( "dl_rpt_img" ).src = "../cachedimages/help-report-broken-link-icon.png"; + document.getElementById( "dl_rpt_img" ).title = "Broken download link? Click here to report."; + document.getElementById( "dl_rpt_img" ).alt = "Broken link"; + document.getElementById( "dl_rpt_img2" ).src = "../cachedimages/help-report-broken-link-icon.png"; + document.getElementById( "dl_rpt_img2" ).title = "Broken download link? Click here to report."; + document.getElementById( "dl_rpt_img2" ).alt = "Broken link"; } + // alertDbg( "getLinkSel()" ); return LINK_FULL; } @@ -1480,15 +1504,20 @@ function getPlatform() { ERROR = true; } + UI_PLATFORM = "Solaris SPARC (PKG)"; + URL_PLATFORM = ""; + EXTENSION = ""; + OLD_PLATFORM = true; + return URL_PLATFORM; } /* * Get file name for download file - * Depends on version, platform, language and extension + * Depends on version and array-list of "release_matrix.js" */ -function getFilename( ver ) { - +function getDLFilename( ver ) { + // Depending on $ver, a different release matrix has to be used to assemble the download filenames. switch( ver ) { case "4.1.0": // Assemble the filename for download from the release matrix of language and platform (column 0). @@ -1536,11 +1565,63 @@ function getFilename( ver ) { } /* + * Get file name for download file + * Depends on version and array-list of "release_matrix.js" + */ +function getChkFilename( ver ) { + // Depending on $ver, a different release matrix has to be used to assemble the checksum filenames. + switch( ver ) { + case "4.1.0": + // Assemble the filename for checksum from the release matrix of language and platform (column 0). + // Product name + version + platform as URL part + language ISO + file extension. + FILENAME_FULL = "Apache_OpenOffice_" + ver + "_"; + FILENAME_FULL = FILENAME_FULL + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 0 ]; + FILENAME_FULL = FILENAME_FULL + "_" + LANG_ISO + EXTENSION; + FILENAME_LP = "Apache_OpenOffice_" + ver + "_"; + FILENAME_LP = FILENAME_LP + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 0 ]; + FILENAME_LP = FILENAME_LP + "_" + LANG_ISO + EXTENSION; + break; + case "4.0.1": + // Assemble the filename for checksum from the release matrix of language and platform (column 0). + // Product name + version + platform as URL part + language ISO + file extension. + FILENAME_FULL = "Apache_OpenOffice_" + ver + "_"; + FILENAME_FULL = FILENAME_FULL + release_matrix_401[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 0 ]; + FILENAME_FULL = FILENAME_FULL + "_" + LANG_ISO + EXTENSION; + FILENAME_LP = "Apache_OpenOffice_" + ver + "_"; + FILENAME_LP = FILENAME_LP + release_matrix_401[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 0 ]; + FILENAME_LP = FILENAME_LP + "_" + LANG_ISO + EXTENSION; + break; + case "4.0.0": + // Todo: Implement a "release_matrix_400" array in the "release_matrix.js" file. + FILENAME_FULL = "4.0.0 file names are not yet available"; + FILENAME_LP = "4.0.0 file names are not yet available"; + break; + default: + FILENAME_FULL = ""; + FILENAME_LP = ""; + ERROR = true; + } +/* + // Assemble the filename for checksum from the release matrix of language and platform (column 0). + // Product name + version + platform as URL part + language ISO + file extension. + FILENAME_FULL = "Apache_OpenOffice_" + ver + "_"; + FILENAME_FULL = FILENAME_FULL + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_FULL ][ 0 ]; + FILENAME_FULL = FILENAME_FULL + "_" + LANG_ISO + EXTENSION; + FILENAME_LP = "Apache_OpenOffice_" + ver + "_"; + FILENAME_LP = FILENAME_LP + release_matrix_410[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS_LP ][ 0 ]; + FILENAME_LP = FILENAME_LP + "_" + LANG_ISO + EXTENSION; +*/ +// alert( ver + "\n\n" + FILENAME_FULL + "\n\n" + FILENAME_LP ); + + return FILENAME_FULL; +} + +/* * Get file size for download file - * Depends on array-list and "release_matrix.js" + * Depends on platform, version and array-list of "release_matrix.js" */ function getFilesize( ver ) { - // Depending on $URL_PLATFORM assign the platform position of the release matrix. + // Depending on $URL_PLATFORM, assign the platform position from the release matrix. switch( URL_PLATFORM ) { case "Linux_x86-64_install-deb": case "Linux_x86-64_langpack-deb": @@ -1585,6 +1666,7 @@ function getFilesize( ver ) { // 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 ) { + // Depending on $ver, a different release matrix has to be used to get the filesizes. switch( ver ) { case "4.1.0": // Assign all values from the release matrix of language and platform. @@ -1620,11 +1702,11 @@ function getFilesize( ver ) { // 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 { FILESIZE_FULL = 0; FILESIZE_LP = 0; ERROR = true; -*/ } return FILESIZE_FULL;