source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/skin/breadcrumbs-optimized.js @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1/*
2* Licensed to the Apache Software Foundation (ASF) under one or more
3* contributor license agreements.  See the NOTICE file distributed with
4* this work for additional information regarding copyright ownership.
5* The ASF licenses this file to You under the Apache License, Version 2.0
6* (the "License"); you may not use this file except in compliance with
7* the License.  You may obtain a copy of the License at
8*
9*     http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*/
17var PREPREND_CRUMBS=new Array();
18var link1="@skinconfig.trail.link1.name@";
19var link2="@skinconfig.trail.link2.name@";
20var link3="@skinconfig.trail.link3.name@";
21if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
22  PREPREND_CRUMBS.push( new Array( link1, @skinconfig.trail.link1.href@ ) ); }
23if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
24  PREPREND_CRUMBS.push( new Array( link2, @skinconfig.trail.link2.href@ ) ); }
25if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
26  PREPREND_CRUMBS.push( new Array( link3, @skinconfig.trail.link3.href@ ) ); }
27var DISPLAY_SEPARATOR=" > ";
28var DISPLAY_PREPREND=" > ";
29var DISPLAY_POSTPREND=":";
30var CSS_CLASS_CRUMB="breadcrumb";
31var CSS_CLASS_TRAIL="breadcrumbTrail";
32var CSS_CLASS_SEPARATOR="crumbSeparator";
33var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
34var PATH_SEPARATOR="/";
35
36function sc(s) {
37        var l=s.toLowerCase();
38        return l.substr(0,1).toUpperCase()+l.substr(1);
39}
40function getdirs() {
41        var t=document.location.pathname.split(PATH_SEPARATOR);
42        var lc=t[t.length-1];
43        for(var i=0;i < FILE_EXTENSIONS.length;i++)
44        {
45                if(lc.indexOf(FILE_EXTENSIONS[i]))
46                        return t.slice(1,t.length-1); }
47        return t.slice(1,t.length);
48}
49function getcrumbs( d )
50{
51        var pre = "/";
52        var post = "/";
53        var c = new Array();
54        if( d != null )
55        {
56                for(var i=0;i < d.length;i++) {
57                        pre+=d[i]+postfix;
58                        c.push(new Array(d[i],pre)); }
59        }
60        if(PREPREND_CRUMBS.length > 0 )
61                return PREPREND_CRUMBS.concat( c );
62        return c;
63}
64function gettrail( c )
65{
66        var h=DISPLAY_PREPREND;
67        for(var i=0;i < c.length;i++)
68        {
69                h+='<a href="'+c[i][1]+'" >'+sc(c[i][0])+'</a>';
70                if(i!=(c.length-1))
71                        h+=DISPLAY_SEPARATOR; }
72        return h+DISPLAY_POSTPREND;
73}
74
75function gettrailXHTML( c )
76{
77        var h='<span class="'+CSS_CLASS_TRAIL+'">'+DISPLAY_PREPREND;
78        for(var i=0;i < c.length;i++)
79        {
80                h+='<a href="'+c[i][1]+'" class="'+CSS_CLASS_CRUMB+'">'+sc(c[i][0])+'</a>';
81                if(i!=(c.length-1))
82                        h+='<span class="'+CSS_CLASS_SEPARATOR+'">'+DISPLAY_SEPARATOR+'</span>'; }
83        return h+DISPLAY_POSTPREND+'</span>';
84}
85
86if(document.location.href.toLowerCase().indexOf("http://")==-1)
87        document.write(gettrail(getcrumbs()));
88else
89        document.write(gettrail(getcrumbs(getdirs())));
90
Note: See TracBrowser for help on using the repository browser.