You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/11/30 06:35:44 UTC

svn commit: r885334 - in /incubator/pivot/site/trunk: www/index.xml www/news.html www/news.xml xsl/demo-index.xsl xsl/demo.xsl xsl/project.xsl

Author: tvolkert
Date: Mon Nov 30 05:35:43 2009
New Revision: 885334

URL: http://svn.apache.org/viewvc?rev=885334&view=rev
Log:
Site updates

Added:
    incubator/pivot/site/trunk/www/news.xml   (with props)
Removed:
    incubator/pivot/site/trunk/www/news.html
Modified:
    incubator/pivot/site/trunk/www/index.xml
    incubator/pivot/site/trunk/xsl/demo-index.xsl
    incubator/pivot/site/trunk/xsl/demo.xsl
    incubator/pivot/site/trunk/xsl/project.xsl

Modified: incubator/pivot/site/trunk/www/index.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/site/trunk/www/index.xml?rev=885334&r1=885333&r2=885334&view=diff
==============================================================================
--- incubator/pivot/site/trunk/www/index.xml (original)
+++ incubator/pivot/site/trunk/www/index.xml Mon Nov 30 05:35:43 2009
@@ -29,7 +29,7 @@
         the Java platform.
       </p>
       <ul class="stageBtn">
-        <item class="stageDemos" name="Demos" href="~release/demos/"
+        <item class="stageDemos" name="Demos" href="demos/"
             caption="What you can do with Pivot"/>
         <item class="stageDl" name="Download" href="~download"
             caption="Get the current release (1.4)"/>

Added: incubator/pivot/site/trunk/www/news.xml
URL: http://svn.apache.org/viewvc/incubator/pivot/site/trunk/www/news.xml?rev=885334&view=auto
==============================================================================
--- incubator/pivot/site/trunk/www/news.xml (added)
+++ incubator/pivot/site/trunk/www/news.xml Mon Nov 30 05:35:43 2009
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<document item-group="about">
+
+  <properties>
+    <title>News</title>
+  </properties>
+
+  <body>
+
+    TODO
+
+  </body>
+</document>

Propchange: incubator/pivot/site/trunk/www/news.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/pivot/site/trunk/www/news.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/pivot/site/trunk/xsl/demo-index.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/site/trunk/xsl/demo-index.xsl?rev=885334&r1=885333&r2=885334&view=diff
==============================================================================
--- incubator/pivot/site/trunk/xsl/demo-index.xsl (original)
+++ incubator/pivot/site/trunk/xsl/demo-index.xsl Mon Nov 30 05:35:43 2009
@@ -88,18 +88,10 @@
         <xsl:param name="new-window"/>
         <xsl:param name="last"/>
 
-        <xsl:variable name="target">
-            <xsl:choose>
-                <xsl:when test="boolean($new-window)">_new</xsl:when>
-                <xsl:otherwise>_self</xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-
-        <xsl:variable name="list-item-style">
-            <xsl:if test="boolean($last)">margin-right:0;</xsl:if>
-        </xsl:variable>
-
-        <li style="{$list-item-style}">
+        <xsl:element name="li">
+            <xsl:if test="boolean($last)">
+                <xsl:attribute name="style">margin-right:0;</xsl:attribute>
+            </xsl:if>
             <h2><xsl:value-of select="$title"/></h2>
             <div class="featuredDemosBox">
                 <xsl:if test="$project/demo-screenshots/screenshot[@id=$id]">
@@ -108,19 +100,33 @@
                         <xsl:value-of select="$project/demo-screenshots/screenshot[@id=$id]"/>
                     </xsl:variable>
                     <p class="featuredDemoImg">
-                        <a href="{$href}" target="{$target}">
+                        <xsl:element name="a">
+                            <xsl:attribute name="href">
+                                <xsl:value-of select="$href"/>
+                            </xsl:attribute>
+                            <xsl:if test="boolean($new-window)">
+                                <xsl:attribute name="target">_new</xsl:attribute>
+                            </xsl:if>
                             <img src="{$src}" alt="{$title}"/>
-                        </a>
+                        </xsl:element>
                     </p>
                 </xsl:if>
                 <p class="featuredDemoDesc">
                     <xsl:value-of select="$description"/>
                 </p>
                 <p class="featuredDemoView">
