Author: marcus
Date: Sat May 31 19:09:19 2014
New Revision: 1598902

URL: http://svn.apache.org/r1598902
Log:
Implemented an analyze mode to support the 'analyze.html'

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

Modified: openoffice/ooo-site/trunk/content/download/test/download_droplist.js
URL: 
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download_droplist.js?rev=1598902&r1=1598901&r2=1598902&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download_droplist.js 
(original)
+++ openoffice/ooo-site/trunk/content/download/test/download_droplist.js Sat 
May 31 19:09:19 2014
@@ -19,7 +19,7 @@
  * function showErrorMessage   ( error_text )
  * function isLangSupported    ()
  * function getLink            ( rel_mode )
- * function getLinkSel         ( rel_mode )
+ * function getLinkSel         ()
  * function getPlatform                ()
  * function getReleaseMatrixPos        ()
  * function getFilename                ( ver )
@@ -32,7 +32,7 @@
 /*
  * Init function
  */
-function init() {
+function init( a, b ) {
        // Set global variables.
        initVars();
 
@@ -50,8 +50,11 @@ function init() {
        setLangSel();
        setVerSel();
 
-       // Get the download link from the selected elements.
-       getLinkSel( 1 );
+       
+       // Get release mode and analyze mode from "index.html" respective 
"analyze.html".
+       R_MODE = a;
+       A_MODE = b;
+       getLinkSel();
 }
 
 /*
@@ -76,6 +79,8 @@ function initVars() {
        "dl_lp_chk_keys", "dl_lp_chk_asc", "dl_lp_chk_md5", "dl_lp_chk_sha256", 
"dl_hlp", "dl_chk", "dl_rpt" ];
 
        // The following are used in "download.js". and "index.html".
+       R_MODE                                  = "";    // The release mode (1 
= stable release (default), 2 = beta release, etc.).
+       A_MODE                                  = "";    // The analyze mode (0 
= no debug (default), 1 = debug mode).
        LANG_ISO                                = "";    // The language as ISO 
code.
        LANG_ARRAY                              = "";    // This array contains 
all language specific data.
        UI_PLATFORM                             = "";    // The platform as 
readable string.
@@ -1163,16 +1168,19 @@ function getLink( rel_mode ) {
  * Get link to mirror system for download file and checksum file
  * Depends on chosen OS, language and type
  */
-function getLinkSel( rel_mode ) {
+function getLinkSel() {
        // Reset all error flags.
        SF      = false;
        OTHER   = false;
        ARCHIVE = false;
        ERROR   = false;
 
-       // If no release mode was given, assume it is about the stable release.
-       if( rel_mode === undefined )
-               rel_mode = 1;
+       // If no mode was given, assume it is the release mode (stable release).
+       if( R_MODE === undefined )
+               R_MODE = 1;
+       // If no mode was given, assume it is not the analyze mode (used for 
"analyze.html").
+       if( A_MODE === undefined )
+               A_MODE = false;
 
        // Get the selected data from the select boxes.
        getOSSel();
@@ -1235,7 +1243,7 @@ function getLinkSel( rel_mode ) {
 
        // If language is not supported, show the none-availability to the user.
        if( ! isLangSupported() ) {
-               if( rel_mode === 1 ) {
+               if( R_MODE === 1 ) {
                        // Release mode.
                        // Provide the link from the Native Language (NL) group.
 //                     LINK_FULL     = LANG_ARRAY[ 4 ];
@@ -1355,9 +1363,6 @@ function getLinkSel( rel_mode ) {
                document.getElementById( "dl_rpt_img"       ).src       = 
"../cachedimages/help-report-broken-link-icon.png";
                document.getElementById( "dl_rpt_img"       ).title     = 
"Broken download link? Click here to report.";
                document.getElementById( "dl_rpt_img"       ).alt       = 
"Broken link";
-               document.getElementById( "dl_rpt"           ).href      = 
"analyze_droplist.html";
-               document.getElementById( "dl_rpt"           ).innerHTML = 
"Report broken link";
-               document.getElementById( "dl_rpt"           ).title     = 
"Broken download link? Click here to report.";
 
                // Reset the CSS styles for the elements in the sub-green 
colored boxes.
                document.getElementById( "sub_green_box"    ).style.background 
= "#E9FEBE";             // LightGreen
@@ -1387,6 +1392,25 @@ function getLinkSel( rel_mode ) {
                document.getElementById( "dl_chk"           ).style.cursor = 
"help";
                document.getElementById( "dl_rpt_img"       ).style.cursor = 
"help";
                document.getElementById( "dl_rpt"           ).style.cursor = 
"help";
+
+               // Set different values depending if in analyze mode or not
+               if( A_MODE === false ) {
+                       document.getElementById( "dl_rpt"   ).href      = 
"analyze_droplist.html";
+                       document.getElementById( "dl_rpt"   ).innerHTML = 
"Report broken link";
+                       document.getElementById( "dl_rpt"   ).title     = 
"Broken download link? Click here to report.";
+               } else {
+
+                       for( var i = 0, j = element_ids_sub_green.length; i < 
j; i++ ) {
+                               document.getElementById( element_ids_sub_green[ 
i ] ).style.display = "none";
+                       }
+
+                       document.getElementById( "dl_rpt"     ).style.fontSize 
= "1.6em";
+                       document.getElementById( "dl_rpt"     ).href           
= "javascript:void( 0 )";
+                       document.getElementById( "dl_rpt"     ).innerHTML      
= "<b>Select your favorite options and click to update the table below</b>";
+                       document.getElementById( "dl_rpt"     ).title          
= "Update the values in the table below.";
+                       document.getElementById( "dl_rpt_img" ).style.display  
= "none";
+                       document.getElementById( "dl_rpt"     ).style.display  
= "inline-block";
+               }
        }
 
 //     alertDbg( "getLinkSel(): End" );


Reply via email to