Author: marcus
Date: Mon Jul 29 18:35:12 2013
New Revision: 1508169

URL: http://svn.apache.org/r1508169
Log:
Fixed JS errors, updated 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=1508169&r1=1508168&r2=1508169&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Mon Jul 29 
18:35:12 2013
@@ -36,24 +36,26 @@ function getLanguage() {
                language = navigator.language;
        else if ( navigator.userLanguage )
                language = navigator.userLanguage;
+       else if ( navigator.browserLanguage )
+               language = navigator.browserLanguage;
        else if ( navigator.systemLanguage )
                language = navigator.systemLanguage;
 
-       // Convert "en" to "en-US" as well since en-US build is the canonical 
translation, and thus better tested.
+       // Convert "en" to "en-US" as well as setting it as fall-back language
        if ( !language || language == "" || language == "null" || language == 
"en" )
                language = "en-US";
        if ( language == "pt" )
                language = "pt-PT";
 
-       // Konqueror uses '_' where other browsers use '-'.
+       // Konqueror uses '_' where other browsers use '-'
        if ( language.indexOf( "_" ) != -1 )
                language = language.split( "_" ).join( "-" );
 
        language                = language.toLowerCase();
        var languageCode        = language.split( "-" )[ 0 ];
        var regionCode          = language.split( "-" )[ 1 ];
-
        var thisLanguageSet     = languages[ languageCode ];
+
        if ( thisLanguageSet == null ) {
                // Language code not found inside array
                language        = "en-US";
@@ -100,9 +102,6 @@ function getLanguage() {
  * Depends on array-list
  */
 function hasMirrorLink() {
-       // if ( URL_PLATFORM == "" )
-       //      return false;
-
        // Check the flag in "languages.js", 'y' -> provide download link, 'n' 
-> redirect to alternative webpage
        if ( LANG_ARRAY[ 3 ] == 'y' )
                return true;
@@ -153,7 +152,6 @@ function getLink() {
                        CHECKSUM_MD5    = chk_link + ".md5";
                        CHECKSUM_SHA256 = chk_link + ".sha256";
                }
-//             return "http://www.openoffice.org/download/other.html";;
                return file_link;
 
                /*
@@ -171,7 +169,7 @@ function getLink() {
 
 /*
  * Get platform of browser
- * Depending on what is recognized from browser's data for platform and 
user-agent
+ * Depending on internal browser data
  */
 function getPlatform() {
        // For more help or data see: "http://www.useragentstring.com";
@@ -204,12 +202,13 @@ function getPlatform() {
 
          if ( os.indexOf( "arm"                ) != -1 )       UI_PLATFORM     
= "ARM mobile/tablet devices";
 
-         if ( ua.indexOf( "ppc"                ) != -1 )       UI_PLATFORM     
= "Mac OS PPC (DMG)";
+         if ( ua.indexOf( "ppc"                ) != -1 ||
+              ua.indexOf( "power_pc"           ) != -1 )       UI_PLATFORM     
= "Mac OS PPC (DMG)";
          if ( ua.indexOf( "iphone"             ) != -1 ||
               ua.indexOf( "ipad"               ) != -1 ||
-              ua.indexOf( "ipod"               ) != -1 )       UI_PLATFORM     
= "Apple mobile devices (iPhone/iPad/iPod)";
+              ua.indexOf( "ipod"               ) != -1 )       UI_PLATFORM     
= "Apple mobile devices (iPhone/iPad/iPod)";
          if ( ua.indexOf( "android"            ) != -1 ||
-            ( av.indexOf( "android"            ) != -1 )       UI_PLATFORM     
= "Android mobile/tablet devices";      
+              av.indexOf( "android"            ) != -1 )       UI_PLATFORM     
= "Android mobile/tablet devices";      
          if ( ua.indexOf( "blackberry"         ) != -1 )       UI_PLATFORM     
= "Blackberry smartphones";
          if ( ua.indexOf( "nokia"              ) != -1 )       UI_PLATFORM     
= "Nokia mobile devices";
          if ( ua.indexOf( "symbian"            ) != -1 )       UI_PLATFORM     
= "mobile phones with Symbian OS";


Reply via email to