Author: buildbot
Date: Sun Jul 13 13:17:20 2014
New Revision: 916049
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_redirect.html
Propchange: websites/staging/ooo-site/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jul 13 13:17:20 2014
@@ -1 +1 @@
-1610189
+1610190
Propchange: websites/staging/ooo-site/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jul 13 13:17:20 2014
@@ -1 +1 @@
-1610189
+1610190
Modified: websites/staging/ooo-site/trunk/content/index_redirect.html
==============================================================================
--- websites/staging/ooo-site/trunk/content/index_redirect.html (original)
+++ websites/staging/ooo-site/trunk/content/index_redirect.html Sun Jul 13
13:17:20 2014
@@ -89,32 +89,70 @@
}
}
- function showRedirectBox() {
+ 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 language as native name.
- var redirect = false; // Should the found language be
used to redirect (false/true)?
+ var lang_text = ""; // The message text that can be
shown.
+// var redirect = false; // Set a hard-redirect without
showing a message (false/true)?
+// var show = false; // Should the found language be
used to redirect (false/true)?
// 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 language was found.
- if( DL.SEL_LANG[ i ] === lang_iso ) {
- // Only if the language is OK to redirect, assign the
text and set redirect = true.
- if( l10n.index_redirect_text[ i / 3 * 2 ] === "y" ) {
- lang_text = l10n.index_redirect_text[ i / 3 * 2
+ 1 ];
- redirect = true;
- }
- break;
- }
+ // If the ISO code is found in the language array.
+ if( DL.SEL_LANG[ i ] === lang_iso ) {
+/*
+ // Only if the language is OK to redirect, assign the text and set
redirect = true.
+ if( l10n.index_redirect_text[ i / 3 * 2 ] === "y" ) {
+ lang_text = l10n.index_redirect_text[ i / 3 * 2 + 1 ];
+ redirect = true;
+ }
+ break;
+*/
+ // Query for the redirect method (defined in "/msg_prop_l10n.js",
column 0).
+ switch( l10n.index_redirect_text[ i / 3 * 2 ] ) {
+ case "hard":
+ // Don't show a message, just redirect.
+ alert( "Just for debugging purpose:"
+ "\n\n"
+ + "Browser language ISO code: \t\t" + lang_iso
+ "\n"
+ + "Redirect method? \t\t\t\t" + "Hard, without
message" + "\n" );
+
+ window.open( "http://www.openoffice.org/" + lang_iso , "_self"
);
+ break;
+ case "soft":
+ // Show a message and redirect on user's click.
+ alert( "Just for debugging purpose:"
+ "\n\n"
+ + "Browser language ISO code: \t\t" + lang_iso
+ "\n"
+ + "Redirect method? \t\t\t\t" + "Soft, with message"
+ "\n"
+ + "Position in language array: \t\t" + i / 3
+ "\n"
+ + "Found language text: \t\t\t" + lang_text );
+
+ // Assign the message text (defined in "/msg_prop_l10n.js",
column 1).
+ lang_text = l10n.index_redirect_text[ i / 3 * 2 + 1 ];
+// redirect = true;
+ document.write( "<div id='redirect_box'"
+ + " onclick='window.open( \"http://www.openoffice.org/" +
lang_iso
+ + "\", \"_blank\" ); return false;'>"
+// + " onclick='window.open( \"http://www.openoffice.org/" +
lang_iso
+// + "\", \"_self\" ); return false;'>"
+ + "<p>" + lang_text + "</p>"
+ + "</div>" ); // redirect box
+ break;
+ case "none":
+ default:
+ // Do and show nothing.
+ lang_text = l10n.index_redirect_text[ i / 3 * 2 + 1 ];
+ alert( "Just for debugging purpose:"
+ "\n\n"
+ + "Browser language ISO code: \t\t" + lang_iso
+ "\n"
+ + "Redirect method? \t\t\t\t" + "None, do and show
nothing" + "\n"
+ + "Position in language array: \t\t" + i / 3
+ "\n"
+ + "Found language text: \t\t\t" + lang_text );
+ }
+ break;
+ }
}
-
- alert( "Just for debugging purpose:" + "\n\n"
- + "Browser language ISO code: \t\t" + lang_iso + "\n"
- + "Is it OK to redirect? \t\t\t\t" + redirect + "\n"
- + "Position in language array: \t\t" + i / 3 + "\n"
- + "Found language text: \t\t\t" + lang_text );
-
+/*
// Show redirect box or not?
if( redirect ) {
// Show redirect box with defined background color and the text with
link and cursor as poiner.
@@ -124,7 +162,7 @@
+ "<p>" + lang_text + "</p>"
+ "</div>" ); // redirect box
}
-
+*/
return;
}
</script>
@@ -163,7 +201,7 @@ screen reader.
// Show redirect box.
// Let the user decide to click to get to their localized NL website or not.
// Change to 'true' if you want to show the text that is defined in the
variables above.
- showRedirectBox( true );
+ setRedirect();
//-->
</script>