Author: marcus Date: Thu May 29 12:49:20 2014 New Revision: 1598282 URL: http://svn.apache.org/r1598282 Log: Updated variables and return statements
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=1598282&r1=1598281&r2=1598282&view=diff ============================================================================== --- openoffice/ooo-site/trunk/content/download/test/download_droplist.js (original) +++ openoffice/ooo-site/trunk/content/download/test/download_droplist.js Thu May 29 12:49:20 2014 @@ -92,13 +92,13 @@ function initVars() { // LINK = ""; // The complete download URL LINK_FULL = ""; // The complete download URL (for full installation) LINK_LP = ""; // The complete download URL (for language pack) - LINK_CHECKSUM_KEYS = ""; // The KEYS file as download URL - LINK_CHECKSUM_ASC_FULL = ""; // The ASC file as download URL (for full installation) - LINK_CHECKSUM_MD5_FULL = ""; // The MD5 file as download URL (for full installation) - LINK_CHECKSUM_SHA256_FULL = ""; // The SHA256 file as download URL (for full installation) - LINK_CHECKSUM_ASC_LP = ""; // The ASC file as download URL (for language pack) - LINK_CHECKSUM_MD5_LP = ""; // The MD5 file as download URL (for language pack) - LINK_CHECKSUM_SHA256_LP = ""; // The SHA256 file as download URL (for language pack) + LINK_CHK_KEYS = ""; // The KEYS file as download URL + LINK_CHK_ASC_FULL = ""; // The ASC file as download URL (for full installation) + LINK_CHK_MD5_FULL = ""; // The MD5 file as download URL (for full installation) + LINK_CHK_SHA256_FULL = ""; // The SHA256 file as download URL (for full installation) + LINK_CHK_ASC_LP = ""; // The ASC file as download URL (for language pack) + LINK_CHK_MD5_LP = ""; // The MD5 file as download URL (for language pack) + LINK_CHK_SHA256_LP = ""; // The SHA256 file as download URL (for language pack) SOURCEFORGE_BASE_URL = ""; // The base URL for all binary files on Sourceforge SOURCEFORGE_PREV_URL = ""; // The base URL for all binary files (prev. version) on Sourceforge ASF_BASE_URL = ""; // The base URL for all binary files on Apache @@ -110,8 +110,6 @@ function initVars() { OTHER = false; // Does the download URL points to 'other.html'? ARCHIVE = false; // Does the download URL points to the ASF archive? ERROR = false; // Is the download URL in general correct (false) or not (true)? - - return; } /* @@ -181,7 +179,7 @@ function getLanguage() { thisLanguage = thisLanguageSet[ regionCode ]; } else { // Choose the default langCode - thisLanguage = thisLanguageSet[ "-" ]; + var thisLanguage = thisLanguageSet[ "-" ]; if( languageCode == "en" ) { // Special case, default is en-US for en-XX language = "en-US"; @@ -238,8 +236,6 @@ function fillOSSel() { // Set the recognized platform as default. // setOSSel(); - - return; } /* @@ -279,7 +275,6 @@ function fillLangSel() { sel_lang.appendChild( option ); } */ - return; } /* @@ -303,8 +298,6 @@ function fillVerSel() { // Set the version from the $VERSION variable as default. // setVerSel(); - - return; } /* @@ -646,7 +639,7 @@ function getOSSel() { + "\n\n" + "" ); */ - return; + return PLATFORM_SEL; } /* @@ -708,7 +701,7 @@ function getLangSel() { + "\n\n" + "" ); */ - return; + return LANG_SEL; } /* @@ -736,7 +729,7 @@ function getVerSel() { } } - return; + return VERSION_SEL; } /* @@ -761,7 +754,7 @@ function getTypeSel() { TYPE = ""; } - return; + return TYPE; } /* @@ -887,7 +880,6 @@ function resetSel() { document.getElementById( "dl_rpt_img" ).title = ""; document.getElementById( "dl_rpt_img" ).alt = ""; */ - return; } /* @@ -936,7 +928,7 @@ function showErrorMessage( error_text ) ARCHIVE = false; ERROR = true; - return; + return ERROR; } /* @@ -1136,7 +1128,7 @@ function getLink( rel_mode ) { * Depends on chosen OS, language and type */ function getLinkSel( rel_mode ) { - var error_text = ""; + var error_text, rel_text = ""; // Reset all error flags. SF = false; @@ -1171,7 +1163,18 @@ function getLinkSel( rel_mode ) { return; } */ - // If version is '4.1.0' (or newer) + platform is 'Mac OS X <= 10.6', show the none-availability to the user. + // If recognized platform is not Windows, Linux or Mac, show the none-availability to the user. + if( UI_PLATFORM_NO_SUP != "" ) { + // Show an error message that the chosen items do not lead to a download. + error_text = "Apache OpenOffice " + VERSION_SEL + " is not available for <b>" + UI_PLATFORM_NO_SUP + "</b>." + + "<br />Please select a download for Windows, Linux or OS X."; + + showErrorMessage( error_text ); + + return ERROR; + } + + // If version is '4.1.0' (or newer) and 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 = "Apache OpenOffice " + VERSION_SEL + " is not available for <b>" + UI_PLATFORM + "</b>." @@ -1179,10 +1182,10 @@ function getLinkSel( rel_mode ) { showErrorMessage( error_text ); - return; + return ERROR; } - // If version is '4.0.1' (or older) + platform is 'Mac OS X => 10.7', show the none-availability to the user. + // If version is '4.0.1' (or older) and 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 = "Apache OpenOffice " + VERSION_SEL + " is not available for <b>" + UI_PLATFORM + "</b>." @@ -1190,18 +1193,7 @@ function getLinkSel( rel_mode ) { showErrorMessage( error_text ); - return; - } - - // If recognized platform is not 'Windows', 'Linux' or 'Mac', show the none-availability to the user. - if( UI_PLATFORM_NO_SUP != "" ) { - // Show an error message that the chosen items do not lead to a download. - error_text = "Apache OpenOffice " + VERSION_SEL + " is not available for <b>" + UI_PLATFORM_NO_SUP + "</b>." - + "<br />Please select a download for Windows, Linux or OS X."; - - showErrorMessage( error_text ); - - return; + return ERROR; } // If language is not supported, show the none-availability to the user. @@ -1223,9 +1215,10 @@ function getLinkSel( rel_mode ) { // Show an error message that the chosen items do not lead to a download. error_text = "Apache OpenOffice " + VERSION_SEL + " is not available for <b>" + RELEASE_MATRIX_LANG[ 1 ] + " (" + RELEASE_MATRIX_LANG[ 2 ] + ")</b>.<br />Please choose another language or version."; + showErrorMessage( error_text ); - return; + return ERROR; } else { // If language is supported, assemble the filenames and text for download and checksums. @@ -1264,7 +1257,7 @@ function getLinkSel( rel_mode ) { ARCHIVE = false; ERROR = false; - text = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: " + REL_DATE; + rel_text = "Milestone " + MILESTONE + " | Build ID " + BUILD + " | SVN " + SVN_REV + " | Released: " + REL_DATE; // Set the values for the both download text buttons. document.getElementById( "dl_f_lnk" ).href = LINK_FULL; @@ -1276,7 +1269,7 @@ function getLinkSel( rel_mode ) { // 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_rel_dta" ).innerHTML = rel_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"; @@ -1457,7 +1450,7 @@ function getPlatform() { // If $UI_PLATFORM_NO_SUP is already filled, something was recognized and no more work is needed. if( UI_PLATFORM_NO_SUP != "" ) - return; + return URL_PLATFORM; // Windows? if( os.indexOf( "win" ) != -1 || @@ -1804,7 +1797,5 @@ function alertDbg( location ) { + "ARCHIVE: " + "\t\t\t\t\t\t\t" + ARCHIVE + "\n" + "ERROR: " + "\t\t\t\t\t\t\t" + ERROR + "\n" + "" ); - - return; }