You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by bo...@apache.org on 2011/09/07 15:58:08 UTC

svn commit: r1166186 - in /logging/log4net/trunk/src/site: resources/js/ resources/js/blockLocalOnlyLinks.js xdoc/release/example-apps.xml

Author: bodewig
Date: Wed Sep  7 13:58:08 2011
New Revision: 1166186

URL: http://svn.apache.org/viewvc?rev=1166186&view=rev
Log:
fix links in examples page.  LOG4NET-243

Added:
    logging/log4net/trunk/src/site/resources/js/
    logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js   (with props)
Modified:
    logging/log4net/trunk/src/site/xdoc/release/example-apps.xml

Added: logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js?rev=1166186&view=auto
==============================================================================
--- logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js (added)
+++ logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js Wed Sep  7 13:58:08 2011
@@ -0,0 +1,39 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/
+function getElementsByClass(node,searchClass,tag) {
+    var classElements = new Array();
+    var els = node.getElementsByTagName(tag);
+    var elsLen = els.length;
+    var pattern = new RegExp("\\b"+searchClass+"\\b");
+    for (i = 0, j = 0; i < elsLen; i++) {
+        if ( pattern.test(els[i].className) ) {
+            classElements[j] = els[i];
+            j++;
+        }
+    }
+    return classElements;
+}
+function BlockLocalOnlyLinks() {
+    if (window.location.protocol!="file:") {
+        var links = getElementsByClass(document, "localOnly", "a");
+        for(var i=0; i < links.length; i++) {
+            links[i].href = "#overview";
+        }
+    }
+}
+BlockLocalOnlyLinks();

Propchange: logging/log4net/trunk/src/site/resources/js/blockLocalOnlyLinks.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: logging/log4net/trunk/src/site/xdoc/release/example-apps.xml
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/site/xdoc/release/example-apps.xml?rev=1166186&r1=1166185&r2=1166186&view=diff
==============================================================================
--- logging/log4net/trunk/src/site/xdoc/release/example-apps.xml (original)
+++ logging/log4net/trunk/src/site/xdoc/release/example-apps.xml Wed Sep  7 13:58:08 2011
@@ -24,38 +24,7 @@ limitations under the License.
 
     <meta name="keywords" content="log4net examples, log4net" />
     
-    <head>
-        <script language="javascript" >
-<!--
-function getElementsByClass(node,searchClass,tag) {
-var classElements = new Array();
-var els = node.getElementsByTagName(tag);
-var elsLen = els.length;
-var pattern = new RegExp("\\b"+searchClass+"\\b");
-for (i = 0, j = 0; i < elsLen; i++) {
-if ( pattern.test(els[i].className) ) {
-classElements[j] = els[i];
-j++;
-}
-}
-return classElements;
-}
-function BlockLocalOnlyLinks()
-{
-if (window.location.protocol!="file:")
-{
-var links = getElementsByClass(document,"localOnly","a");
-for(var i=0; i<links.length; i++)
-{
-links[i].href = "#overview";
-}
-}
-}
--->
-        </script>
-    </head>
-
-    <body onload="BlockLocalOnlyLinks()">
+    <body>
         <section id="main" name="log4net Examples">
         
             <sectionMenu name="Contents" />
@@ -63,7 +32,7 @@ links[i].href = "#overview";
             <section id="overview" name="Overview">
                 <p>
                     <strong>The following examples are only available in the log4net release download, not
-                    on-line. To obtain the examples <a href="../downloads.html">download</a> one of the log4net releases.
+                    on-line. To obtain the examples <a href="../download.html">download</a> one of the log4net releases.
                     </strong>
                 </p>
             </section>
@@ -500,5 +469,6 @@ links[i].href = "#overview";
             </section>
             
         </section>
+        <script language="javascript" src="../js/blockLocalOnlyLinks.js"/>
     </body>
 </document>