You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ma...@apache.org on 2014/03/25 22:50:51 UTC
svn commit: r1581544 -
/openoffice/ooo-site/trunk/content/download/test/download.js
Author: marcus
Date: Tue Mar 25 21:50:50 2014
New Revision: 1581544
URL: http://svn.apache.org/r1581544
Log:
First check if browser language is available for Beta release but not for stable release, then check if language build is available on mirror
Modified:
openoffice/ooo-site/trunk/content/download/test/download.js
Modified: openoffice/ooo-site/trunk/content/download/test/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download.js?rev=1581544&r1=1581543&r2=1581544&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Tue Mar 25 21:50:50 2014
@@ -2,9 +2,9 @@
* Overview of all functions defined below
* ---------------------------------------
* function getLanguage ()
- * function hasMirrorLink ()
- * function getLink ()
- * function getPlatform ()
+ * function hasMirrorLink ( rel_mode )
+ * function getLink ( rel_mode )
+ * function getPlatform ( rel_mode )
* function openItem ( itemid, uri )
*/
@@ -108,13 +108,42 @@ function getLanguage() {
* Get flag for mirror link
* Depends on array-list
*/
-function hasMirrorLink() {
- // Check the flag in "languages.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage
+function hasMirrorLink( rel_mode ) {
+
+ if ( rel_mode == 0 ) {
+ // 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;
+ }
+ }
+
+/*
if ( LANG_ARRAY[ 3 ] == 'y' )
return true;
else
ERROR = true;
return false;
+*/
}
/*
@@ -130,7 +159,16 @@ function getLink( rel_mode ) {
getLanguage();
getPlatform( rel_mode );
- if ( hasMirrorLink() ) {
+/*
+ document.write ( "Language ISO: " + LANG_ISO + " - has MirrorLink( rel_mode )?: " + hasMirrorLink( rel_mode )
+ + "<br />"
+ + "SourceForge: " + SOURCEFORGE + " - Other: " + OTHER + " - Archive: " + ARCHIVE
+ + "<br />"
+ + "UI_PLATFORM: " + UI_PLATFORM + " - URL_PLATFORM: " + URL_PLATFORM + " - EXTENSION: " + EXTENSION
+ + "<br />"
+ + "LINK: " + LINK );
+*/
+ if ( hasMirrorLink( rel_mode ) ) {
getFilesize( rel_mode );
}
/*
@@ -144,7 +182,7 @@ function getLink( rel_mode ) {
*/
// If language is supported, then provide a download link.
- if ( hasMirrorLink() ) {
+ if ( hasMirrorLink( rel_mode ) ) {
// Release mode
if ( rel_mode == 0 ) {
// If platform is too old, then provide a general download link to the archive.