-                    <a href="{$href}" target="{$target}">View</a>
+                    <xsl:element name="a">
+                        <xsl:attribute name="href">
+                            <xsl:value-of select="$href"/>
+                        </xsl:attribute>
+                        <xsl:if test="boolean($new-window)">
+                            <xsl:attribute name="target">_new</xsl:attribute>
+                        </xsl:if>
+                        <xsl:value-of select="'View'"/>
+                    </xsl:element>
                 </p>
             </div>
-        </li>
+        </xsl:element>
     </xsl:template>
 
     <xsl:template name="other-demo">
@@ -129,17 +135,20 @@
         <xsl:param name="href"/>
         <xsl:param name="new-window"/>
 
-        <xsl:variable name="target">
-            <xsl:choose>
-                <xsl:when test="boolean($new-window)">_new</xsl:when>
-                <xsl:otherwise>_self</xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-
         <li>
             <strong><xsl:value-of select="$title"/></strong>
             <em><xsl:value-of select="$description"/></em>
-            <div class="btnView"><a href="{$href}" target="{$target}"><span>View</span></a></div>
+            <div class="btnView">
+                <xsl:element name="a">
+                    <xsl:attribute name="href">
+                        <xsl:value-of select="$href"/>
+                    </xsl:attribute>
+                    <xsl:if test="boolean($new-window)">
+                        <xsl:attribute name="target">_new</xsl:attribute>
+                    </xsl:if>
+                    <span>View</span>
+                </xsl:element>
+            </div>
         </li>
     </xsl:template>
 </xsl:stylesheet>

Modified: incubator/pivot/site/trunk/xsl/demo.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/site/trunk/xsl/demo.xsl?rev=885334&r1=885333&r2=885334&view=diff
==============================================================================
--- incubator/pivot/site/trunk/xsl/demo.xsl (original)
+++ incubator/pivot/site/trunk/xsl/demo.xsl Mon Nov 30 05:35:43 2009
@@ -19,6 +19,40 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
     <xsl:import href="auxilliary.xsl"/>
 
+    <!-- Override document template to check for full-screen demos -->
+    <xsl:template match="document">
+        <xsl:choose>
+            <xsl:when test="boolean(properties/full-screen)">
+                <html xmlns="http://www.w3.org/1999/xhtml">
+                    <head>
+                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+                        <xsl:call-template name="page-title"/>
+                        <style type="text/css">
+                            * {
+                                padding: 0px;
+                                margin: 0px;
+                            }
+
+                            html, body {
+                                height: 100%;
+                                overflow: hidden;
+                            }
+                        </style>
+                        <xsl:apply-templates select="head"/>
+                        <xsl:call-template name="google-analytics"/>
+                    </head>
+
+                    <body>
+                        <xsl:apply-templates select="//application"/>
+                    </body>
+                </html>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:apply-imports/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
     <!-- Override group navigation to pull from the demos index -->
     <xsl:template name="group-navigation">
         <xsl:apply-templates select="$demos-index/body//application-item"/>
@@ -31,8 +65,7 @@
             var attributes = {
                 code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
                 width:"<xsl:value-of select="@width"/>",
-                height:"<xsl:value-of select="@height"/>",
-                style:"border:solid 1px #999999"
+                height:"<xsl:value-of select="@height"/>"
             };
 
             <xsl:for-each select="attributes/*">

Modified: incubator/pivot/site/trunk/xsl/project.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/site/trunk/xsl/project.xsl?rev=885334&r1=885333&r2=885334&view=diff
==============================================================================
--- incubator/pivot/site/trunk/xsl/project.xsl (original)
+++ incubator/pivot/site/trunk/xsl/project.xsl Mon Nov 30 05:35:43 2009
@@ -40,30 +40,10 @@
         <html xmlns="http://www.w3.org/1999/xhtml">
             <head>
                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-                <title>
-                    <xsl:choose>
-                        <xsl:when test="properties/title">
-                            <xsl:value-of select="properties/title"/>
-                            <xsl:value-of select="' | '"/>
-                        </xsl:when>
-                    </xsl:choose>
-                    <xsl:value-of select="$project/title"/>
-                </title>
-                <link href="{$base}styles/pivot.css" rel="stylesheet" type="text/css"/>
-
+                <xsl:call-template name="page-title"/>
+                <xsl:call-template name="stylesheet-imports"/>
                 <xsl:apply-templates select="head"/>
