Author: gmcdonald Date: Wed Sep 17 04:23:36 2008 New Revision: 696247 URL: http://svn.apache.org/viewvc?rev=696247&view=rev Log: Add odt contract, update ajax-example contract.
Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft (with props) forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/images/odt.gif (with props) Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/ajax-example.ft Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/ajax-example.ft URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/ajax-example.ft?rev=696247&r1=696246&r2=696247&view=diff ============================================================================== --- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/ajax-example.ft (original) +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/ajax-example.ft Wed Sep 17 04:23:36 2008 @@ -18,7 +18,7 @@ <forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:forrest="http://apache.org/forrest/templates/1.0" - name="ajax-example" type="nugget"> + name="ajax-example"> <description> <p> This contract is an example how to use ajax in forrest. @@ -37,10 +37,13 @@ <![CDATA[<forrest:contract name="ajax-example"/>]]> </usage> <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0" - format="html" name="ajax-example" inputFormat="xsl" body="true" head="true"> + name="ajax-example" inputFormat="xsl"> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:template name="ajax-example-head"> + <xsl:param name="ajax-example-head"> + <xsl:template match="/"> + <forrest:content> + <forrest:part xpath="/html/head"> <script type="text/javascript"> function preview(div){ $(div).innerHTML="please stand by"; @@ -51,8 +54,12 @@ alert('Sorry. There was an error.'); } </script> + </forrest:part> + </forrest:content> </xsl:template> <xsl:template name="ajax-example-body"> + <forrest:content> + <forrest:part> <div class="warning"> <div class="label">Warning</div> <div class="content">This example <strong>only</strong> works in <strong>http://localhost:8888/</strong>.</div> @@ -64,6 +71,8 @@ 'http://localhost:8888/less.contract.project-ajax-example.xml'; </p> <div id="testDiv">testDiv</div> + </forrest:part> + </forrest:content> </xsl:template> </xsl:stylesheet> </forrest:template> Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft?rev=696247&view=auto ============================================================================== --- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft (added) +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft Wed Sep 17 04:23:36 2008 @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<forrest:contract name="content-odt-link" + xmlns:forrest="http://apache.org/forrest/templates/1.0"> + <description> + content-odt-link will output the ODT link with image to the content. + </description> + <usage> +<![CDATA[<forrest:contract name="content-odt-link"/>]]> + </usage> + <forrest:template + xmlns:forrest="http://apache.org/forrest/templates/1.0" + name="content-odt-link" inputFormat="xsl" > + <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:param name="defaultVariables" select="'test.html'"/> + <xsl:variable name="skin-img-dir" select="$defaultVariables/*/[EMAIL PROTECTED]'skin-img-dir']/@value"/> + <xsl:variable name="filename-noext" select="$defaultVariables/*/[EMAIL PROTECTED]'filename-noext']/@value"/> + <xsl:template match="/"> + <forrest:content> + <forrest:part><a href="{$filename-noext}.odt" class="format"> + <img class="skin" src="{$skin-img-dir}/odt.gif" + alt="ODT - icon"/> + <span class="caption">ODT</span></a> + </forrest:part> + </forrest:content> + </xsl:template> + </xsl:stylesheet> + </forrest:template> +</forrest:contract> Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-odt-link.ft ------------------------------------------------------------------------------ svn:eol-style = native Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/images/odt.gif URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/images/odt.gif?rev=696247&view=auto ============================================================================== Binary file - no diff available. Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/images/odt.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream