Index: script/site.js =================================================================== --- script/site.js (revision 0) +++ script/site.js (working copy) @@ -0,0 +1,40 @@ +/* site.js --- miscellaneous JavaScript utilities. + * + * ==================================================================== + * 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. + * ==================================================================== + */ + +/* Install an onClick() handler for tags with the "linkaway" + * class which opens the link in a new window. + */ +function addLinkawayEvents() { + // Make sure we have the necessary routines. + if (! document.getElementsByTagName) + return; + + var anchors = document.getElementsByTagName('a'); + for (var i = 0; i < anchors.length; i++) { + var anchor = anchors[i]; + if (anchor.className.search(/\blinkaway\b/) != -1) { + if (! anchor.onclick ) { + anchor.onclick = function(anchor) { window.open(this.href); return false; }; + } + } + } +} Property changes on: script/site.js ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/javascript Index: index.html =================================================================== --- index.html (revision 1024477) +++ index.html (working copy) @@ -4,12 +4,13 @@ Apache Subversion + - +