Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tidy up of various templates

  • Loading branch information...
commit 7f7a7efa199d1a249acd6156fb8361b4c9d8e4d0 1 parent a2a366b
@davjand authored
View
198 workspace/js/javascript.js
@@ -11,201 +11,3 @@
-/*******************************************
- *
- * CAROUSEL CODE
- * Functions and Init for the carousel
- *
- * Params:
- *
- * wrapper - identifier to unique wrapper
- * controller - object holding next, 1,2,3,etc,prev links
- * duration - time between transitions
- *
-**
-*****************************************/
-
-function initCarousel(idPrefix,duration){
-
- //convert the prefix into names
- wrapper='#'+idPrefix+'inner';
- controller='#'+idPrefix+'controller';
-
- //set initial active count and numbers
- $(wrapper).attr('active',1);
- $(wrapper).attr('queued',0);
- $(wrapper).attr('paused',0);
- $(wrapper).attr('animating',0);
- $(wrapper).attr('count',$(wrapper).children().length);
-
- //attach click handlers - next
- $('.next',controller).click(function(ev){
- ev.preventDefault();
- //stop the timer
- $(wrapper).stopTime(idPrefix);
-
- slideChange(idPrefix,1,duration);
- });
- //attach click handlers - prev
- $('.prev',controller).click(function(){
- ev.preventDefault();
- //stop the timer
- $(wrapper).stopTime(idPrefix);
-
- slideChange(idPrefix,-1,duration);
- });
-
- //attach click handlers - numbers
- $('li.slide-no',controller).each(function(){
- $(this).click(function(ev){
- ev.preventDefault();
- var newSlide=$('a',this).attr('class').replace('s','');
-
- if(newSlide!=$(wrapper).attr('active')){
- //stop the timer
- $(wrapper).stopTime(idPrefix);
- gotoSlide(idPrefix,newSlide,duration);
- }
- });
- });
- //attach click handlers - play/pause
- $('.pause',controller).click(function(ev){
- ev.preventDefault();
- //pause
- if($(wrapper).attr('paused')=='0'){
- //stop the timer
- $(wrapper).stopTime(idPrefix);
-
- $(wrapper).attr('paused','1');
-
- $(this).addClass('play');
- $(this).text('play');
-
- }
- //play
- else{
- //change to the text slide already
-
- slideChange(idPrefix,1,duration);
-
- $(wrapper).attr('paused','0');
-
- $(this).removeClass('play');
- $(this).text('pause');
- }
- });
-
- //set the active item
- $('a.s1',controller).addClass('active');
-
-
- //start the timer
- $(wrapper).oneTime(duration,idPrefix,function(){
- slideChange(idPrefix,1,duration);
- });
-}
-
-
-function gotoSlide(idPrefix, newSlide,duration){
-
- wrapper='#'+idPrefix+'inner';
-
- //load variables
- var old=parseInt($(wrapper).attr('active'));
- var count=parseInt($(wrapper).attr('count'));
-
- if(newSlide<=0 && newSlide > count) newSlide=1;
-
- transitionCarousel(idPrefix,newSlide,old,duration);
-
- $('a.active',controller).removeClass('active');
- $('a.s'+newSlide,controller).addClass('active');
-
-}
-
-/*function slideChange()
- *calculates the new slide position and initiates the transition
-*/
-function slideChange(idPrefix, changeCount,duration){
-
- wrapper='#'+idPrefix+'inner';
- controller='#'+idPrefix+'controller';
-
- //load variables
- var old=parseInt($(wrapper).attr('active'));
- var count=parseInt($(wrapper).attr('count'));
-
- //calculate new slide
- var active= old+changeCount;
-
- if(active>count)
- {active-= (Math.floor(active / count) * count);
- }
- else if(active==0){
- active=count;
- }
- else if(active<1){
- active+= (Math.floor((-active) / count) * count);
- }
-
- transitionCarousel(idPrefix,active,old,duration);
-
- //change the active controller entry
- $('a.active',controller).removeClass('active');
- $('a.s'+active,controller).addClass('active');
-
-}
-
-/*function transitionCarousel()
- *Transitions and animates the carousel
-*/
-function transitionCarousel(idPrefix,newSlideNo,oldSlideNo,duration){
-
- wrapper='#'+ idPrefix +'inner';
-
- //check if already animating and queue if so
- if($(wrapper).attr('animating')=='1'){
-
- //set a queue
- $(wrapper).attr('queued',newSlideNo);
- }
- else{
- //set the animation flag
- $(wrapper).attr('animating','1');
- $('#'+idPrefix+oldSlideNo).hide('fade',{easing: 'easeOutQuad'},1500,function(){
- });
-
- $('#'+idPrefix+newSlideNo).show('fade',{easing: 'easeInQuad'},2200,function(){
- $(wrapper).attr('active',newSlideNo);
- $(wrapper).attr('animating','0');
-
- //check for a queue
- if($(wrapper).attr('queued')!='0'){
- //process the queue
- var queue=$(wrapper).attr('queued');
- $(wrapper).attr('queued','0');
-
- //perform the transition
-
- transitionCarousel(idPrefix,queue,$(wrapper).attr('active'),textHandle,imageHandle);
- }
- else{
- //restart the timer
- if($(wrapper).attr('paused')!=1){
- $(wrapper).oneTime(duration,idPrefix,function(){
- slideChange(idPrefix,1,duration);
- });
- }
- }
-
- });
-
- }
-}
-
-
-
-
-
-
-
View
112 workspace/utilities/carousel.xsl
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<!-- carousel.xsl
- *
- * Carousel template and associated functions for decor blinds website
- *
- * Author: David Anderson 2010
--->
-
-<xsl:template match="data/slides">
- <xsl:param name="item" />
- <xsl:param name="width" select="'780'"/>
- <xsl:param name="height" select="'300'"/>
- <xsl:param name="id-prefix" select="'carousel-'"/>
-
- <div class="carousel-wrapper-inner">
- <xsl:attribute name="style">
- <xsl:text>width:</xsl:text><xsl:value-of select="$width"/><xsl:text>px;</xsl:text>
- <xsl:text>height:</xsl:text><xsl:value-of select="$height"/><xsl:text>px;</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="id">
- <xsl:value-of select="concat($id-prefix,'inner')"/>
- </xsl:attribute>
-
- <xsl:apply-templates select="entry" mode="slides" >
- <xsl:with-param name="width" select="$width"/>
- <xsl:with-param name="height" select="$height"/>
- <xsl:with-param name="id-prefix" select="$id-prefix"/>
- </xsl:apply-templates>
- </div>
-
- <div class="carousel-controller">
- <xsl:attribute name="id">
- <xsl:value-of select="concat($id-prefix,'controller')"/>
- </xsl:attribute>
-
- <ul>
- <!--
- <li><a href="#" class="pause">pause</a></li>
-
- <li><a href="#" class="prev">&lt;&lt;</a></li>
- -->
- <xsl:apply-templates select="entry" mode="controller" />
- <!--
- <li><a href="#" class="next">&gt;&gt;</a></li>
- -->
-
- </ul>
- <div class="clear"></div>
- </div>
-
-
-</xsl:template>
-
-<xsl:template match="data/slides/entry" mode="controller">
- <li>
- <xsl:attribute name="class"><xsl:text>slide-no</xsl:text></xsl:attribute>
- <a href="#">
- <xsl:attribute name="class"><xsl:value-of select="concat('s',position())"/></xsl:attribute>
-
- <xsl:value-of select="short-title"/>
- </a>
- </li>
-
- <xsl:if test="position() &lt; count(../entry)">
- <li class="sep">
- &gt;
- </li>
- </xsl:if>
-
-</xsl:template>
-
-
-<xsl:template match="data/slides/entry" mode="slides">
- <xsl:param name="width"/>
- <xsl:param name="height"/>
- <xsl:param name="id-prefix"/>
-
- <div class="slide">
- <xsl:attribute name="id"><xsl:value-of select="concat($id-prefix,position())" /></xsl:attribute>
-
- <div class="slide-image">
- <xsl:call-template name="image">
- <xsl:with-param name="item" select="."/>
- <xsl:with-param name="width" select="$width" />
- <xsl:with-param name="height" select="$height"/>
- <xsl:with-param name="alt" select="title" />
- </xsl:call-template>
- </div>
-
- <div class="slide-content">
- <h1>
- <a href="{link}">
- <xsl:value-of select="title"/>
- </a>
- </h1>
- <p>
- <a href="{link}">
- <b><xsl:value-of select="description"/></b>
- </a>
- </p>
- </div>
-
-
- </div>
-</xsl:template>
-
-
-
-
-</xsl:stylesheet>
View
26 workspace/utilities/footer.xsl
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:template name="footer">
-
- <div id="footer">
- <div class="container">
- <div class="sixteen columns">
- <xsl:text>Copyright </xsl:text>
- <xsl:value-of select="$site-title"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$this-year"/>
-
- <div id="veo">
- <a href="http://veodesign.co.uk" title="Veo Design">
- <img src="{$workspace}/images/main/veo_footer.png" title="Veo Design" alt="Veo Design"/>
- </a>
- </div>
- </div>
- </div>
- </div>
-
-</xsl:template>
-
-</xsl:stylesheet>
View
32 workspace/utilities/header.xsl
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--header.xsl
- *
- *
- * Author: David Anderson 2010
- * dave@veodesign.co.uk
--->
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:exsl="http://exslt.org/common"
- xmlns:form="http://nick-dunn.co.uk/xslt/form-controls"
- extension-element-prefixes="exsl form">
-
-<xsl:template name="header">
-
- <div id="header">
- <div class="container">
-
-
- </div>
- </div> <!-- #header -->
-
-
-
-
-</xsl:template>
-
-<!-- ########## TEMPLATE POSITIONS ########## -->
-
-
-</xsl:stylesheet>
View
23 workspace/utilities/master.xsl
@@ -21,12 +21,8 @@
<xsl:import href="date-time.xsl"/>
<!--custom utils-->
-<xsl:import href="header.xsl"/>
-<xsl:import href="footer.xsl"/>
<xsl:import href="string.xsl"/>
<xsl:import href="image-format.xsl"/>
-<xsl:import href="navigation.xsl"/>
-
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -99,7 +95,13 @@
<body class="page-{$current-page}">
<div id="bg">
- <xsl:call-template name="header" />
+ <div id="header">
+ <div class="container">
+
+
+ </div>
+ </div> <!-- #header -->
+
<div id="wrapper">
<div class="container">
@@ -107,7 +109,16 @@
</div>
</div>
- <xsl:call-template name="footer" />
+ <div id="footer">
+ <div class="container">
+ <div class="sixteen columns">
+ <xsl:text>Copyright </xsl:text>
+ <xsl:value-of select="$site-title"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$this-year"/>
+ </div>
+ </div>
+ </div>
</div><!-- #bg -->
<!-- JS
View
13 workspace/utilities/navigation.xsl
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- navigation.xsl
- *
- * Navigation functions
- *
- * Author: David Anderson 2010
- * dave@veodesign.co.uk
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-
-
-</xsl:stylesheet>
Please sign in to comment.
Something went wrong with that request. Please try again.