You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/01/29 17:50:05 UTC
svn commit: r501128 [1/2] - in /incubator/ivy/ivyde/trunk/doc: style/ xooki/
xooki/images/ xooki/tiddly/ xooki/tree/ xooki/trimpath/
Author: xavier
Date: Mon Jan 29 09:50:00 2007
New Revision: 501128
URL: http://svn.apache.org/viewvc?view=rev&rev=501128
Log:
add site
Added:
incubator/ivy/ivyde/trunk/doc/style/
incubator/ivy/ivyde/trunk/doc/style/ant.css
incubator/ivy/ivyde/trunk/doc/style/color.css
incubator/ivy/ivyde/trunk/doc/style/ivy-ref.css
incubator/ivy/ivyde/trunk/doc/style/nav.css
incubator/ivy/ivyde/trunk/doc/style/shell.css
incubator/ivy/ivyde/trunk/doc/style/style.css
incubator/ivy/ivyde/trunk/doc/xooki/
incubator/ivy/ivyde/trunk/doc/xooki/blankPageTpl.html
incubator/ivy/ivyde/trunk/doc/xooki/images/
incubator/ivy/ivyde/trunk/doc/xooki/images/addchild.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/bullet.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/closed.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/debug.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/delete.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/down.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/edit.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/open.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/save.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/images/up.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/messages.json
incubator/ivy/ivyde/trunk/doc/xooki/tiddly/
incubator/ivy/ivyde/trunk/doc/xooki/tiddly/util.js
incubator/ivy/ivyde/trunk/doc/xooki/tree/
incubator/ivy/ivyde/trunk/doc/xooki/tree/closed.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/tree/list.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/tree/open.gif (with props)
incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletree.css
incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletreemenu.js
incubator/ivy/ivyde/trunk/doc/xooki/trimpath/
incubator/ivy/ivyde/trunk/doc/xooki/trimpath/template.js
incubator/ivy/ivyde/trunk/doc/xooki/xooki.js
incubator/ivy/ivyde/trunk/doc/xooki/xookiEdit.js
Added: incubator/ivy/ivyde/trunk/doc/style/ant.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/ant.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/ant.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/ant.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,38 @@
+/*
+.ant thead td:first-child + td + td{
+ text-align: center;
+}
+*/
+
+table.ant {
+ border-collapse:collapse;
+ width:90%;
+ margin:auto;
+ margin-top: 10px;
+}
+.ant thead {
+ background-color:#DEE4CD;
+ border:1px solid #7A9437;
+}
+.ant tbody {
+ background-color:#FFFFFF;
+ border:1px solid #7A9437;
+}
+
+.ant th {
+ font-family:monospace;
+ border:1px solid #7A9437;
+ padding:5px;
+}
+
+.ant td {
+ border:1px dotted #7A9437;
+ padding:5px;
+}
+
+th.ant-att {
+ width:15%;
+}
+th.ant-desc {
+ width:50%;
+}
Added: incubator/ivy/ivyde/trunk/doc/style/color.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/color.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/color.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/color.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,136 @@
+/*
+ ivy eclipse ui color theme
+*/
+body {
+ background-color: #147;
+}
+
+#body {
+ color: #000;
+ background-color: #fff;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ color: #369;
+}
+h1 {
+ color: #fff;
+ background-color: #369;
+}
+#main > h1 {
+ color: #369;
+ background-color: #fff;
+ background: none;
+}
+a:link {
+ color: #369;
+}
+a:visited {
+ color: #369;
+}
+a:hover, a:active {
+ color: #369;
+}
+blockquote {
+ color: #696969;
+}
+pre {
+ background-color: #eee;
+ border: 1px solid #ddd;
+}
+.form-item label {
+ color: #369;
+}
+.item-list .title {
+ color: #369;
+}
+
+/*
+** Page layout blocks / IDs
+*/
+#header {
+ background-color: #ffffff;
+ /* border: 3px solid #69c; */
+}
+
+#top-menu {
+ background-color:#369;
+ border-top: 3px solid #69c;
+ border-bottom: 3px solid #69c;
+}
+
+#search .form-text, #search .form-submit {
+ border: 1px solid #369;
+}
+#search .form-submit {
+ background-color: #69c;
+}
+
+.block h2 {
+ color: #000;
+ background-color: #eee;
+}
+
+.block .content {
+ background-color: #fff;
+ border: 1px solid #eee;
+}
+/*
+.block h2 {
+ color: #000;
+}
+*/
+
+#navcontainer {
+ background-color:#369;
+}
+
+#nav {
+ background-color:#369;
+}
+
+#nav ul {
+ background-color:#369;
+ border-top: 1px solid #369;
+ border-right: 1px solid #369;
+ border-bottom: 1px solid #369;
+ border-left: 0.75em solid #369;
+}
+
+#nav li a {
+ color: #fff;
+}
+
+#nav .title {
+ color: #fff;
+ /*
+ background: #61752c;
+ */
+ background: #369;
+ border-top: 0;
+ border-right: 0;
+ border-bottom: 1px solid #369;
+ border-left: 0;
+}
+
+#nav li li a {
+ background: #fff;
+ color: #369;
+ border-top: 0;
+ border-right: 0;
+ border-bottom: 1px solid #369;
+ border-left: 0;
+}
+
+#nav a:hover,
+#nav a:active {
+ background: #69c;
+}
+
+#content {
+ border-top: 3px solid #69c;
+}
+
+#forum tr.dark {
+ background: #e0edfb;
+}
Added: incubator/ivy/ivyde/trunk/doc/style/ivy-ref.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/ivy-ref.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/ivy-ref.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/ivy-ref.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,72 @@
+/*
+.ant thead td:first-child + td + td{
+ text-align: center;
+}
+*/
+
+table.ivy-attributes {
+ border-collapse:collapse;
+ width:90%;
+ margin:auto;
+ margin-top: 10px;
+}
+.ivy-attributes thead {
+ background-color:#DEE4CD;
+ border:1px solid #7A9437;
+}
+.ivy-attributes tbody {
+ background-color:#FFFFFF;
+ border:1px solid #7A9437;
+}
+
+.ivy-attributes th {
+ font-family:monospace;
+ border:1px solid #7A9437;
+ padding:5px;
+}
+
+.ivy-attributes td {
+ border:1px dotted #7A9437;
+ padding:5px;
+}
+
+th.ivy-att {
+ width:15%;
+}
+th.ivy-att-desc {
+ width:50%;
+}
+
+table.ivy-children {
+/* border:3px solid #6495ed; */
+ border-collapse:collapse;
+ width:90%;
+ margin:auto;
+ margin-top: 10px;
+}
+.ivy-children thead {
+ background-color:#DEE4CD;
+ border:1px solid #7A9437;
+}
+.ivy-children tbody {
+ background-color:#FFFFFF;
+ border:1px solid #7A9437;
+}
+
+.ivy-children th {
+ font-family:monospace;
+ border:1px solid #7A9437;
+ padding:5px;
+}
+
+.ivy-children td {
+ border:1px dotted #7A9437;
+ padding:5px;
+}
+
+th.ivy-chld {
+ width:15%;
+}
+th.ivy-chld-desc {
+ width:50%;
+}
Added: incubator/ivy/ivyde/trunk/doc/style/nav.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/nav.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/nav.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/nav.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,96 @@
+#navcontainer {
+ width: inherit;
+ margin: 0 0 0 50px;
+ padding-left: 0;
+ height: 1.20em;
+ z-index: 100;
+}
+
+#nav {
+ font: bold 0.75em/100% Trebuchet MS, Arial, Helvetica, sans-serif;
+ float: left;
+ width: inherit;
+ list-style: none;
+ line-height: 1;
+ padding: 0;
+ margin: 0;
+ z-index: 100;
+}
+
+#nav ul {
+ font: normal 100%/140% Trebuchet MS, Arial, Helvetica, sans-serif;
+ position: absolute;
+ left: -999em;
+ height: auto;
+ width: 11.4em;
+ w\idth: 12.0em;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ z-index: 100;
+}
+
+#nav li {
+ float: left;
+ padding: 0;
+ width: auto;
+ z-index: 100;
+}
+
+#nav ul li {
+ float: left;
+ padding: 0;
+ width: 10em;
+ z-index: 100;
+}
+
+#nav li a {
+ display: block;
+ width: auto;
+ padding: 0.25em 1.0em;
+ text-decoration: none;
+}
+
+#nav .title {
+ text-align: center;
+ font-weight: 700;
+ width: 11em;
+ w\idth: 10em;
+ margin: 0;
+ padding: 0.15em 1.0em;
+}
+
+#nav li li a {
+ width: 11em;
+ w\idth: 10em;
+ margin: 0;
+ padding: 0.25em 1.0em;
+}
+
+#nav li ul ul {
+ margin: -1.75em 0 0 11em;
+ z-index: 100;
+}
+
+#nav li:hover ul ul,
+#nav li:hover ul ul ul,
+#nav li.sfhover ul ul,
+#nav li.sfhover ul ul ul {
+ left: -999em;
+ z-index: 100;
+}
+
+#nav li:hover ul,
+#nav li li:hover ul,
+#nav li li li:hover ul,
+#nav li.sfhover ul,
+#nav li li.sfhover ul,
+#nav li li li.sfhover ul {
+ left: auto;
+ z-index: 100;
+}
+
+#nav li:hover,
+#nav li.sfhover {
+ z-index: 100;
+}
Added: incubator/ivy/ivyde/trunk/doc/style/shell.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/shell.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/shell.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/shell.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,3 @@
+/* the class shell is used when a copy of the content of a shell or DOS window is made */
+.shell {background-color: black; color: white; border: medium gray solid;}
+.shell pre {background-color: black; border: none; font-size: small;}
Added: incubator/ivy/ivyde/trunk/doc/style/style.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/style/style.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/style/style.css (added)
+++ incubator/ivy/ivyde/trunk/doc/style/style.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,271 @@
+/* $Id: style.css,v 1.8 2005/03/27 18:55:35 unconed Exp $ */
+
+@import "color.css";
+@import "nav.css";
+@import "xmlverbatim.css";
+@import "ant.css";
+@import "ivy-ref.css";
+@import "shell.css";
+
+/*
+** HTML elements
+*/
+body {
+ margin: 0;
+ padding: 0;
+ bgcolor: #ffffff;
+}
+#body {
+ display: table;
+ margin: 8px auto;
+ padding: 0;
+ width: 98%;
+}
+body, p, td, li, ul, ol {
+ font-family: Verdana, Helvetica, Arial, sans-serif;
+ font-size: small;
+}
+h1, h2, h3, h4, h5, h6 {
+ font-family: "Trebuchet MS", Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif;
+}
+h1 {
+/*
+ margin-left: 15px;
+ margin-right: 15px;
+ */
+ padding-left: 10px;
+ font-size: 1.6em;
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-topright: 5px;
+ -moz-border-radius-bottomright: 5px;
+ -moz-border-radius-bottomleft: 5px;
+}
+h2 {
+ font-size: 1.4em;
+}
+h3 {
+ font-size: 1.2em;
+}
+h4 {
+ font-size: 1.1em;
+}
+tr.dark td, tr.light td {
+ padding: 0.3em;
+}
+a:link {
+ text-decoration: none;
+ font-weight: bold;
+}
+a:visited {
+ text-decoration: none;
+ font-weight: bold;
+}
+a:hover, a:active {
+ font-weight: bold;
+ text-decoration: underline;
+}
+p {
+ margin: 0 0 1.3em 0;
+ padding: 0;
+}
+blockquote {
+ padding: 0 15px 0 15px;
+ margin: 15px 50px 15px 50px;
+ text-align: left;
+ font-size: 1.2em;
+ line-height: 1.3em;
+ font-family: "Trebuchet MS", Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif;
+}
+pre {
+ padding: 0.75em 1.5em;
+ font-size: 1em;
+}
+.form-item {
+ margin-top: 1em;
+}
+.item-list .title {
+ font-size: 0.85em;
+}
+.hide {
+ display: none
+}
+
+/*
+** Page layout blocks / IDs
+*/
+#body {
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-topright: 5px;
+ -moz-border-radius-bottomright: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+#home img {
+ padding: 5px 20px 10px 10px;
+}
+.product img {
+ padding: 5px 20px 10px 10px;
+}
+
+#top-menu tr {
+ padding: 0;
+ margin: 0;
+}
+
+#top-menu td {
+ padding: 0;
+ margin: 0;
+}
+
+#search {
+ padding: 0 1em 0 1em;
+ margin: 0;
+}
+#search .form-text, #search .form-submit {
+ padding: 0;
+ margin: 0;
+ font-size: 0.85em;
+}
+#search .form-text {
+ width: 8em;
+ padding: 0;
+ margin: 0;
+}
+
+#sidebar-left, #sidebar-right {
+ width: 200px;
+ /* padding in px not ex because IE messes up 100% width tables otherwise */
+ padding: 15px 5px 75px 10px;
+ vertical-align: top;
+}
+#sidebar-left li, #sidebar-right li {
+ font-size: 1em;
+}
+.block h2 {
+ margin: 5px 0px 0px 0px;
+ padding: 1px 5px 1px 30px;
+ font-size: 1.2em;
+ font-weight: 700;
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-topright: 5px;
+}
+
+.block .content {
+ -moz-border-radius-bottomright: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ margin-bottom: 10px;
+}
+
+#main {
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-bottom: 10px;
+ background: transparent url(../images/background.png) center center no-repeat;
+}
+
+.content {
+ padding-top: 10px;
+}
+
+#forum {
+ margin: 15px 0 15px 0;
+}
+#forum table {
+ width: 100%;
+}
+#forum table tr th {
+ text-align: center;
+ font-size: 0.75em;
+}
+#forum table tr th a {
+ text-decoration: underline;
+}
+#forum table tr th img {
+ margin: 0;
+}
+#forum td {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+}
+#forum td.container a {
+ padding: 20px 0 20px 35px;
+}
+#forum td.statistics, #forum td.settings, #forum td.pager {
+ height: 1.5em;
+}
+#forum td .links {
+ padding-top: 0.7em;
+ font-size: 0.9em;
+}
+.block-forum h3 {
+ margin-bottom: .5em;
+}
+
+#footer-menu td {
+ padding-top: 3px;
+}
+
+.comparison td, .comparison th {
+ text-align: center;
+}
+
+.comment {
+ -moz-border-radius: 5px;
+ border: 1px solid #abc;
+ padding: .5em;
+ margin-bottom: 1em;
+}
+.comment .title {
+ font-size: 1em;
+ padding: 10px 0px 12px 19px;
+ background: transparent url(icon-comment.png) left center no-repeat;
+}
+.comment .new {
+ font-weight: bold;
+ font-size: 1em;
+ margin-left: 2px;
+ color: red;
+}
+.comment .picture {
+ border: 1px solid #fff;
+ float: right;
+ margin: 10px;
+}
+.submitted {
+ color: #999;
+ font-size: 0.79em;
+}
+.since {
+ font-weight: 700;
+ font-style: italic;
+}
+
+.postit {
+ margin:10px;
+ padding:10px;
+ -moz-border-radius:10px;
+ float:right;
+ width:400px;
+}
+
+table.home {
+ text-align:center;
+ color:#6e9244;
+ font-family:verdana, "Lucida Grande", arial, helvetica, sans-serif;
+}
+tr.homeitems {
+ font-size:large;
+}
+tr.homeitems td {
+ padding: 0 0.5cm 0 0.5cm;
+}
+tr.homeitems a:link, a:visited {
+ color: #6e9244;
+ text-decoration: none;
+}
+tr.homeitems a:hover {
+ text-decoration: underline;
+ background: none !important;
+}
+.home img { border-width:0; }
+
Added: incubator/ivy/ivyde/trunk/doc/xooki/blankPageTpl.html
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/blankPageTpl.html?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/blankPageTpl.html (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/blankPageTpl.html Mon Jan 29 09:50:00 2007
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <script type="text/javascript">var xookiConfig = {level: ${level}};</script>
+ <script type="text/javascript" src="${relroot}xooki/xooki.js"></script>
+</head>
+<body>
+ <textarea id="xooki-source">
+ </textarea>
+<script type="text/javascript">xooki.postProcess();</script>
+</body>
+</html>
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/addchild.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/addchild.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/addchild.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/bullet.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/bullet.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/bullet.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/closed.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/closed.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/closed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/debug.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/debug.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/debug.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/delete.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/delete.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/delete.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/down.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/down.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/down.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/edit.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/edit.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/edit.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/open.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/open.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/open.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/save.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/save.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/save.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/images/up.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/images/up.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/images/up.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/messages.json
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/messages.json?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/messages.json (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/messages.json Mon Jan 29 09:50:00 2007
@@ -0,0 +1,3 @@
+{
+ "Impossible to save changes to ${0}": "Impossible to save changes to ${0}.\n This could be because your browser doesn't support saving (instead, use FireFox if you can), or because the pathname to your Xooki file contains illegal characters"
+}
Added: incubator/ivy/ivyde/trunk/doc/xooki/tiddly/util.js
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tiddly/util.js?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/tiddly/util.js (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/tiddly/util.js Mon Jan 29 09:50:00 2007
@@ -0,0 +1,174 @@
+// utility functions borrowed from tiddly wiki: http://www.tiddlywiki.com/
+// Tiddly Wiki License:
+/*
+TiddlyWiki 2.1.3 by Jeremy Ruston, (jeremy [at] osmosoft [dot] com)
+
+Copyright (c) Osmosoft Limited 2004-2006
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions and the following disclaimer in the documentation and/or other
+materials provided with the distribution.
+
+Neither the name of the Osmosoft Limited nor the names of its contributors may be
+used to endorse or promote products derived from this software without specific
+prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+*/
+
+if (typeof xooki.io == "undefined") {
+ xooki.io = {};
+}
+
+xooki.io.saveFile = function (fileUrl, content) {
+ var r = null;
+ if((r == null) || (r == false))
+ r = mozillaSaveFile(fileUrl, content);
+ if((r == null) || (r == false))
+ r = ieSaveFile(fileUrl, content);
+ return(r);
+}
+
+xooki.io.loadFile = function (fileUrl) {
+ var r = null;
+ if((r == null) || (r == false))
+ r = mozillaLoadFile(fileUrl);
+ if((r == null) || (r == false))
+ r = ieLoadFile(fileUrl);
+ return(r);
+}
+
+xooki.io.getLocalPath = function (originalPath) {
+ // Remove any location or query part of the URL
+ var argPos = originalPath.indexOf("?");
+ if(argPos != -1)
+ originalPath = originalPath.substr(0,argPos);
+ var hashPos = originalPath.indexOf("#");
+ if(hashPos != -1)
+ originalPath = originalPath.substr(0,hashPos);
+ // Convert file://localhost/ to file:///
+ if(originalPath.indexOf("file://localhost/") == 0)
+ originalPath = "file://" + originalPath.substr(16);
+ // Convert to a native file format assuming
+ // "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
+ // "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
+ // "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
+ // "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
+ var localPath;
+ if(originalPath.charAt(9) == ":") // pc local file
+ localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
+ else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file
+ localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
+ else if(originalPath.indexOf("file:///") == 0) // mac/unix local file
+ localPath = unescape(originalPath.substr(7));
+ else if(originalPath.indexOf("file:/") == 0) // mac/unix local file
+ localPath = unescape(originalPath.substr(5));
+ else // pc network file
+ localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
+ return localPath;
+}
+
+
+// Returns null if it can't do it, false if there's an error, true if it saved OK
+function ieSaveFile(filePath, content)
+{
+ try
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to save\n\n" + e.toString());
+ return(null);
+ }
+ var file = fso.OpenTextFile(filePath,2,-1,0);
+ file.Write(content);
+ file.Close();
+ return(true);
+}
+
+// Returns null if it can't do it, false if there's an error, or a string of the content if successful
+function ieLoadFile(filePath)
+{
+ try
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ var file = fso.OpenTextFile(filePath,1);
+ var content = file.ReadAll();
+ file.Close();
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to load\n\n" + e.toString());
+ return(null);
+ }
+ return(content);
+}
+
+// Returns null if it can't do it, false if there's an error, true if it saved OK
+function mozillaSaveFile(filePath, content)
+{
+ if(window.Components)
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(filePath);
+ if (!file.exists())
+ file.create(0, 0664);
+ var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
+ out.init(file, 0x20 | 0x02, 00004,null);
+ out.write(content, content.length);
+ out.flush();
+ out.close();
+ return(true);
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to save\n\n" + e);
+ return(false);
+ }
+ return(null);
+}
+
+// Returns null if it can't do it, false if there's an error, or a string of the content if successful
+function mozillaLoadFile(filePath)
+{
+ if(window.Components)
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(filePath);
+ if (!file.exists())
+ return(null);
+ var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
+ inputStream.init(file, 0x01, 00004, null);
+ var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
+ sInputStream.init(inputStream);
+ return(sInputStream.read(sInputStream.available()));
+ }
+ catch(e)
+ {
+ //alert("Exception while attempting to load\n\n" + e);
+ return(false);
+ }
+ return(null);
+}
+
+// end tiddly wiki borrowed code
Added: incubator/ivy/ivyde/trunk/doc/xooki/tree/closed.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tree/closed.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/tree/closed.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/tree/list.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tree/list.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/tree/list.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/tree/open.gif
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tree/open.gif?view=auto&rev=501128
==============================================================================
Binary file - no diff available.
Propchange: incubator/ivy/ivyde/trunk/doc/xooki/tree/open.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletree.css
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletree.css?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletree.css (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletree.css Mon Jan 29 09:50:00 2007
@@ -0,0 +1,26 @@
+.treeview ul{ /*CSS for Simple Tree Menu*/
+margin: 0;
+padding: 0;
+}
+
+.treeview li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
+background: white url(../images/bullet.gif) no-repeat left center;
+list-style-type: none;
+padding-left: 22px;
+margin-bottom: 3px;
+}
+
+.treeview li.submenu{ /* Style for LI that contains sub lists (other ULs). */
+background: white url(../images/closed.gif) no-repeat left 1px;
+cursor: hand !important;
+cursor: pointer !important;
+}
+
+
+.treeview li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
+display: none; /*Hide them by default. Don't delete. */
+}
+
+.treeview .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
+cursor: default;
+}
Added: incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletreemenu.js
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletreemenu.js?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletreemenu.js (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/tree/simpletreemenu.js Mon Jan 29 09:50:00 2007
@@ -0,0 +1,139 @@
+/***********************************************
+* Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+var persisteduls=new Object()
+var ddtreemenu=new Object()
+
+ddtreemenu.closefolder=xooki.u("images/closed.gif") //set image path to "closed" folder image
+ddtreemenu.openfolder=xooki.u("images/open.gif") //set image path to "open" folder image
+
+//////////No need to edit beyond here///////////////////////////
+
+ddtreemenu.createTree=function(treeid, enablepersist, persistdays){
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+if (typeof persisteduls[treeid]=="undefined")
+persisteduls[treeid]=(enablepersist==true && ddtreemenu.getCookie(treeid)!="")? ddtreemenu.getCookie(treeid).split(",") : ""
+for (var i=0; i<ultags.length; i++)
+ddtreemenu.buildSubTree(treeid, ultags[i], i)
+if (enablepersist==true){ //if enable persist feature
+var durationdays=(typeof persistdays=="undefined")? 1 : parseInt(persistdays)
+ddtreemenu.dotask(window, function(){ddtreemenu.rememberstate(treeid, durationdays)}, "unload") //save opened UL indexes on body unload
+}
+}
+
+ddtreemenu.buildSubTree=function(treeid, ulelement, index){
+ulelement.parentNode.className="submenu"
+if (typeof persisteduls[treeid]=="object"){ //if cookie exists (persisteduls[treeid] is an array versus "" string)
+if (ddtreemenu.searcharray(persisteduls[treeid], index)){
+ulelement.setAttribute("rel", "open")
+ulelement.style.display="block"
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+else /* start patch Xavier Hanin */ if (ulelement.getAttribute("rel") != "open") /* end patch Xavier Hanin */
+ulelement.setAttribute("rel", "closed")
+} //end cookie persist code
+else if (ulelement.getAttribute("rel")==null || ulelement.getAttribute("rel")==false) //if no cookie and UL has NO rel attribute explicted added by user
+ulelement.setAttribute("rel", "closed")
+else if (ulelement.getAttribute("rel")=="open") //else if no cookie and this UL has an explicit rel value of "open"
+ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
+ulelement.parentNode.onclick=function(e){
+var submenu=this.getElementsByTagName("ul")[0]
+if (submenu.getAttribute("rel")=="closed"){
+submenu.style.display="block"
+submenu.setAttribute("rel", "open")
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+else if (submenu.getAttribute("rel")=="open"){
+submenu.style.display="none"
+submenu.setAttribute("rel", "closed")
+ulelement.parentNode.style.backgroundImage="url("+ddtreemenu.closefolder+")"
+}
+ddtreemenu.preventpropagate(e)
+}
+ulelement.onclick=function(e){
+ddtreemenu.preventpropagate(e)
+}
+}
+
+ddtreemenu.expandSubTree=function(treeid, ulelement){ //expand a UL element and any of its parent ULs
+var rootnode=document.getElementById(treeid)
+var currentnode=ulelement
+currentnode.style.display="block"
+currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+while (currentnode!=rootnode){
+if (currentnode.tagName=="UL"){ //if parent node is a UL, expand it too
+currentnode.style.display="block"
+currentnode.setAttribute("rel", "open") //indicate it's open
+currentnode.parentNode.style.backgroundImage="url("+ddtreemenu.openfolder+")"
+}
+currentnode=currentnode.parentNode
+}
+}
+
+ddtreemenu.flatten=function(treeid, action){ //expand or contract all UL elements
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+for (var i=0; i<ultags.length; i++){
+ultags[i].style.display=(action=="expand")? "block" : "none"
+var relvalue=(action=="expand")? "open" : "closed"
+ultags[i].setAttribute("rel", relvalue)
+ultags[i].parentNode.style.backgroundImage=(action=="expand")? "url("+ddtreemenu.openfolder+")" : "url("+ddtreemenu.closefolder+")"
+}
+}
+
+ddtreemenu.rememberstate=function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
+var ultags=document.getElementById(treeid).getElementsByTagName("ul")
+var openuls=new Array()
+for (var i=0; i<ultags.length; i++){
+if (ultags[i].getAttribute("rel")=="open")
+openuls[openuls.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
+}
+if (openuls.length==0) //if there are no opened ULs to save/persist
+openuls[0]="none open" //set array value to string to simply indicate all ULs should persist with state being closed
+ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
+}
+
+////A few utility functions below//////////////////////
+
+ddtreemenu.getCookie=function(Name){ //get cookie value
+var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
+if (document.cookie.match(re)) //if cookie found
+return document.cookie.match(re)[0].split("=")[1] //return its value
+return ""
+}
+
+ddtreemenu.setCookie=function(name, value, days){ //set cookei value
+var expireDate = new Date()
+//set "expstring" to either future or past date, to set or delete cookie, respectively
+var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days))
+document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
+}
+
+ddtreemenu.searcharray=function(thearray, value){ //searches an array for the entered value. If found, delete value from array
+var isfound=false
+for (var i=0; i<thearray.length; i++){
+if (thearray[i]==value){
+isfound=true
+thearray.shift() //delete this element from array for efficiency sake
+break
+}
+}
+return isfound
+}
+
+ddtreemenu.preventpropagate=function(e){ //prevent action from bubbling upwards
+if (typeof e!="undefined")
+e.stopPropagation()
+else
+event.cancelBubble=true
+}
+
+ddtreemenu.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
+var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
+if (target.addEventListener)
+target.addEventListener(tasktype, functionref, false)
+else if (target.attachEvent)
+target.attachEvent(tasktype, functionref)
+}
Added: incubator/ivy/ivyde/trunk/doc/xooki/trimpath/template.js
URL: http://svn.apache.org/viewvc/incubator/ivy/ivyde/trunk/doc/xooki/trimpath/template.js?view=auto&rev=501128
==============================================================================
--- incubator/ivy/ivyde/trunk/doc/xooki/trimpath/template.js (added)
+++ incubator/ivy/ivyde/trunk/doc/xooki/trimpath/template.js Mon Jan 29 09:50:00 2007
@@ -0,0 +1,397 @@
+/**
+ * TrimPath Template. Release 1.0.38.
+ * Copyright (C) 2004, 2005 Metaha.
+ *
+ * TrimPath Template is licensed under the GNU General Public License
+ * and the Apache License, Version 2.0, as follows:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Licensed 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.
+ */
+var TrimPath;
+
+// TODO: Debugging mode vs stop-on-error mode - runtime flag.
+// TODO: Handle || (or) characters and backslashes.
+// TODO: Add more modifiers.
+
+(function() { // Using a closure to keep global namespace clean.
+ if (TrimPath == null)
+ TrimPath = new Object();
+ if (TrimPath.evalEx == null)
+ TrimPath.evalEx = function(src) { return eval(src); };
+
+ var UNDEFINED;
+ if (Array.prototype.pop == null) // IE 5.x fix from Igor Poteryaev.
+ Array.prototype.pop = function() {
+ if (this.length === 0) {return UNDEFINED;}
+ return this[--this.length];
+ };
+ if (Array.prototype.push == null) // IE 5.x fix from Igor Poteryaev.
+ Array.prototype.push = function() {
+ for (var i = 0; i < arguments.length; ++i) {this[this.length] = arguments[i];}
+ return this.length;
+ };
+
+ TrimPath.parseTemplate = function(tmplContent, optTmplName, optEtc) {
+ if (optEtc == null)
+ optEtc = TrimPath.parseTemplate_etc;
+ var funcSrc = parse(tmplContent, optTmplName, optEtc);
+ var func = TrimPath.evalEx(funcSrc, optTmplName, 1);
+ if (func != null)
+ return new optEtc.Template(optTmplName, tmplContent, funcSrc, func, optEtc);
+ return null;
+ }
+
+ try {
+ String.prototype.process = function(context, optFlags) {
+ var template = TrimPath.parseTemplate(this, null);
+ if (template != null)
+ return template.process(context, optFlags);
+ return this;
+ }
+ } catch (e) { // Swallow exception, such as when String.prototype is sealed.
+ }
+
+ TrimPath.parseTemplate_etc = {}; // Exposed for extensibility.
+ TrimPath.parseTemplate_etc.statementTag = "forelse|for|if|elseif|else|var|macro";
+ TrimPath.parseTemplate_etc.statementDef = { // Lookup table for statement tags.
+ "if" : { delta: 1, prefix: "if (", suffix: ") {", paramMin: 1 },
+ "else" : { delta: 0, prefix: "} else {" },
+ "elseif" : { delta: 0, prefix: "} else if (", suffix: ") {", paramDefault: "true" },
+ "/if" : { delta: -1, prefix: "}" },
+ "for" : { delta: 1, paramMin: 3,
+ prefixFunc : function(stmtParts, state, tmplName, etc) {
+ if (stmtParts[2] != "in")
+ throw new etc.ParseError(tmplName, state.line, "bad for loop statement: " + stmtParts.join(' '));
+ var iterVar = stmtParts[1];
+ var listVar = "__LIST__" + iterVar;
+ return [ "var ", listVar, " = ", stmtParts[3], ";",
+ // Fix from Ross Shaull for hash looping, make sure that we have an array of loop lengths to treat like a stack.
+ "var __LENGTH_STACK__;",
+ "if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();",
+ "__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;", // Push a new for-loop onto the stack of loop lengths.
+ "if ((", listVar, ") != null) { ",
+ "var ", iterVar, "_ct = 0;", // iterVar_ct variable, added by B. Bittman
+ "for (var ", iterVar, "_index in ", listVar, ") { ",
+ iterVar, "_ct++;",
+ "if (typeof(", listVar, "[", iterVar, "_index]) == 'function') {continue;}", // IE 5.x fix from Igor Poteryaev.
+ "__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;",
+ "var ", iterVar, " = ", listVar, "[", iterVar, "_index];" ].join("");
+ } },
+ "forelse" : { delta: 0, prefix: "} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (", suffix: ") {", paramDefault: "true" },
+ "/for" : { delta: -1, prefix: "} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];" }, // Remove the just-finished for-loop from the stack of loop lengths.
+ "var" : { delta: 0, prefix: "var ", suffix: ";" },
+ "macro" : { delta: 1,
+ prefixFunc : function(stmtParts, state, tmplName, etc) {
+ var macroName = stmtParts[1].split('(')[0];
+ return [ "var ", macroName, " = function",
+ stmtParts.slice(1).join(' ').substring(macroName.length),
+ "{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; " ].join('');
+ } },
+ "/macro" : { delta: -1, prefix: " return _OUT_arr.join(''); };" }
+ }
+ TrimPath.parseTemplate_etc.modifierDef = {
+ "eat" : function(v) { return ""; },
+ "escape" : function(s) { return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); },
+ "capitalize" : function(s) { return String(s).toUpperCase(); },
+ "default" : function(s, d) { return s != null ? s : d; }
+ }
+ TrimPath.parseTemplate_etc.modifierDef.h = TrimPath.parseTemplate_etc.modifierDef.escape;
+
+ TrimPath.parseTemplate_etc.Template = function(tmplName, tmplContent, funcSrc, func, etc) {
+ this.process = function(context, flags) {
+ if (context == null)
+ context = {};
+ if (context._MODIFIERS == null)
+ context._MODIFIERS = {};
+ if (context.defined == null)
+ context.defined = function(str) { return (context[str] != undefined); };
+ for (var k in etc.modifierDef) {
+ if (context._MODIFIERS[k] == null)
+ context._MODIFIERS[k] = etc.modifierDef[k];
+ }
+ if (flags == null)
+ flags = {};
+ var resultArr = [];
+ var resultOut = { write: function(m) { resultArr.push(m); } };
+ try {
+ func(resultOut, context, flags);
+ } catch (e) {
+ if (flags.throwExceptions == true)
+ throw e;
+ var result = new String(resultArr.join("") + "[ERROR: " + e.toString() + (e.message ? '; ' + e.message : '') + "]");
+ result["exception"] = e;
+ return result;
+ }
+ return resultArr.join("");
+ }
+ this.name = tmplName;
+ this.source = tmplContent;
+ this.sourceFunc = funcSrc;
+ this.toString = function() { return "TrimPath.Template [" + tmplName + "]"; }
+ }
+ TrimPath.parseTemplate_etc.ParseError = function(name, line, message) {
+ this.name = name;
+ this.line = line;
+ this.message = message;
+ }
+ TrimPath.parseTemplate_etc.ParseError.prototype.toString = function() {
+ return ("TrimPath template ParseError in " + this.name + ": line " + this.line + ", " + this.message);
+ }
+
+ var parse = function(body, tmplName, etc) {
+ body = cleanWhiteSpace(body);
+ var funcText = [ "var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {" ];
+ var state = { stack: [], line: 1 }; // TODO: Fix line number counting.
+ var endStmtPrev = -1;
+ while (endStmtPrev + 1 < body.length) {
+ var begStmt = endStmtPrev;
+ // Scan until we find some statement markup.
+ begStmt = body.indexOf("{", begStmt + 1);
+ while (begStmt >= 0) {
+ var endStmt = body.indexOf('}', begStmt + 1);
+ var stmt = body.substring(begStmt, endStmt);
+ var blockrx = stmt.match(/^\{(cdata|minify|eval)/); // From B. Bittman, minify/eval/cdata implementation.
+ if (blockrx) {
+ var blockType = blockrx[1];
+ var blockMarkerBeg = begStmt + blockType.length + 1;
+ var blockMarkerEnd = body.indexOf('}', blockMarkerBeg);
+ if (blockMarkerEnd >= 0) {
+ var blockMarker;
+ if( blockMarkerEnd - blockMarkerBeg <= 0 ) {
+ blockMarker = "{/" + blockType + "}";
+ } else {
+ blockMarker = body.substring(blockMarkerBeg + 1, blockMarkerEnd);
+ }
+
+ var blockEnd = body.indexOf(blockMarker, blockMarkerEnd + 1);
+ if (blockEnd >= 0) {
+ emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
+
+ var blockText = body.substring(blockMarkerEnd + 1, blockEnd);
+ if (blockType == 'cdata') {
+ emitText(blockText, funcText);
+ } else if (blockType == 'minify') {
+ emitText(scrubWhiteSpace(blockText), funcText);
+ } else if (blockType == 'eval') {
+ if (blockText != null && blockText.length > 0) // From B. Bittman, eval should not execute until process().
+ funcText.push('_OUT.write( (function() { ' + blockText + ' })() );');
+ }
+ begStmt = endStmtPrev = blockEnd + blockMarker.length - 1;
+ }
+ }
+ } else if (body.charAt(begStmt - 1) != '$' && // Not an expression or backslashed,
+ body.charAt(begStmt - 1) != '\\') { // so check if it is a statement tag.
+ var offset = (body.charAt(begStmt + 1) == '/' ? 2 : 1); // Close tags offset of 2 skips '/'.
+ // 10 is larger than maximum statement tag length.
+ if (body.substring(begStmt + offset, begStmt + 10 + offset).search(TrimPath.parseTemplate_etc.statementTag) == 0)
+ break; // Found a match.
+ }
+ begStmt = body.indexOf("{", begStmt + 1);
+ }
+ if (begStmt < 0) // In "a{for}c", begStmt will be 1.
+ break;
+ var endStmt = body.indexOf("}", begStmt + 1); // In "a{for}c", endStmt will be 5.
+ if (endStmt < 0)
+ break;
+ emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
+ emitStatement(body.substring(begStmt, endStmt + 1), state, funcText, tmplName, etc);
+ endStmtPrev = endStmt;
+ }
+ emitSectionText(body.substring(endStmtPrev + 1), funcText);
+ if (state.stack.length != 0)
+ throw new etc.ParseError(tmplName, state.line, "unclosed, unmatched statement(s): " + state.stack.join(","));
+ funcText.push("}}; TrimPath_Template_TEMP");
+ return funcText.join("");
+ }
+
+ var emitStatement = function(stmtStr, state, funcText, tmplName, etc) {
+ var parts = stmtStr.slice(1, -1).split(' ');
+ var stmt = etc.statementDef[parts[0]]; // Here, parts[0] == for/if/else/...
+ if (stmt == null) { // Not a real statement.
+ emitSectionText(stmtStr, funcText);
+ return;
+ }
+ if (stmt.delta < 0) {
+ if (state.stack.length <= 0)
+ throw new etc.ParseError(tmplName, state.line, "close tag does not match any previous statement: " + stmtStr);
+ state.stack.pop();
+ }
+ if (stmt.delta > 0)
+ state.stack.push(stmtStr);
+
+ if (stmt.paramMin != null &&
+ stmt.paramMin >= parts.length)
+ throw new etc.ParseError(tmplName, state.line, "statement needs more parameters: " + stmtStr);
+ if (stmt.prefixFunc != null)
+ funcText.push(stmt.prefixFunc(parts, state, tmplName, etc));
+ else
+ funcText.push(stmt.prefix);
+ if (stmt.suffix != null) {
+ if (parts.length <= 1) {
+ if (stmt.paramDefault != null)
+ funcText.push(stmt.paramDefault);
+ } else {
+ for (var i = 1; i < parts.length; i++) {
+ if (i > 1)
+ funcText.push(' ');
+ funcText.push(parts[i]);
+ }
+ }
+ funcText.push(stmt.suffix);
+ }
+ }
+
+ var emitSectionText = function(text, funcText) {
+ if (text.length <= 0)
+ return;
+ var nlPrefix = 0; // Index to first non-newline in prefix.
+ var nlSuffix = text.length - 1; // Index to first non-space/tab in suffix.
+ while (nlPrefix < text.length && (text.charAt(nlPrefix) == '\n'))
+ nlPrefix++;
+ while (nlSuffix >= 0 && (text.charAt(nlSuffix) == ' ' || text.charAt(nlSuffix) == '\t'))
+ nlSuffix--;
+ if (nlSuffix < nlPrefix)
+ nlSuffix = nlPrefix;
+ if (nlPrefix > 0) {
+ funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
+ var s = text.substring(0, nlPrefix).replace('\n', '\\n'); // A macro IE fix from BJessen.
+ if (s.charAt(s.length - 1) == '\n')
+ s = s.substring(0, s.length - 1);
+ funcText.push(s);
+ funcText.push('");');
+ }
+ var lines = text.substring(nlPrefix, nlSuffix + 1).split('\n');
+ for (var i = 0; i < lines.length; i++) {
+ emitSectionTextLine(lines[i], funcText);
+ if (i < lines.length - 1)
+ funcText.push('_OUT.write("\\n");\n');
+ }
+ if (nlSuffix + 1 < text.length) {
+ funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
+ var s = text.substring(nlSuffix + 1).replace('\n', '\\n');
+ if (s.charAt(s.length - 1) == '\n')
+ s = s.substring(0, s.length - 1);
+ funcText.push(s);
+ funcText.push('");');
+ }
+ }
+
+ var emitSectionTextLine = function(line, funcText) {
+ var endMarkPrev = '}';
+ var endExprPrev = -1;
+ while (endExprPrev + endMarkPrev.length < line.length) {
+ var begMark = "${", endMark = "}";
+ var begExpr = line.indexOf(begMark, endExprPrev + endMarkPrev.length); // In "a${b}c", begExpr == 1
+ if (begExpr < 0)
+ break;
+ if (line.charAt(begExpr + 2) == '%') {
+ begMark = "${%";
+ endMark = "%}";
+ }
+ var endExpr = line.indexOf(endMark, begExpr + begMark.length); // In "a${b}c", endExpr == 4;
+ if (endExpr < 0)
+ break;
+ emitText(line.substring(endExprPrev + endMarkPrev.length, begExpr), funcText);
+ // Example: exprs == 'firstName|default:"John Doe"|capitalize'.split('|')
+ var exprArr = line.substring(begExpr + begMark.length, endExpr).replace(/\|\|/g, "#@@#").split('|');
+ for (var k in exprArr) {
+ if (exprArr[k].replace) // IE 5.x fix from Igor Poteryaev.
+ exprArr[k] = exprArr[k].replace(/#@@#/g, '||');
+ }
+ funcText.push('_OUT.write(');
+ emitExpression(exprArr, exprArr.length - 1, funcText);
+ funcText.push(');');
+ endExprPrev = endExpr;
+ endMarkPrev = endMark;
+ }
+ emitText(line.substring(endExprPrev + endMarkPrev.length), funcText);
+ }
+
+ var emitText = function(text, funcText) {
+ if (text == null ||
+ text.length <= 0)
+ return;
+ text = text.replace(/\\/g, '\\\\');
+ text = text.replace(/\n/g, '\\n');
+ text = text.replace(/"/g, '\\"');
+ funcText.push('_OUT.write("');
+ funcText.push(text);
+ funcText.push('");');
+ }
+
+ var emitExpression = function(exprArr, index, funcText) {
+ // Ex: foo|a:x|b:y1,y2|c:z1,z2 is emitted as c(b(a(foo,x),y1,y2),z1,z2)
+ var expr = exprArr[index]; // Ex: exprArr == [firstName,capitalize,default:"John Doe"]
+ if (index <= 0) { // Ex: expr == 'default:"John Doe"'
+ funcText.push(expr);
+ return;
+ }
+ var parts = expr.split(':');
+ funcText.push('_MODIFIERS["');
+ funcText.push(parts[0]); // The parts[0] is a modifier function name, like capitalize.
+ funcText.push('"](');
+ emitExpression(exprArr, index - 1, funcText);
+ if (parts.length > 1) {
+ funcText.push(',');
+ funcText.push(parts[1]);
+ }
+ funcText.push(')');
+ }
+
+ var cleanWhiteSpace = function(result) {
+ result = result.replace(/\t/g, " ");
+ result = result.replace(/\r\n/g, "\n");
+ result = result.replace(/\r/g, "\n");
+ result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, '$1'); // Right trim by Igor Poteryaev.
+ return result;
+ }
+
+ var scrubWhiteSpace = function(result) {
+ result = result.replace(/^\s+/g, "");
+ result = result.replace(/\s+$/g, "");
+ result = result.replace(/\s+/g, " ");
+ result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, '$1'); // Right trim by Igor Poteryaev.
+ return result;
+ }
+
+ // The DOM helper functions depend on DOM/DHTML, so they only work in a browser.
+ // However, these are not considered core to the engine.
+ //
+ TrimPath.parseDOMTemplate = function(elementId, optDocument, optEtc) {
+ if (optDocument == null)
+ optDocument = document;
+ var element = optDocument.getElementById(elementId);
+ var content = element.value; // Like textarea.value.
+ if (content == null)
+ content = element.innerHTML; // Like textarea.innerHTML.
+ content = content.replace(/</g, "<").replace(/>/g, ">");
+ return TrimPath.parseTemplate(content, elementId, optEtc);
+ }
+
+ TrimPath.processDOMTemplate = function(elementId, context, optFlags, optDocument, optEtc) {
+ return TrimPath.parseDOMTemplate(elementId, optDocument, optEtc).process(context, optFlags);
+ }
+}) ();