Author: marcus
Date: Sat May 31 19:10:16 2014
New Revision: 1598903

URL: http://svn.apache.org/r1598903
Log:
Re-work to support the new download via select boxes

Modified:
    openoffice/ooo-site/trunk/content/download/test/analyze_droplist.html

Modified: openoffice/ooo-site/trunk/content/download/test/analyze_droplist.html
URL: 
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/analyze_droplist.html?rev=1598903&r1=1598902&r2=1598903&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/analyze_droplist.html 
(original)
+++ openoffice/ooo-site/trunk/content/download/test/analyze_droplist.html Sat 
May 31 19:10:16 2014
@@ -33,7 +33,6 @@
   <!-- Download via select boxes -->
   <script type="text/javascript">
   <!--
-
   // Set a specific language ISO code to force to assemble a certain localized 
build as download link.
   // The variable can be found in the "msg_prop_l10n_<ISO_code>.js".
   NL_LANG = "";
@@ -52,12 +51,12 @@
     + "</p>"
 
     + "<form name='download'>"
-      + "<select class='sel-os' id='os'        name='os'   title='Select your 
favorite operating system'"
-      + "onchange='getLinkSel( 1 )'></select>"
-      + "<select class='sel-lang' id='lang'    name='lang' title='Select your 
favorite language'"
-      + "onchange='getLinkSel( 1 )'></select>"
-      + "<select class='sel-ver' id='ver'      name='ver'  title='Select your 
favorite release version'"
-      + "onchange='getLinkSel( 1 )'></select>"
+      + "<select class='sel-os' id='os'     name='os'   title='Select your 
favorite operating system'"
+      + "onchange='getLinkSel()'></select>"
+      + "<select class='sel-lang' id='lang' name='lang' title='Select your 
favorite language'"
+      + "onchange='getLinkSel()'></select>"
+      + "<select class='sel-ver' id='ver'   name='ver'  title='Select your 
favorite release version'"
+      + "onchange='getLinkSel()'></select>"
     + "</form>"
 
     + "<div class='dl-txt-btn'>"
@@ -74,7 +73,8 @@
     + "<div>"
       + "<p>"
         // Error text with hint.
-        + "<a id='dl_err'           style='text-decoration: none; cursor: 
default; font-size: 1.2em'></a>"
+        + "<img id='dl_err_img'            style='margin: 5px 5px 15px 0px;' 
src='' title='' height='16' width='16' alt='' />"
+        + "<a id='dl_err'          style='text-decoration: none;' 
title=''></a>"
 
         // Release info.
         + "<a id='dl_rel_info'      style='text-decoration: none;'></a>"
@@ -103,24 +103,24 @@
         + "<br />"
 
         // Help: What is a language pack?
-        + "<img id='dl_hlp_img' style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
+        + "<img id='dl_hlp_img'     style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
         + "<a id='dl_hlp' href='' title='' target='_blank' 
onclick='showWindow( this.href ); return false;'></a>"
         + "<a style='padding: 0px 0px 0px 30px;'></a>"
 
         // Help: How to verify the download?
-        + "<img id='dl_chk_img' style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
+        + "<img id='dl_chk_img'     style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
         + "<a id='dl_chk' href='' title='' target='_blank'></a>"
         + "<a style='padding: 0px 0px 0px 30px;'></a>"
 
         // Help: Report broken link.
-        + "<img id='dl_rpt_img' style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
-        + "<a id='dl_rpt' href='' title='' target='_blank'></a>"
+        + "<img id='dl_rpt_img'     style='padding: 5px 5px 0px 0px;' src='' 
title='' height='16' width='16' alt='' />"
+        + "<a id='dl_rpt' href='' title='' target='_blank'  
onclick='updateTable(); return false;'></a>"
       + "</p>"
     + "</div>" );
   document.write( "</div>" );
 
   // Fill the select boxes and wait for the user's choice.
-  init();
+  init( 1, true );
 
   //-->
   </script>
@@ -140,8 +140,10 @@
 
 <div>
   <script type="text/javascript">
