nicolaken 2002/07/13 15:28:28
Modified: src/documentation/skins/avalon-tigris/scripts breadcrumbs.js
src/documentation cocoon.xconf
src/documentation/skins/avalon-tigris/xslt/html
site2xhtml.xsl
Added: src/documentation/skins/avalon-tigris/scripts
breadcrumbs-optimized.js
Log:
New breadcrumb script.
Revision Changes Path
1.2 +24 -13
jakarta-avalon/src/documentation/skins/avalon-tigris/scripts/breadcrumbs.js
Index: breadcrumbs.js
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/documentation/skins/avalon-tigris/scripts/breadcrumbs.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- breadcrumbs.js 13 Jul 2002 10:01:58 -0000 1.1
+++ breadcrumbs.js 13 Jul 2002 22:28:28 -0000 1.2
@@ -56,7 +56,8 @@
* Typical usage:
* <script type="text/javascript" language="JavaScript"
src="breadcrumbs.js"></script>
*
- *@author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a>
+ *@author <a href="mailto:[EMAIL PROTECTED]">Leo Simons</a> (main author)
+ *@author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a>
(integration in skin)
*@created July 12, 2002
*@version 1.0
*/
@@ -72,9 +73,15 @@
* you use this script (you can leave it as an empty array if you wish)
*/
var PREPREND_CRUMBS = new Array();
- PREPREND_CRUMBS.push( new Array( "Apache", "http://www.apache.org/" ) );
- PREPREND_CRUMBS.push( new Array( "Jakarta", "http://jakarta.apache.org/" ) );
-
+ if(!("@link1@"=="")){
+ PREPREND_CRUMBS.push( new Array( "@link1@", "@link1.href@" ) );
+ }
+ if(!("@link2@"=="")){
+ PREPREND_CRUMBS.push( new Array( "@link2@", "@link2.href@" ) );
+ }
+ if(!("@link3@"=="")){
+ PREPREND_CRUMBS.push( new Array( "@link3@", "@link3.href@" ) );
+ }
/**
* String to include between crumbs:
@@ -87,7 +94,7 @@
/**
* String to include at the end of the trail
*/
-var DISPLAY_POSTPREND = " :";
+var DISPLAY_POSTPREND = ":";
/**
* CSS Class to use for a single crumb:
@@ -145,12 +152,12 @@
if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) )
{
// it is, remove it and send results
- return trail.slice( 0, trail.length-1 );
+ return trail.slice( 1, trail.length-1 );
}
}
// it's not; send the trail unmodified
- return trail;
+ return trail.slice( 1, trail.length );
}
/* ========================================================================
@@ -173,7 +180,7 @@
for( var i = 0; i < dirs.length; i++ )
{
prefix += dirs[i] + postfix;
- crumbs.push( dirs[i], prefix );
+ crumbs.push( new Array( dirs[i], prefix ) );
}
}
@@ -198,8 +205,11 @@
for( var i = 0; i < crumbs.length; i++ )
{
xhtml += '<a href="' + crumbs[i][1] + '" class="' + CSS_CLASS_CRUMB +
'">';
- xhtml += crumbs[i][0];
- xhtml += '</a><span class="' + CSS_CLASS_SEPARATOR + '">' +
DISPLAY_SEPARATOR + '</span>';
+ xhtml += sentenceCase( crumbs[i][0] ) + '</a>';
+ if( i != (crumbs.length-1) )
+ {
+ xhtml += '<span class="' + CSS_CLASS_SEPARATOR + '">' +
DISPLAY_SEPARATOR + '</span>';
+ }
}
xhtml += DISPLAY_POSTPREND;
@@ -213,11 +223,12 @@
======================================================================== */
// check if we're local; if so, only print the PREPREND_CRUMBS
-if( document.location.href.toLowerCase().indexOf( "http://" ) )
+if( document.location.href.toLowerCase().indexOf( "http://" ) == -1 )
{
- document.write( getCrumbTrail( getBreadCrumbs() ) );
+ document.write( getCrumbTrail( getBreadcrumbs() ) );
}
else
{
- document.write( getCrumbTrail( getBreadCrumbs( getDirectoriesInURL() ) ) );
+ document.write( getCrumbTrail( getBreadcrumbs( getDirectoriesInURL() ) ) );
}
+
1.1
jakarta-avalon/src/documentation/skins/avalon-tigris/scripts/breadcrumbs-optimized.js
Index: breadcrumbs-optimized.js
===================================================================
var PREPREND_CRUMBS=new Array();
PREPREND_CRUMBS.push(new Array("Apache","http://www.apache.org/"));
PREPREND_CRUMBS.push(new Array("Jakarta","http://jakarta.apache.org/"));
var DISPLAY_SEPARATOR=" > ";
var DISPLAY_PREPREND="";
var DISPLAY_POSTPREND=":";
var CSS_CLASS_CRUMB="breadcrumb";
var CSS_CLASS_TRAIL="breadcrumbTrail";
var CSS_CLASS_SEPARATOR="crumbSeparator";
var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
var PATH_SEPARATOR="/";
function sc(s) {
var l=s.toLowerCase();
return l.substr(0,1).toUpperCase()+l.substr(1);
}
function getdirs() {
var t=document.location.pathname.split(PATH_SEPARATOR);
var lc=t[t.length-1];
for(var i=0;i < FILE_EXTENSIONS.length;i++)
{
if(lc.indexOf(FILE_EXTENSIONS[i]))
return t.slice(1,t.length-1); }
return t.slice(1,t.length);
}
function getcrumbs( d )
{
var pre = "/";
var post = "/";
var c = new Array();
if( d != null )
{
for(var i=0;i < d.length;i++) {
pre+=d[i]+postfix;
c.push(new Array(d[i],pre)); }
}
if(PREPREND_CRUMBS.length > 0 )
return PREPREND_CRUMBS.concat( c );
return c;
}
function gettrail( c )
{
var h='<span class="'+CSS_CLASS_TRAIL+'">'+DISPLAY_PREPREND;
for(var i=0;i < c.length;i++)
{
h+='<a href="'+c[i][1]+'"
class="'+CSS_CLASS_CRUMB+'">'+sc(c[i][0])+'</a>';
if(i!=(c.length-1))
h+='<span
class="'+CSS_CLASS_SEPARATOR+'">'+DISPLAY_SEPARATOR+'</span>'; }
return h+DISPLAY_POSTPREND+'</span>';
}
if(document.location.href.toLowerCase().indexOf("http://")==-1)
document.write(gettrail(getcrumbs()));
else
document.write(gettrail(getcrumbs(getdirs())));
1.5 +4 -1 jakarta-avalon/src/documentation/cocoon.xconf
Index: cocoon.xconf
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/documentation/cocoon.xconf,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cocoon.xconf 11 Jul 2002 14:47:28 -0000 1.4
+++ cocoon.xconf 13 Jul 2002 22:28:28 -0000 1.5
@@ -489,7 +489,7 @@
************************************************************************** -->
<entity-resolver class="org.apache.cocoon.components.resolver.ResolverImpl"
logger="core.resolver">
- <parameter name="catalog" value="/WEB-INF/entities/catalog"/>
+ <parameter name="catalog" value="/resources/schema/catalog"/>
<parameter name="verbosity" value="1"/>
</entity-resolver>
@@ -536,3 +536,6 @@
-->
</autoincrement-modules>
</cocoon>
+
+
+
1.3 +97 -117
jakarta-avalon/src/documentation/skins/avalon-tigris/xslt/html/site2xhtml.xsl
Index: site2xhtml.xsl
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/documentation/skins/avalon-tigris/xslt/html/site2xhtml.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- site2xhtml.xsl 13 Jul 2002 16:42:12 -0000 1.2
+++ site2xhtml.xsl 13 Jul 2002 22:28:28 -0000 1.3
@@ -1,119 +1,99 @@
<?xml version="1.0"?>
-
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-<xsl:template match="/">
-<html>
- <head><!-- This is a generated file. Do not edit. -->
-
- <link type="text/css" href="skin/tigris.css" rel="stylesheet"/>
- <link type="text/css" href="skin/site.css" rel="stylesheet"/>
- <link type="text/css" href="skin/print.css" rel="stylesheet" media="print" />
-
- <meta name="author" value="Avalon Documentation Team"/>
- <meta name="email" value="[EMAIL PROTECTED]"/>
-
- <title><xsl:value-of select="/site/document/title"/> - <xsl:value-of
select="/site/document/subtitle"/></title>
-
- </head>
-
- <body marginwidth="0" marginheight="0" class="composite">
-
- <div id="banner">
- <table border="0" cellspacing="0" cellpadding="8" width="100%">
- <!-- TOP IMAGE -->
- <tbody><tr>
- <td></td>
- <td align="left">
- <a href="@group-logo.href@"><img src="@group-logo.src@"
border="0"/></a>
- </td>
- <td></td>
- <td align="right">
- <a href="@project-logo.href@"><img src="@project-logo.src@"
border="0"/></a>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header -->
-
- <!-- breadcrumb trail (javascript-generated) -->
- <div id="breadcrumbs">
- <a href="@link1.href@" class="menu">@link1@ ><xsl:text>
</xsl:text></a>
- <a href="@link2.href@" class="menu">@link2@ > </a>
- <!-- <a href="@link3.href@" class="menu">@link3@</a> -->
- <!-- -->
- <script language="JavaScript1.2"
type="text/javascript">
- <![CDATA[
- function sentenceCase(str) {
- var lower = str.toLowerCase();
- return lower;
//.substr(0,1).toUpperCase() + lower.substr(1);
- }
- function getDirsAsArray() {
- var trail =
document.location.pathname.split("/");
- var lastdir =
(trail[trail.length-1].indexOf(".html") != -1)? trail.length-2 : trail.length-1;
- var urlprefix = ""; //"/avalon/";
- var postfix = " >";
- for(var i = 1; i <= lastdir; i++) {
- document.writeln('<a href=' +
urlprefix + trail[i] + ' class="menu">' + sentenceCase(trail[i]) + '</a>'+postfix);
- urlprefix += trail[i] + "/";
- if(i == lastdir-1) postfix =
"";
- }
- }
- getDirsAsArray();
- ]]>
- </script>
- <!-- -->
-
- <!--<script type="text/javascript" language="JavaScript"
src="skin/breadcrumbs.js"></script>-->
-
- </div>
- <!-- end breadcrumb trail -->
-
- <!-- BODY -->
-
- <table border="0" cellspacing="0" cellpadding="8" width="100%" id="main">
- <tbody><tr valign="top">
-
- <!-- LEFT SIDE NAVIGATION -->
- <td id="leftcol" width="20%">
- <div id="navcolumn">
- <xsl:copy-of select="/site/menu/node()|@*"/>
- </div></td>
-
-
- <td><div id="bodycol"><div class="app">
- <h1><div class="h1"><xsl:value-of
select="/site/document/title"/></div></h1>
- <h2><div class="h2"><xsl:value-of
select="/site/document/subtitle"/></div></h2>
- <div class="h3">
- <xsl:copy-of select="/site/document/body/node()|@*"/>
- </div></div>
-
-
- </div>
- </td>
- </tr>
- </tbody></table>
-
- <!-- FOOTER -->
-
-
- <div id="footer">
- <table border="0" cellspacing="0" cellpadding="4">
- <tbody><tr>
- <td align="left">Copyright © @year@ @vendor@. All Rights
Reserved.</td>
- <td></td>
- <td><script language="JavaScript">
-<![CDATA[<!--
-document.write("last modified: " + document.lastModified);
-// -->]]>
-</script></td>
- </tr>
- </tbody></table>
- </div>
-
- </body>
-</html>
-</xsl:template>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:template match="/">
+ <html>
+ <head>
+ <!-- This is a generated file. Do not edit. -->
+ <link type="text/css" href="skin/tigris.css" rel="stylesheet" />
+ <link type="text/css" href="skin/site.css" rel="stylesheet" />
+ <link type="text/css" href="skin/print.css" rel="stylesheet"
media="print" />
+
+ <meta name="author" value="Avalon Documentation Team" />
+ <meta name="email" value="[EMAIL PROTECTED]" />
+
+ <title>
+ <xsl:value-of select="/site/document/title" />
+ -
+ <xsl:value-of select="/site/document/subtitle" />
+ </title>
+ </head>
+
+ <body marginwidth="0" marginheight="0" class="composite">
+ <div id="banner">
+ <table border="0" cellspacing="0" cellpadding="8" width="100%">
+<!-- TOP IMAGE -->
+ <tbody>
+ <tr>
+ <td align="left">
+ <a href="@group-logo.href@"><img src="@group-logo.src@"
border="0" /></a>
+ </td>
+ <td align="right">
+ <a href="@project-logo.href@"><img
src="@project-logo.src@" border="0" /></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+<!-- end header -->
+<!-- breadcrumb trail (javascript-generated) -->
+ <div id="breadcrumbs">
+ <script type="text/javascript" language="JavaScript"
src="skin/breadcrumbs.js"></script>
+ <!-- optimized version crumb:
+ <script type="text/javascript" language="JavaScript"
src="skin/breadcrumbs-optimized.js"></script>
+ -->
+ </div>
+
+<!-- end breadcrumb trail -->
+
+ <table border="0" cellspacing="0" cellpadding="8" width="100%"
id="main">
+ <tbody>
+ <tr valign="top">
+<!-- LEFT SIDE NAVIGATION -->
+ <td id="leftcol" width="20%">
+ <div id="navcolumn">
+ <xsl:copy-of select="/site/menu/node()|@*" />
+ </div>
+ </td>
+<!-- BODY -->
+ <td>
+ <div id="bodycol">
+ <div class="app">
+ <div align="center">
+ <h1><xsl:value-of select="/site/document/title"
/></h1>
+ <h2><xsl:value-of select="/site/document/subtitle"
/></h2>
+ </div>
+
+ <div class="h3">
+ <xsl:copy-of
select="/site/document/body/node()|@*" />
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+<!-- FOOTER -->
+ <div id="footer">
+ <table border="0" cellspacing="0" cellpadding="4">
+ <tbody>
+ <tr>
+ <td align="left">Copyright © @year@ @vendor@. All
Rights Reserved.</td>
+ <td></td>
+ <td><script language="JavaScript">
+ <![CDATA[<!--
+ document.write("last modified: " +
document.lastModified);
+ // -->]]>
+
+ </script>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
</xsl:stylesheet>
+
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>