Author: marcus
Date: Sat Feb  8 19:00:45 2014
New Revision: 1566097

URL: http://svn.apache.org/r1566097
Log:
Added logic to recognize platforms that are too old, e.g., Mac OS X 10.6 and 
older

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=1566097&r1=1566096&r2=1566097&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Sat Feb  8 
19:00:45 2014
@@ -11,22 +11,23 @@
 /*
  * Define global variables
  */
-var LANG_ISO                           = "";   // The language as ISO code
-var LANG_ARRAY                         = "";   // This array contains all 
language specific data
-var LANG_NAME                          = "";   // The language as its native 
name
-var RELEASE_MATRIX_PLATFORM_POS                = -1;   // The position of the 
platform in the release matrix array
-var RELEASE_MATRIX_PLATFORM            = "";   // The platform in the release 
matrix array
-var UI_PLATFORM                                = "";   // The platform as 
readable string
-var URL_PLATFORM                       = "";   // The platform as part of the 
download URL
-var FILENAME                           = "";   // The complete filename of the 
download URL
-var FILESIZE                           = 0;    // The filesize of the download 
file
-var EXTENSION                          = "";   // The file extension of the 
download URL
-var LINK                               = "";   // The complete download URL
-var CHECKSUM_KEYS                      = "";   // The KEYS file as download URL
-var CHECKSUM_ASC                       = "";   // The ASC file as download URL
-var CHECKSUM_MD5                       = "";   // The MD5 file as download URL
-var CHECKSUM_SHA256                    = "";   // The SHA256 file as download 
URL
-var ERROR                              = false; // The download URL is correct 
(false) or not (true)?
+var LANG_ISO                           = "";           // The language as ISO 
code
+var LANG_ARRAY                         = "";           // This array contains 
all language specific data
+var LANG_NAME                          = "";           // The language as its 
native name
+var RELEASE_MATRIX_PLATFORM_POS                = -1;           // The position 
of the platform in the release matrix array
+var RELEASE_MATRIX_PLATFORM            = "";           // The platform in the 
release matrix array
+var UI_PLATFORM                                = "";           // The platform 
as readable string
+var URL_PLATFORM                       = "";           // The platform as part 
of the download URL
+var OLD_PLATFORM                       = false;        // The browser platform 
is old (true) or not (false)
+var FILENAME                           = "";           // The complete 
filename of the download URL
+var FILESIZE                           = 0;            // The filesize of the 
download file
+var EXTENSION                          = "";           // The file extension 
of the download URL
+var LINK                               = "";           // The complete 
download URL
+var CHECKSUM_KEYS                      = "";           // The KEYS file as 
download URL
+var CHECKSUM_ASC                       = "";           // The ASC file as 
download URL
+var CHECKSUM_MD5                       = "";           // The MD5 file as 
download URL
+var CHECKSUM_SHA256                    = "";           // The SHA256 file as 
download URL
+var ERROR                              = false;        // The download URL is 
correct (false) or not (true)?
 
 /*
  * Initialize the download script and set all global variables with data
@@ -147,14 +148,12 @@ function getLink() {
        */
 
        if ( hasMirrorLink() ) {
-               // If platform is Mac OS X 10.6 or older, then do not provide a 
download link.
+               // If platform is too old (e.g., Mac OS X 10.6 or older), then 
do not provide a download link.
                // But instead link to an AOO file in the archive.
-               if ( URL_PLATFORM == "OS X 32-bit Intel (DMG)" ) {
-                       if ( UI_PLATFORM == "MacOS X (<= 10.6) 32-bit Intel 
(DMG)" ) {
-                               LINK  = 
"http://www.openoffice.org/download/other.html";;
-                               ERROR = true;
-                               return LINK;
-                       }
+               if ( OLD_PLATFORM ) {
+                       LINK  = "http://archive.apache.org/dist/openoffice/";;
+                       ERROR = true;
+                       return LINK;
                }
 
                if ( URL_PLATFORM == "" ) {
@@ -332,6 +331,7 @@ function getPlatform() {
          if ( os.indexOf( "mac"                ) != -1 ) {     UI_PLATFORM     
= "OS X 32-bit Intel (DMG)";
                                                                URL_PLATFORM    
= "Mac_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 ||
@@ -339,7 +339,8 @@ function getPlatform() {
                 ua.indexOf( "10.4"             ) != -1 ||
                 ua.indexOf( "10_4"             ) != -1 ||
                 ua.indexOf( "10.3"             ) != -1 ||
-                ua.indexOf( "10_3"             ) != -1 ) {     UI_PLATFORM     
= "MacOS X (<= 10.6) 32-bit Intel (DMG)";
+                ua.indexOf( "10_3"             ) != -1 ) {     UI_PLATFORM     
= "MacOS X (10.6 or older)";
+                                                               OLD_PLATFORM    
= true;
            }
          } 
        } 


Reply via email to