-    document.write( "<table border='1' style='width:100%; 
border-collapse:collapse; border-spacing: 2px; float: left'><tbody>" );
+    document.write( "<table id='js_dl_values' border='1' style='width:100%; 
border-collapse:collapse; border-spacing: 2px; float: left'><tbody>" );
     document.write( "<th style='width:25%;'><b>Browser variables</b>   </th 
style='75%;'><th><b>Values</b></th></tr>" );
+
+    // List all varaibles from browser's document object model (DOM).
     document.write( "<tr><td>navigator.appCodeName                     
</td><td>" + navigator.appCodeName                      + "</td></tr>" );
     document.write( "<tr><td>navigator.appName                         
</td><td>" + navigator.appName                          + "</td></tr>" );
     document.write( "<tr><td>navigator.appVersion                      
</td><td>" + navigator.appVersion                       + "</td></tr>" );
@@ -165,41 +167,58 @@
     if ( navigator.userAgent.indexOf( "IceWeasel" ) != -1 )
       document.write( "<tr><td>navigator.UserAgent (with IceWeasel ?)  
</td><td>" + navigator.userAgent.indexOf( "IceWeasel" ) + "</td></tr>" );
 
-    document.write( "<th style='width:23%;'><b>Stable Release</b>      </th 
style='77%;'><th>&nbsp;</th></tr>" );
+    document.write( "<th style='width:25%;'><b>Stable Release</b>      </th 
style='75%;'><th>&nbsp;</th></tr>" );
     document.write( "<tr><th><b>JavaScript&nbsp;functions/variables</b>        
</th><th><b>Values</b></th></tr>" );
-    document.write( "<tr><td>Language name                             
</td><td>" + LANG_ARRAY[ 2 ]                            + "</td></tr>" );
-    document.write( "<tr><td>Language ISO code                         
</td><td>" + LANG_ISO                                   + "</td></tr>" );
-    document.write( "<tr><td>Language ISO code (from select box)       
</td><td>" + LANG_SEL                                   + "</td></tr>" );
-    document.write( "<tr><td>Language array data                       
</td><td>" + LANG_ARRAY                                 + "</td></tr>" );
-    document.write( "<tr><td>Release matrix platform position (full)   
</td><td>" + RELEASE_PLATFORM_POS_FULL                  + "</td></tr>" );
-    document.write( "<tr><td>Release matrix platform position (lp)     
</td><td>" + RELEASE_PLATFORM_POS_LP                    + "</td></tr>" );
-    document.write( "<tr><td>Release matrix platform array data                
</td><td>" + RELEASE_PLATFORM                           + "</td></tr>" );
-    document.write( "<tr><td>Release matrix language array data                
</td><td>" + RELEASE_LANG                               + "</td></tr>" );
-    document.write( "<tr><td>UI platform name                          
</td><td>" + UI_PLATFORM                                + "</td></tr>" );
-    document.write( "<tr><td>UI platform name (not supported)          
</td><td>" + UI_PLATFORM_NO_SUP                         + "</td></tr>" );
-    document.write( "<tr><td>URL platform name                         
</td><td>" + URL_PLATFORM                               + "</td></tr>" );
-    document.write( "<tr><td>URL platform name (from select box)       
</td><td>" + PLATFORM_SEL                               + "</td></tr>" );
-    document.write( "<tr><td>Version (from select box)                 
</td><td>" + VERSION_SEL                                + "</td></tr>" );
-    document.write( "<tr><td>File name (full)                          
</td><td>" + FILENAME_FULL                              + "</td></tr>" );
-    document.write( "<tr><td>File name (lp)                            
</td><td>" + FILENAME_LP                                + "</td></tr>" );
-    document.write( "<tr><td>File extension                            
</td><td>" + EXTENSION                                  + "</td></tr>" );
-    document.write( "<tr><td>File size (full) (MByte)                  
</td><td>" + FILESIZE_FULL                              + "</td></tr>" );
-    document.write( "<tr><td>File size (lp) (MByte)                    
</td><td>" + FILESIZE_LP                                + "</td></tr>" );
-    document.write( "<tr><td>Download file link (full)                 
</td><td>" + LINK_FULL                                  + "</td></tr>" );
-    document.write( "<tr><td>Download file link (lp)                   
</td><td>" + LINK_LP                                    + "</td></tr>" );
-    document.write( "<tr><td>Checksum file link (full) (here for MD5)  
</td><td>" + LINK_CHK_MD5_FULL                          + "</td></tr>" );
-    document.write( "<tr><td>Checksum file link (lp) (here for MD5)    
</td><td>" + LINK_CHK_MD5_LP                            + "</td></tr>" );
-    document.write( "<tr><td>Base URL to Sourceforge.net               
</td><td>" + SOURCEFORGE_BASE_URL                       + "</td></tr>" );
-//  document.write( "<tr><td>Base URL to Apache Dist                   
</td><td>" + ASF_DIST_BASE_URL                          + "</td></tr>" );
-    document.write( "<tr><td>Base URL to Apache Archive                        
</td><td>" + ASF_ARC_BASE_URL                           + "</td></tr>" );
-    document.write( "<tr><td>getLinkSel()                              
</td><td>" + getLinkSel( 1 )                            + "</td></tr>" );
-    document.write( "<tr><td>isLangSupported() ?                       
</td><td>" + isLangSupported()                          + "</td></tr>" );
-    document.write( "<tr><td>Old platform ?                            
</td><td>" + OLD_PLATFORM                               + "</td></tr>" );
-    document.write( "<tr><td>Contains link to Sourgeforge ?            
</td><td>" + SF                                         + "</td></tr>" );
-    document.write( "<tr><td>Contains link to 'other.html' ?           
</td><td>" + OTHER                                      + "</td></tr>" );
-    document.write( "<tr><td>Contains link to archived build ?         
</td><td>" + ARCHIVE                                    + "</td></tr>" );
-    document.write( "<tr><td>General error ?                           
</td><td>" + ERROR                                      + "</td></tr>" );
+
+    // List all variables and function's return values from scripting.
+    document.write( "<tr><td>Language name                             
</td><td id='lang_native'>"       /* LANG_ARRAY[ 2 ] */          + "</td></tr>" 
);
+    document.write( "<tr><td>Language ISO code                         
</td><td id='lang_iso'>"          /* LANG_ISO */                 + "</td></tr>" 
);
+    document.write( "<tr><td>Language ISO code (from select box)       
</td><td id='lang_sel'>"          /* LANG_SEL */                 + "</td></tr>" 
);
+    document.write( "<tr><td>Language array data                       
</td><td id='lang_array'>"        /* LANG_ARRAY */               + "</td></tr>" 
);
+    document.write( "<tr><td>Release matrix platform position (full)   
</td><td id='pos_full'>"          /* RELEASE_PLATFORM_POS_FULL */+ "</td></tr>" 
);
+    document.write( "<tr><td>Release matrix platform position (lp)     
</td><td id='pos_lp'>"            /* RELEASE_PLATFORM_POS_LP */  + "</td></tr>" 
);
+    document.write( "<tr><td>Release matrix platform array data                
</td><td id='release_platform'>"  /* RELEASE_PLATFORM */         + "</td></tr>" 
);
+    document.write( "<tr><td>Release matrix language array data                
</td><td id='release_lang'>"      /* RELEASE_LANG */             + "</td></tr>" 
);
+    document.write( "<tr><td>UI platform name                          
</td><td id='ui_platform'>"       /* UI_PLATFORM */              + "</td></tr>" 
);
+    document.write( "<tr><td>UI platform name (not supported)          
</td><td id='ui_platform_no_sup'>"/* UI_PLATFORM_NO_SUP */       + "</td></tr>" 
);
+    document.write( "<tr><td>URL platform name                         
</td><td id='url_platform'>"      /* URL_PLATFORM */             + "</td></tr>" 
);
+    document.write( "<tr><td>URL platform name (from select box)       
</td><td id='platform_sel'>"      /* PLATFORM_SEL */             + "</td></tr>" 
);
+    document.write( "<tr><td>Version (from select box)                 
</td><td id='version_sel'>"       /* VERSION_SEL */              + "</td></tr>" 
);
+    document.write( "<tr><td>File name (full)                          
</td><td id='filename_full'>"     /* FILENAME_FULL */            + "</td></tr>" 
);
+    document.write( "<tr><td>File name (lp)                            
</td><td id='filename_lp'>"       /* FILENAME_LP */              + "</td></tr>" 
);
+    document.write( "<tr><td>File extension                            
</td><td id='extension'>"         /* EXTENSION */                + "</td></tr>" 
);
+    document.write( "<tr><td>File size (full) (MByte)                  
</td><td id='filesize_full'>"     /* FILESIZE_FULL */            + "</td></tr>" 
);
+    document.write( "<tr><td>File size (lp) (MByte)                    
</td><td id='filesize_lp'>"       /* FILESIZE_LP */              + "</td></tr>" 
);
+    document.write( "<tr><td>Release info                              
</td><td id='rel_info'>"          /* REL_TEXT */                 + "</td></tr>" 
);
+    document.write( "<tr><td>Download file link (full)                 
</td><td id='link_full'>"         /* LINK_FULL */                + "</td></tr>" 
);
+    document.write( "<tr><td>Download file link (lp)                   
</td><td id='link_lp'>"           /* LINK_LP */                  + "</td></tr>" 
);
+    document.write( "<tr><td>Checksum file link (full) (here for MD5)  
</td><td id='link_chk_md5_full'>" /* LINK_CHK_MD5_FULL */        + "</td></tr>" 
);
+    document.write( "<tr><td>Checksum file link (lp) (here for MD5)    
</td><td id='link_chk_md5_lp'>"   /* LINK_CHK_MD5_LP */          + "</td></tr>" 
);
+    document.write( "<tr><td>Base URL to Sourceforge.net               
</td><td id='sf_base_url'>"       /* SOURCEFORGE_BASE_URL */     + "</td></tr>" 
);
+    document.write( "<tr><td>Base URL to Apache Archive                        
</td><td id='asf_arc_base_url'>"  /* ASF_ARC_BASE_URL */         + "</td></tr>" 
);
+    document.write( "<tr><td>getLinkSel()                              
</td><td id='getlinksel'>"        /* getLinkSel() */             + "</td></tr>" 
);
+    document.write( "<tr><td>isLangSupported() ?                       
</td><td id='islangsupported'>"   /* isLangSupported() */        + "</td></tr>" 
);
+    document.write( "<tr><td>Old platform ?                            
</td><td id='old_platform'>"      /* OLD_PLATFORM */             + "</td></tr>" 
);
+    document.write( "<tr><td>Contains link to Sourgeforge ?            
</td><td id='sf'>"                /* SF */                       + "</td></tr>" 
);
+    document.write( "<tr><td>Contains link to 'other.html' ?           
</td><td id='other'>"             /* OTHER */                    + "</td></tr>" 
);
+    document.write( "<tr><td>Contains link to archived build ?         
</td><td id='archive'>"           /* ARCHIVE */                  + "</td></tr>" 
);
+    document.write( "<tr><td>General error ?                           
</td><td id='error'>"             /* ERROR */                    + "</td></tr>" 
);
     document.write( "</tbody></table><br/><br/>" );
+
+    function updateTable() {
+       // All variables and function that should be shown in the table.
+       elements = [ LANG_ARRAY[ 2 ], LANG_ISO, LANG_SEL, LANG_ARRAY, 
RELEASE_PLATFORM_POS_FULL, RELEASE_PLATFORM_POS_LP,
+       RELEASE_PLATFORM, RELEASE_LANG, UI_PLATFORM, UI_PLATFORM_NO_SUP, 
URL_PLATFORM, PLATFORM_SEL, VERSION_SEL,
+       FILENAME_FULL, FILENAME_LP, EXTENSION, FILESIZE_FULL, FILESIZE_LP, 
REL_TEXT, LINK_FULL, LINK_LP, LINK_CHK_MD5_FULL,
+       LINK_CHK_MD5_LP, SOURCEFORGE_BASE_URL, ASF_ARC_BASE_URL, getLinkSel(), 
isLangSupported(), OLD_PLATFORM, SF, OTHER,
+       ARCHIVE, ERROR ];
+
+       // Assign the respective table cell with the variable or function.
+       // Start with the 19th row (i = 18) in the 2nd cell (1), count through 
the elements array (j):
+       for( var i = 18, j = 0, k = elements.length; j < k; i++, j++ ) {
+               document.getElementById( "js_dl_values" ).rows[ i ].cells[ 1 
].innerHTML = elements[ j ];
+       }
+    }
   </script>
 </div>
 


Reply via email to