Author: marcus
Date: Fri Feb 20 18:37:55 2015
New Revision: 1661185

URL: http://svn.apache.org/r1661185
Log:
Fixed typo

Modified:
    openoffice/ooo-site/trunk/content/download/download_url.js

Modified: openoffice/ooo-site/trunk/content/download/download_url.js
URL: 
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/download_url.js?rev=1661185&r1=1661184&r2=1661185&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/download_url.js (original)
+++ openoffice/ooo-site/trunk/content/download/download_url.js Fri Feb 20 
18:37:55 2015
@@ -1,6 +1,8 @@
 /*
  * Overview of all methods (functions) of the global object "DL"
  * -------------------------------------------------------------
+ * function DL.createIndexOf           ()
+ * function DL.getURLQuery             ()
  * function DL.init                    ( release_mode )
  * function DL.initVariables           ( init_all )
  * function DL.getLanguage             ()
@@ -29,50 +31,41 @@
  * function openItem                   ( itemid, uri )
  */
 
-/*
- * Init function
- * @param:  release_mode - The release mode (stable, beta, etc.) that the 
scriping should work with
- * @return: None
- */
-DL.init = function( release_mode ) {
-       // Set global variables.
-       DL.initVariables( 1 );
 
-       // Parse the browser URL for an ISO code as language.
-       var query = DL.getURLQuery();
-       if ( query ) {
-               DL.URL_LANG = query;
-       }
 
-       // Fill the OS, language and version select boxes.
-       DL.fillOSSelection();
-       DL.fillLanguageSelection();
-       DL.fillVersionSelection();
-
-       // Get the language and platform from the browser data.
-       DL.getLanguage();
-       DL.getPlatform();
-
-       // Set the recognized platform and language as default.
-       DL.setOSSelection();
-       DL.setLanguageSelection();
-       DL.setVersionSelection();
-
-       
-       // When release mode = 2, it is a beta release. Otherwise assume 
"stable release" as default.
-       if( release_mode === 2 ) {
-               DL.RELEASE_MODE = mode;
+/*
+ * Create the "indexOf" function when the browser does not support it
+ * @param:  None
+ * @return: i - The value from the index position of the array
+ */
+DL.createIndexOf = function() {
+       // Add ECMA262-5 array methods if not supported natively.
+       // To workaround that MSIE 8 and older do not support this function.
+       if( !( 'indexOf' in Array.prototype ) ) {
+               Array.prototype.indexOf= function( find, i ) {          // 'i' 
is an optional parameter.
+                       if( i === undefined ) {
+                               i = 0;
+                       }
+                       if( i < 0 ) {
+                               i+= this.length;
+                       }
+                       if( i < 0 ) {
+                               i = 0;
+                       }
+                       for( var n = this.length; i < n; i++ ) {
+                               if( i in this && this[ i ] === find ) {
+                                       return i;
+                               }
+                       }
+                       return -1;
+               };
        }
-
-       DL.getLinkSelection();
-
-       return;
 }
 
 /*
  * Get the value from an browser URL query
  * @param:  None
- * @return: q_value - The value from the browser URL query 
+ * @return: q_value - The value from the browser URL query
  */
 DL.getURLQuery = function() {
        // Parse the URL for a query if it contains a value that should be used 
as an language ISO code.
@@ -84,6 +77,9 @@ DL.getURLQuery = function() {
                return "";
        }
 
+       // Create the "indexOf" function when the browser does not support it.
+       DL.createIndexOf();
+
        var query               = new Object();
        var q_pair              = window.location.search.substring( 1 ).split( 
"?" );
        var position            = 0;
@@ -116,6 +112,46 @@ DL.getURLQuery = function() {
 }
 
 /*
+ * Init function
+ * @param:  release_mode - The release mode (stable, beta, etc.) that the 
scriping should work with
+ * @return: None
+ */
+DL.init = function( release_mode ) {
+       // Set global variables.
+       DL.initVariables( 1 );
+
+       // Parse the browser URL for an ISO code as language.
+       var query = DL.getURLQuery();
+       if ( query ) {
+               DL.URL_LANG = query;
+       }
+
+       // Fill the OS, language and version select boxes.
+       DL.fillOSSelection();
+       DL.fillLanguageSelection();
+       DL.fillVersionSelection();
+
+       // Get the language and platform from the browser data.
+       DL.getLanguage();
+       DL.getPlatform();
+
+       // Set the recognized platform and language as default.
+       DL.setOSSelection();
+       DL.setLanguageSelection();
+       DL.setVersionSelection();
+
+       
+       // When release mode = 2, it is a beta release. Otherwise assume 
"stable release" as default.
+       if( release_mode === 2 ) {
+               DL.RELEASE_MODE = mode;
+       }
+
+       DL.getLinkSelection();
+
+       return;
+}
+
+/*
  * Define all global variables with default values
  * @param:  init_all - Should all variables initialized or just a part?
  * @return: None
@@ -654,7 +690,8 @@ DL.isLanguageSupported = function() {
        }
 
        // If VERSION != "4.x.y" then exit.
-       if( DL.VERSION_SEL === "3.4.1" || DL.VERSION_SEL === "older" || 
DL.VERSION_SEL === "other" ) {
+       if( DL.VERSION_SEL === "3.4.1" || DL.VERSION_SEL === "other"
+           || DL.VERSION_SEL === "older" || DL.VERSION_SEL === "source" ) {
                DL.ERROR = false;
                return false;
        }
@@ -825,6 +862,23 @@ DL.checkForLinkExceptions = function() {
                DL.SHOW_SUB_BOX = false;
        }
 
+       // If version is 'source', create a download link that leads to the 
project webpage.
+       if( DL.VERSION_SEL === "source" ) {
+               // In general, hide the data for link, text and title of all 
elements.
+               DL.hideElements();
+
+               // Set the values for the single download text button.
+               document.getElementById( "dl_f_link"    ).href          = 
l10n.dl_source_link;
+               document.getElementById( "dl_f_link"    ).innerHTML     = 
l10n.dl_full_link_source_text;
+               document.getElementById( "dl_f_link"    ).title         = 
l10n.dl_full_link_source_title;
+               document.getElementById( "dl_f_link"    ).style.cursor  = 
"pointer";
+               document.getElementById( "dl_f_link"    ).style.display = 
"inline";
+               document.getElementById( "dl_lp_link"   ).style.display = 
"none";
+               document.getElementById( "sub_box"      ).style.display = 
"none";
+
+               DL.SHOW_SUB_BOX = false;
+       }
+
        return;
 }
 
@@ -861,7 +915,7 @@ DL.getLinkSelection = function() {
                DL.LINK_LP              = DL.SF_BASE_URL                     + 
DL.LANG_SEL + "/" + DL.FILENAME_LP   + "/download";
 
                // Assign the checksum links: Base link + language + file name.
-               DL.LINK_CHK_KEYS             = 
"http://people.apache.org/keys/group/openoffice.asc";;
+               DL.LINK_CHK_KEYS             = 
"people.apache.org/keys/group/openoffice.asc";
                DL.LINK_CHK_ASC_FULL    = DL.ASF_ARC_BASE_URL + "/binaries/" + 
DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".asc";
                DL.LINK_CHK_MD5_FULL    = DL.ASF_ARC_BASE_URL + "/binaries/" + 
DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".md5";
                DL.LINK_CHK_SHA256_FULL = DL.ASF_ARC_BASE_URL + "/binaries/" + 
DL.LANG_SEL + "/" + DL.FILENAME_FULL + ".sha256";
@@ -1015,7 +1069,7 @@ DL.getPlatform = function() {
        DL.PLATFORM             = "";                                   // 
Delete previously set string.
        DL.EXTENSION            = "";                                   // 
Delete previously set string.
 
-       // Add ECMA262-5 Array methods if not supported natively.
+       // Add ECMA262-5 array methods if not supported natively.
        // To workaround that MSIE 8 and older do not support this function.
        if( !( 'indexOf' in Array.prototype ) ) {
                Array.prototype.indexOf= function( find, i ) {          // 'i' 
is an optional parameter.


Reply via email to