Author: marcus
Date: Sat Jul 12 20:43:28 2014
New Revision: 1610045
URL: http://svn.apache.org/r1610045
Log:
Show the language name in English or as loalized string for the select box
items and the native name + ISO code as tool tip, increasing the counter as the
array has now 3 elements per row
Modified:
openoffice/ooo-site/trunk/content/download/download.js
Modified: openoffice/ooo-site/trunk/content/download/download.js
URL:
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/download.js?rev=1610045&r1=1610044&r2=1610045&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/download.js Sat Jul 12 20:43:28
2014
@@ -1,6 +1,7 @@
/*
* Overview of all methods (functions) defined below of the global object "DL"
* ---------------------------------------------------------------------------
+ * function DL.init ()
* function DL.initVariables ()
* function DL.getLanguage ()
* function DL.fillOSSelection ()
@@ -25,7 +26,6 @@
*
* Overview of global functions defined below
* ------------------------------------------
- * function init ()
* function openItem ( itemid, uri )
*/
@@ -264,14 +264,20 @@ DL.fillLanguageSelection = function() {
var option = "";
// Fill the <select> element until all languages are used.
- for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 2 ) {
+ for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
option = document.createElement( "option" );
// Assign the language ISO code as index value.
option.value = DL.SEL_LANG[ i ];
+/*
// Assign the language ISO code as title.
option.title = DL.SEL_LANG[ i ];
// Assign the language name as "English name (Native name)".
option.text = DL.SEL_LANG[ i + 1 ];
+*/
+ // Assign the language name as "Native name" (or English name
if localization is not available).
+ option.text = DL.SEL_LANG[ i + 1 ];
+ // Assign the language as "English name (ISO code)" as title.
+ option.title = DL.SEL_LANG[ i + 2 ];
// Add the new option to the already existing ones.
selection.appendChild( option );
}
@@ -283,6 +289,12 @@ DL.fillLanguageSelection = function() {
for( i = 0, j =
l10n.dl_green_box_select_box_language_values.length; i < j; i++ ) {
// Exchange only the default language name with the
localized name.
selection.options[ i ].text =
l10n.dl_green_box_select_box_language_values[ i ];
+/*
+ alert( "i: \t\t" + i + "\n"
+ + "Localized: \t" +
l10n.dl_green_box_select_box_language_values[ i ] + "\n"
+ + "Text: \t\t" + selection.options[ i
].text + "\n"
+ + "Title: \t\t" + selection.options[ i
].title );
+*/
}
}
@@ -370,10 +382,10 @@ DL.setLanguageSelection = function() {
var found = false;
// Set the recognized browser language as default for the select box.
- for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 2 ) {
+ for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
// If the language was found, set it as pre-selected.
if( DL.SEL_LANG[ i ] === DL.LANG_ISO ) {
- selection.selectedIndex = i / 2;
+ selection.selectedIndex = i / 3;
found = true;
break;
}
@@ -463,7 +475,7 @@ DL.getLanguageSelection = function() {
var language_value = document[ "download" ][ "language" ].options[
document[ "download" ][ "language" ].selectedIndex ].value;
// Search through the <select> element until the chosen language is
found.
- for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 2 ) {
+ for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
if( DL.SEL_LANG[ i ] === language_value ) {
DL.LANG_SEL = language_value;
break;