Author: marcus
Date: Sun Jun 29 17:25:52 2014
New Revision: 1606540

URL: http://svn.apache.org/r1606540
Log:
Alert box: If link is available make the whole DIV clickable

Modified:
    openoffice/ooo-site/trunk/content/xx/index.html

Modified: openoffice/ooo-site/trunk/content/xx/index.html
URL: 
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/xx/index.html?rev=1606540&r1=1606539&r2=1606540&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/xx/index.html (original)
+++ openoffice/ooo-site/trunk/content/xx/index.html Sun Jun 29 17:25:52 2014
@@ -35,45 +35,53 @@
       function showAlertbox( show ) {
        // More see "http://html-color-codes.info/";
         var l10n_alert_box_background_color = "#F5A9A9";
-       // Maximum 86 characters.
-        var l10n_alert_box_headline_text    = "Important message";
-       // Maximum 517 characters.
-        var l10n_alert_box_text1_text      = "This alert box is now within the 
layout of the list items below."
+        // Make the whole alert box clickable with a link.
+        var l10n_alert_box_href                    = "index.html";
+       // Maximum 49 characters.
+        var l10n_alert_box_headline_text    = "Headline text with max. 49 
characters";
+       // Maximum 630 characters.
+        var l10n_alert_box_text_text       = "Text with max. 630 characters."
+                                             + "<br /><br />"
+                                             + "This alert box is now within 
the layout of the list items below."
                                              + "<br /><br />"
                                              + "The following link can be 
added to point the user to more information or "
                                              + "to a solution. But the link 
can also be left out. Then the link will not "
-                                             + "be shown."
-       // Maximum 517 characters.
-        var l10n_alert_box_text2_text      = "Dummy link";
-        var l10n_alert_box_text2_href      = "download/index.html";
-
+                                             + "be shown.";
         // Show alert box or not?
         if( show ) {
-          // If no color value was set then use the default value.
+          // If no background color value was set then use the default value.
           if( ! l10n_alert_box_background_color )
             var l10n_alert_box_background_color = "#FFD9A7";
 
           // Show alert box with defined background color.
-          document.write( "<div id='alert_box' style='background: " + 
l10n_alert_box_background_color + "'>" );
+          // Depending if link is available, make the whole DIV clickable or 
not.
+          if( l10n_alert_box_href ) {
+            // Show the text with link and cursor as poiner.
+            document.write( "<div id='alert_box' style='background: " + 
l10n_alert_box_background_color
+            + "; ' onclick='window.open(\"" + l10n_alert_box_href + "\", 
\"_blank\"); return false;'>" );
+
+            // Show headline.
+            document.write( "<h2 style='cursor: pointer;'>" + 
l10n_alert_box_headline_text + "</h2>" );
+
+            // Show text.
+            if( l10n_alert_box_text_text )
+              document.write( "<p style='cursor: pointer;'>" + 
l10n_alert_box_text_text + "</p>" );
+
+          } else {
+            // Show the text without link and normal cursor.
+            document.write( "<div id='alert_box' style='background: " + 
l10n_alert_box_background_color + "'>" );
+
             // Show headline.
-            document.write( "<h2>" + l10n_alert_box_headline_text + "</h2>" );
+            document.write( "<h2 style='cursor: default;'>" + 
l10n_alert_box_headline_text + "</h2>" );
+
+            // Shoe text.
+            if( l10n_alert_box_text_text )
+              document.write( "<p style='cursor: default;'>" + 
l10n_alert_box_text_text + "</p>" );
+          }
 
-            // If text without link is available then show it.
-            if( l10n_alert_box_text1_text )
-              document.write( "<p>" + l10n_alert_box_text1_text + "</p>" );
-
-            // If text with link is available then show it.
-            if( l10n_alert_box_text2_text ) {
-              document.write( "<p>"
-                + "<a href='" + l10n_alert_box_text2_href + "' 
target='_blank'>"
-                  + l10n_alert_box_text2_text
-                + "</a>"
-              + "</p>" );
-            }
           document.write( "</div>" ); // Alert box
         }
       }
-
     </script>
 </head>
 


Reply via email to