Author: marcus
Date: Sun Aug 11 20:33:32 2013
New Revision: 1512999

URL: http://svn.apache.org/r1512999
Log:
Updated code and comments

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=1512999&r1=1512998&r2=1512999&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Sun Aug 11 
20:33:32 2013
@@ -29,7 +29,7 @@ var CHECKSUM_SHA256                   = "";
 var ERROR                              = false;
 
 /*
- * Initialize the download script and set all global variables with data
+ * Initialize the download script
  */
 function initializeDL() {
        getLanguage();
@@ -40,7 +40,7 @@ function initializeDL() {
 
 /*
  * Get array and ISO code for language
- * Depends on nl_language
+ * Depends on $NL_LANGUAGE
  */
 function getLanguage() {
        var language = "";
@@ -209,9 +209,8 @@ function getPlatform() {
          if ( os.indexOf( "sunos"              ) != -1 ) {     UI_PLATFORM     
= "Solaris x86 (PKG)";
            if ( ua.indexOf( "sun4u"            ) != -1 )       UI_PLATFORM     
= "Solaris SPARC (PKG)";
          }
-         if ( os.indexOf( "freebsd"            ) != -1 )       UI_PLATFORM     
= "FreeBSD (PKG)";
          if ( os.indexOf( "os/2"               ) != -1 )       UI_PLATFORM     
= "OS/2";
-         if ( os.indexOf( "freebsd"            ) != -1 )       UI_PLATFORM     
= "FreeBSD";
+         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";
@@ -253,7 +252,7 @@ function getPlatform() {
          if ( ua.indexOf( "nintendo"           ) != -1 )       UI_PLATFORM     
= "Nintendo game console";
          if ( ua.indexOf( "wii"                ) != -1 )       UI_PLATFORM     
= "Wii game console";
 
-         // If variable is already filled, then something was recognized and 
no more work is need
+         // If the $UI_PLATFORM variable is already filled, then something was 
recognized and no more work is need
          if ( UI_PLATFORM ) {
            return;
          }
@@ -267,11 +266,14 @@ function getPlatform() {
                 ua.indexOf( "mobile"           ) != -1 )       UI_PLATFORM     
= "Windows Mobile device";
          }
 
-         // Linux, x86 or x86_64, DEB or RPM?
+         // Linux?
          if ( os.indexOf( "linux"              ) != -1 ) {
+           // 32-bit, DEB or RPM?
            if ( os.indexOf( "x86"              ) != -1 ||
-                os.indexOf( "i686"             ) != -1 ) {     UI_PLATFORM     
= "Linux 32-bit (RPM)";
-                                                            // UI_PLATFORM     
= "Linux 32-bit (RPM/DEB ?)";
+                os.indexOf( "i686"             ) != -1 ||
+                os.indexOf( "i586"             ) != -1 ||
+                os.indexOf( "i486"             ) != -1 ||
+                os.indexOf( "i386"             ) != -1 ) {     UI_PLATFORM     
= "Linux 32-bit (RPM)";
                                                                URL_PLATFORM    
= "Linux_x86_install-rpm";
                                                                EXTENSION       
= ".tar.gz";
              if ( ua.indexOf( "debian"         ) != -1 ||
@@ -281,9 +283,10 @@ function getPlatform() {
                                                                EXTENSION       
= ".tar.gz";
              }
            }
-           if ( os.indexOf( "_64"              ) != -1 ||
-                os.indexOf( "-64"              ) != -1 ) {     UI_PLATFORM     
= "Linux 64-bit (RPM)";
-                                                            // UI_PLATFORM     
= "Linux 64-bit (RPM/DEB ?)";
+           // 64-bit, DEB or RPM?
+           if ( os.indexOf( "x86_64"           ) != -1 ||
+                os.indexOf( "x86-64"           ) != -1 ||
+                os.indexOf( "amd64"            ) != -1 ) {     UI_PLATFORM     
= "Linux 64-bit (RPM)";
                                                                URL_PLATFORM    
= "Linux_x86-64_install-rpm";
                                                                EXTENSION       
= ".tar.gz";
              if ( ua.indexOf( "debian"         ) != -1 ||
@@ -295,14 +298,14 @@ function getPlatform() {
            }
          }
 
-         // Mac OS x86
+         // Mac OS x86?
          if ( os.indexOf( "mac"                ) != -1 ) {     UI_PLATFORM     
= "Mac OS 32-bit Intel (DMG)";
                                                                URL_PLATFORM    
= "Mac_x86_install";
                                                                EXTENSION       
= ".dmg";
          } 
        } 
 
-       // If variable is not filled until now, then nothing was recognized, 
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 ) {
                ERROR = true;
                UI_PLATFORM = "an unknown platform/OS";
@@ -315,7 +318,7 @@ function getPlatform() {
  * Depends on array-list
  */
 function getFilesize() {
-       // Depending on URL_PLATFORM assign the platform position of the 
release matrix
+       // Depending on $URL_PLATFORM assign the platform position of the 
release matrix
        switch ( URL_PLATFORM ) {
                case "Linux_x86-64_install-deb":
                        RELEASE_MATRIX_PLATFORM_POS = 0;


Reply via email to