Author: buildbot
Date: Wed Jul 23 21:42:56 2014
New Revision: 917241

Log:
Staging update by buildbot for ooo-site

Modified:
    websites/staging/ooo-site/trunk/cgi-bin/   (props changed)
    websites/staging/ooo-site/trunk/content/   (props changed)
    websites/staging/ooo-site/trunk/content/index_url.html

Propchange: websites/staging/ooo-site/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul 23 21:42:56 2014
@@ -1 +1 @@
-1612927
+1612952

Propchange: websites/staging/ooo-site/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Jul 23 21:42:56 2014
@@ -1 +1 @@
-1612927
+1612952

Modified: websites/staging/ooo-site/trunk/content/index_url.html
==============================================================================
--- websites/staging/ooo-site/trunk/content/index_url.html (original)
+++ websites/staging/ooo-site/trunk/content/index_url.html Wed Jul 23 21:42:56 
2014
@@ -90,44 +90,77 @@
       }
 
       function setRedirect() {
-       DL.NL_LANG      = "";                   // Set to empty as both 
variables must not be used in following function.
-       DL.LANG_SEL     = "";
-       var lang_iso    = DL.getLanguage();     // Get the language ISO code 
from browser guessed data.
-       var lang_text   = "";                   // The message text that can be 
shown.
-       var mode        = "";                   // Redirect mode.
-
+       DL.NL_LANG      = "";                                   // Set to empty 
as both variables ...
+       DL.LANG_SEL     = "";                                   // ... must not 
be used in following function.
+       var lang_iso    = DL.getLanguage();                     // Get the 
language ISO code from browser guessed data.
+       var lang_mode   = "";                                   // Customized 
redirect mode.
+       var lang_text   = "";                                   // Customized 
message text that can be shown.
+       var link        = "";                                   // Override 
redirect mode.
+/*
+       // 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;
+               };
+       }
+*/
        // Query if the browser language is one of the released languages.
        // The array has 3 elements per language (defined in 
"/download/globalvars.js"
        for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
          // If the ISO code is found in the language array.
          if( DL.SEL_LANG[ i ] === lang_iso ) {
            // Query for the redirect method (defined in "/msg_prop_l10n.js", 
column 0).
-           mode        = l10n.index_redirect_text[ i / 3 * 2 ];
+           lang_mode   = l10n.index_redirect_text[ i / 3 * 2 ];
            lang_text   = l10n.index_redirect_text[ i / 3 * 2 + 1 ];
            break;
          }
        }
 
-//     alert( String( document.location ).indexOf( "soft" ) );
-       
+       alert( "ISO code: \t" + lang_iso        + "\n"
+              + "Mode:   \t\t" + lang_mode     + "\n"
+              + "Text:   \t\t" + lang_text     + "\n" );
+
+       // Convert the browser URL into a string.
+       link = String( document.location );
+
        // Does the browser URL contain already a redirect mode?
-       if( String( document.location ).indexOf( "soft" ) != -1 ) {
-           // Set override mode to "soft".
-           mode = "soft";
-       } else if( String( document.location ).indexOf( "none" ) != -1 ) {
-           // Set override mode to "none".
-           mode = "none";
+       // If yes, set the new redirect mode to override the customized mode.
+       if( link.indexOf( "hard" ) !== -1 ) {
+           lang_mode = "hard";
+       } else if( link.indexOf( "soft" ) !== -1 ) {
+           lang_mode = "soft";
+       } else if( link.indexOf( "none" ) !== -1 ) {
+           lang_mode = "none";
        }
 
-       switch( mode ) {
+       alert( "URL: \t\t" + document.location );
+
+       switch( lang_mode ) {
          case "hard":
            // Don't show a message, just redirect. 
+           alert( "What redirect mode will be used? \t" + lang_mode );
            window.open( "http://www.openoffice.org/"; + lang_iso , "_self" );
            break;
          case "soft":
            // Show a message and redirect on user's click.
            // Assign the message text (defined in "/msg_prop_l10n.js", column 
1).
 
+           alert( "What redirect mode will be used? \t" + lang_mode );
            document.write( "<div id='redirect_box'"
              + " onclick='window.open( \"http://www.openoffice.org/"; + 
lang_iso + "\", \"_self\" ); return false;'>"
              + "<p>" + lang_text + "</p>"
@@ -135,6 +168,7 @@
            break;
          case "none":
          default:
+           alert( "What redirect mode will be used? \t" + lang_mode );
            // Do and show nothing.
        }
 


Reply via email to