-
-                <!-- Google Analytics Code -->
-                <script type="text/javascript">
-                    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-                    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-                </script>
-                <script type="text/javascript">
-                    try {
-                        var pageTracker = _gat._getTracker("UA-7977275-1");
-                        pageTracker._trackPageview();
-                    } catch(err) {}
-                </script>
+                <xsl:call-template name="google-analytics"/>
             </head>
 
             <body>
@@ -113,6 +93,35 @@
         </html>
     </xsl:template>
 
+    <xsl:template name="page-title">
+        <title>
+            <xsl:choose>
+                <xsl:when test="properties/title">
+                    <xsl:value-of select="properties/title"/>
+                    <xsl:value-of select="' | '"/>
+                </xsl:when>
+            </xsl:choose>
+            <xsl:value-of select="$project/title"/>
+        </title>
+    </xsl:template>
+
+    <xsl:template name="stylesheet-imports">
+        <link href="{$base}styles/pivot.css" rel="stylesheet" type="text/css"/>
+    </xsl:template>
+
+    <xsl:template name="google-analytics">
+        <script type="text/javascript">
+            var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+            document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+        </script>
+        <script type="text/javascript">
+            try {
+                var pageTracker = _gat._getTracker("UA-7977275-1");
+                pageTracker._trackPageview();
+            } catch(err) {}
+        </script>
+    </xsl:template>
+
     <!-- The main site navigation -->
     <xsl:template name="global-navigation">
         <xsl:apply-templates select="$project/global-items/item"/>
@@ -180,8 +189,7 @@
 
         <xsl:choose>
             <xsl:when test="@caption">
-                <xsl:variable name="class" select="@class"/>
-                <li class="{$class}">
+                <li class="{@class}">
                     <a href="{$href}">
                         <strong><xsl:value-of select="@name"/></strong>
                         <em><xsl:value-of select="@caption"/></em>
@@ -205,16 +213,17 @@
     -->
     <xsl:template match="application-item">
         <xsl:variable name="demo" select="document(concat($demos, '/', @id, '.xml'))/document"/>
-        <xsl:variable name="href">
-            <xsl:value-of select="concat($base, 'demos/', @id, '.html')"/>
-        </xsl:variable>
-        <xsl:variable name="target">
-            <xsl:choose>
-                <xsl:when test="boolean(@new-window)">_new</xsl:when>
-                <xsl:otherwise>_self</xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <li><a href="{$href}" target="{$target}"><xsl:value-of select="$demo/properties/title"/></a></li>
+        <li>
+            <xsl:element name="a">
+                <xsl:attribute name="href">
+                    <xsl:value-of select="concat($base, 'demos/', @id, '.html')"/>
+                </xsl:attribute>
+                <xsl:if test="boolean(@new-window)">
+                    <xsl:attribute name="target">_new</xsl:attribute>
+                </xsl:if>
+                <xsl:value-of select="$demo/properties/title"/>
+            </xsl:element>
+        </li>
     </xsl:template>
 
     <!--
@@ -223,20 +232,31 @@
     descriptor)
     -->
     <xsl:template match="application-item[remote]">
-        <xsl:variable name="target">
-            <xsl:choose>
-                <xsl:when test="boolean(@new-window)">_new</xsl:when>
-                <xsl:otherwise>_self</xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>
-        <xsl:variable name="href" select="remote/@href"/>
-        <li><a href="{$href}" target="{$target}"><xsl:value-of select="properties/title"/></a></li>
+        <li>
+            <xsl:element name="a">
+                <xsl:attribute name="href">
+                    <xsl:value-of select="remote/@href"/>
+                </xsl:attribute>
+                <xsl:if test="boolean(@new-window)">
+                    <xsl:attribute name="target">_new</xsl:attribute>
+                </xsl:if>
+                <xsl:value-of select="properties/title"/>
+            </xsl:element>
+        </li>
+    </xsl:template>
+
+    <!-- Perform variable resolution on all attributes -->
+    <xsl:template match="@*">
+        <xsl:attribute name="{name(.)}">
+            <!-- TODO Resolve variables -->
+            <xsl:value-of select="."/>
+        </xsl:attribute>
     </xsl:template>
 
-    <!-- Process everything else by just passing it through -->
-    <xsl:template match="*|@*">
+    <!-- Process everything else by just passing it through (including comments) -->
+    <xsl:template match="*|comment()">
         <xsl:copy>
-            <xsl:apply-templates select="@*|*|text()"/>
+            <xsl:apply-templates select="@*|*|text()|comment()"/>
         </xsl:copy>
     </xsl:template>
 </xsl:stylesheet>