[Tynstep-svn] r190 - in trunk/step: . step-core/src/main/java/com/tyndalehouse/step/core step-core/src/main/java/com/tyndalehouse/step/core/models step-core/src/main/java/com/tyndalehouse/step/core/service step-core/src/main/java/com/tyndalehouse/step/core/service/impl step-core/src/main/java/com/tyndalehouse/step/core/utils step-core/src/main/java/com/tyndalehouse/step/core/xsl step-core/src/main/resources/com/tyndalehouse/step/core/service/impl step-core/src/test/java/com/tyndalehouse/step/core/service step-core/src/test/java/com/tyndalehouse/step/core/service/impl step-server step-server/src step-server/src/main step-server/src/main/java step-server/src/main/java/com step-server/src/main/java/com/tyndalehouse step-server/src/main/java/com/tyndalehouse/step step-server/src/main/java/com/tyndalehouse/step/server step-server/src/main/resources step-server/src/main/webapps step-web/src/main/java/com/tyndalehouse/step/rest/controllers step-web/src/main/resources step-web/src/main/webapp step-web/src/main/webapp/WEB-INF step-web/src/main/webapp/css step-web/src/main/webapp/js step-web/src/main/webapp/libs

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Wed Dec 1 15:09:54 MST 2010


Author: ChrisBurrell
Date: 2010-12-01 15:09:54 -0700 (Wed, 01 Dec 2010)
New Revision: 190

Added:
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/Definition.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/reference/
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/ModuleService.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java
   trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/old_default.xsl
   trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/
   trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImplTest.java
   trunk/step/step-server/
   trunk/step/step-server/pom.xml
   trunk/step/step-server/src/
   trunk/step/step-server/src/main/
   trunk/step/step-server/src/main/java/
   trunk/step/step-server/src/main/java/com/
   trunk/step/step-server/src/main/java/com/tyndalehouse/
   trunk/step/step-server/src/main/java/com/tyndalehouse/step/
   trunk/step/step-server/src/main/java/com/tyndalehouse/step/server/
   trunk/step/step-server/src/main/java/com/tyndalehouse/step/server/StepServer.java
   trunk/step/step-server/src/main/resources/
   trunk/step/step-server/src/main/resources/jetty.xml
   trunk/step/step-server/src/main/resources/war/
   trunk/step/step-server/src/main/webapps/
   trunk/step/step-server/src/main/webapps/README.txt
   trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/ModuleController.java
   trunk/step/step-web/src/main/webapp/js/lexicon_definition.js
   trunk/step/step-web/src/main/webapp/js/ui_hooks.js
Modified:
   trunk/step/pom.xml
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/EnrichedLookupOption.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/utils/StringConversionUtils.java
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/xsl/XslConversionType.java
   trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl
   trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl
   trunk/step/step-web/src/main/resources/log4j.properties
   trunk/step/step-web/src/main/webapp/WEB-INF/step-rest-servlet.xml
   trunk/step/step-web/src/main/webapp/css/initial-fonts.css
   trunk/step/step-web/src/main/webapp/css/initial-layout.css
   trunk/step/step-web/src/main/webapp/index.jsp
   trunk/step/step-web/src/main/webapp/js/bookmark.js
   trunk/step/step-web/src/main/webapp/js/init.js
   trunk/step/step-web/src/main/webapp/js/passage.js
   trunk/step/step-web/src/main/webapp/js/passage_toolbar.js
   trunk/step/step-web/src/main/webapp/libs/jquery-ui-1.8.5.custom.min.js
Log:


Modified: trunk/step/pom.xml
===================================================================
--- trunk/step/pom.xml	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/pom.xml	2010-12-01 22:09:54 UTC (rev 190)
@@ -30,5 +30,6 @@
 		<module>step-build</module>
 		<module>step-core</module>
 		<module>step-web</module>
+		<module>step-server</module>
 	</modules>
 </project>

Added: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/Definition.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/Definition.java	                        (rev 0)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/Definition.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,30 @@
+package com.tyndalehouse.step.core.models;
+
+/**
+ * Represents a definition, has a key and a value
+ * 
+ * @author Chris
+ */
+public class Definition {
+    private final String key;
+    private final String explanation;
+
+    public Definition(final String key, final String explanation) {
+        this.key = key;
+        this.explanation = explanation;
+    }
+
+    /**
+     * @return the key
+     */
+    public String getKey() {
+        return this.key;
+    }
+
+    /**
+     * @return the explanation
+     */
+    public String getExplanation() {
+        return this.explanation;
+    }
+}

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/EnrichedLookupOption.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/EnrichedLookupOption.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/EnrichedLookupOption.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -9,23 +9,39 @@
 public class EnrichedLookupOption {
     private final String displayName;
     private final String key;
+    private final boolean enabledByDefault;
 
     /**
      * constructs an enriched version of the lookup option
      * 
      * @param displayName name to be displayed on the client
      * @param key the key to be used for communicating with the server
+     * @param enabledByDefault true to signify the UI should enable the button by default
      */
-    public EnrichedLookupOption(final String displayName, final String key) {
+    public EnrichedLookupOption(final String displayName, final String key, final boolean enabledByDefault) {
         this.displayName = displayName;
         this.key = key;
+        this.enabledByDefault = enabledByDefault;
     }
 
+    /**
+     * @return the display name as should be shown on the screen
+     */
     public String getDisplayName() {
         return this.displayName;
     }
 
+    /**
+     * @return The key to use to reference this item when sending it back to the server
+     */
     public String getKey() {
         return this.key;
     }
+
+    /**
+     * @return the enabledByDefault
+     */
+    public boolean isEnabledByDefault() {
+        return this.enabledByDefault;
+    }
 }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -11,6 +11,14 @@
  * 
  */
 public enum LookupOption {
+    /**
+     * Showing headings
+     */
+    HEADINGS("Headings", "Headings", XslConversionType.DEFAULT, true),
+    /**
+     * Showing headings
+     */
+    VERSE_NUMBERS("VNum", "Verse Nums.", XslConversionType.DEFAULT, true),
     /** Strong numbers */
     STRONG_NUMBERS("StrongsNumbers", "Strongs", XslConversionType.INTERLINEAR),
 
@@ -19,24 +27,56 @@
     /**
      * Interlinears are available when Strongs are available.
      */
-    INTERLINEAR("Interlinear", XslConversionType.INTERLINEAR);
+    INTERLINEAR("Interlinear", "Interlinear", XslConversionType.INTERLINEAR),
 
+    /**
+     * Showing headings
+     */
+    TINY_VERSE_NUMBERS("TinyVNum", XslConversionType.DEFAULT);
+
     private final String xsltParameterName;
     private final String displayName;
-    private XslConversionType stylesheet;
+    private final XslConversionType stylesheet;
+    private final boolean enabledByDefault;
 
+    /**
+     * sets up the the lookup option
+     * 
+     * @param xsltParameterName the corresponding parameter name in the XSLT stylesheet
+     */
     private LookupOption(final String xsltParameterName) {
         this(xsltParameterName, xsltParameterName, DEFAULT);
     }
 
+    /**
+     * @param xsltParameterName the name of the parameter in the stylesheet
+     * @param stylesheet the stylesheet to use
+     */
     private LookupOption(final String xsltParameterName, final XslConversionType stylesheet) {
-        this(xsltParameterName, xsltParameterName, stylesheet);
+        this(xsltParameterName, null, stylesheet);
     }
 
+    /**
+     * @param xsltParameterName the name of the parameter in the stylesheet
+     * @param stylesheet the stylesheet to use
+     * @param displayName the name to display on the user interface
+     */
     private LookupOption(final String xsltParameterName, final String displayName, final XslConversionType stylesheet) {
+        this(xsltParameterName, displayName, stylesheet, false);
+    }
+
+    /**
+     * @param xsltParameterName the name of the parameter in the stylesheet
+     * @param stylesheet the stylesheet to use
+     * @param displayName the name to display on the user interface
+     * @param enabledByDefault true to have the UI display the option by default
+     */
+    private LookupOption(final String xsltParameterName, final String displayName, final XslConversionType stylesheet,
+            final boolean enabledByDefault) {
         this.xsltParameterName = xsltParameterName;
         this.displayName = displayName;
         this.stylesheet = stylesheet;
+        this.enabledByDefault = enabledByDefault;
     }
 
     /**
@@ -53,4 +93,11 @@
     public XslConversionType getStylesheet() {
         return this.stylesheet;
     }
+
+    /**
+     * @return the enabledByDefault
+     */
+    public boolean isEnabledByDefault() {
+        return this.enabledByDefault;
+    }
 }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/JSwordService.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -9,7 +9,7 @@
 
 public interface JSwordService {
     /**
-     * returns the biblical text as xml dom
+     * returns the Osis Text as a String
      * 
      * @param version version to lookup
      * @param reference the reference to lookup
@@ -20,6 +20,15 @@
     String getOsisText(String version, String reference, List<LookupOption> options, String interlinearVersion);
 
     /**
+     * returns the biblical text as xml dom
+     * 
+     * @param version version to lookup
+     * @param reference the reference to lookup
+     * @return the OSIS text in an HTML form
+     */
+    String getOsisText(String version, String reference);
+
+    /**
      * looks up any installed module
      * 
      * @param bibleCategory the category of the bible to lookup
@@ -34,4 +43,5 @@
      * @return the list of supported features
      */
     List<LookupOption> getFeatures(String version);
+
 }

Added: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/ModuleService.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/ModuleService.java	                        (rev 0)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/ModuleService.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,30 @@
+package com.tyndalehouse.step.core.service;
+
+import java.util.List;
+
+import com.tyndalehouse.step.core.models.Definition;
+
+/**
+ * Interface to the service that gives information about the books of the bible, the different types of bible, etc. This
+ * service will mainly use JSword but may also rely on other data sources to display text.
+ * 
+ * @author Chris
+ * 
+ */
+public interface ModuleService {
+    /**
+     * Returns all the definitions associated with a particular set of lookup references
+     * 
+     * @param references a list of references
+     * @return the definitions associated with the references
+     */
+    List<Definition> getDefinitions(String references);
+
+    /**
+     * Returns the definition for a particular reference
+     * 
+     * @param reference a reference
+     * @return the definitions associated with the references
+     */
+    Definition getDefinition(String reference);
+}

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/BibleInformationServiceImpl.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -2,6 +2,7 @@
 
 import static com.tyndalehouse.step.core.models.LookupOption.INTERLINEAR;
 import static com.tyndalehouse.step.core.models.LookupOption.STRONG_NUMBERS;
+import static org.apache.commons.lang.StringUtils.isNotBlank;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -60,7 +61,10 @@
         final List<EnrichedLookupOption> elo = new ArrayList<EnrichedLookupOption>(lo.length + 1);
 
         for (int ii = 0; ii < lo.length; ii++) {
-            elo.add(new EnrichedLookupOption(lo[ii].getDisplayName(), lo[ii].toString()));
+            final String displayName = lo[ii].getDisplayName();
+            if (isNotBlank(displayName)) {
+                elo.add(new EnrichedLookupOption(displayName, lo[ii].toString(), lo[ii].isEnabledByDefault()));
+            }
         }
 
         return elo;

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -2,6 +2,8 @@
 
 import static com.tyndalehouse.step.core.xsl.XslConversionType.DEFAULT;
 import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.commons.lang.StringUtils.isNotEmpty;
+import static org.crosswire.jsword.book.BookCategory.BIBLE;
 
 import java.net.URISyntaxException;
 import java.util.ArrayList;
@@ -56,6 +58,11 @@
         return Books.installed().getBooks(bf);
     }
 
+    public String getOsisText(final String version, final String reference) {
+        final List<LookupOption> options = new ArrayList<LookupOption>();
+        return getOsisText(version, reference, options, null);
+    }
+
     public String getOsisText(final String version, final String reference, final List<LookupOption> options,
             final String interlinearVersion) {
         this.logger.debug("Retrieving text for ({}, {})", version, reference);
@@ -72,6 +79,7 @@
                 public SAXEventProvider convert(final SAXEventProvider provider) throws TransformerException {
                     try {
                         // for now, we just assume that we'll only have one option, but this may change later
+                        // TODO, we can probably cache the resource
                         final TransformingSAXEventProvider tsep = new TransformingSAXEventProvider(getClass()
                                 .getResource(requiredTransformation.iterator().next().getFile()).toURI(), osissep);
 
@@ -100,6 +108,12 @@
         }
     }
 
+    /**
+     * returns the stylesheet that should be used to generate the text
+     * 
+     * @param options the list of options that are currently applied to the passage
+     * @return the stylesheet (of stylesheets)
+     */
     private Set<XslConversionType> identifyStyleSheet(final List<LookupOption> options) {
         final Set<XslConversionType> chosenOptions = new HashSet<XslConversionType>();
 
@@ -107,18 +121,30 @@
             chosenOptions.add(lo.getStylesheet());
         }
 
-        if (chosenOptions.isEmpty()) {
+        // remove from the list any default:
+        if (chosenOptions.contains(DEFAULT) && chosenOptions.size() > 1) {
+            chosenOptions.remove(DEFAULT);
+        } else if (chosenOptions.isEmpty()) {
             chosenOptions.add(DEFAULT);
         }
+
         return chosenOptions;
     }
 
     public List<LookupOption> getFeatures(final String version) {
+        // obtain the book
         final Book book = Books.installed().getBook(version);
-        final List<LookupOption> options = new ArrayList<LookupOption>(3);
+        final List<LookupOption> options = new ArrayList<LookupOption>(LookupOption.values().length + 1);
+
+        // some options are always there for Bibles:
+        if (BIBLE.equals(book.getBookCategory())) {
+            options.add(LookupOption.VERSE_NUMBERS);
+        }
+
+        // cycle through each option
         for (final LookupOption lo : LookupOption.values()) {
             final FeatureType ft = FeatureType.fromString(lo.getXsltParameterName());
-            if (ft != null) {
+            if (ft != null && isNotEmpty(lo.getDisplayName())) {
                 if (book.getBookMetaData().hasFeature(ft)) {
                     options.add(lo);
                 }
@@ -154,6 +180,11 @@
             final String version, final String textScope) {
         for (final LookupOption lookupOption : options) {
             tsep.setParameter(lookupOption.getXsltParameterName(), true);
+
+            if (LookupOption.VERSE_NUMBERS.equals(lookupOption)) {
+                tsep.setParameter(LookupOption.TINY_VERSE_NUMBERS.getXsltParameterName(), true);
+            }
         }
     }
+
 }

Added: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java	                        (rev 0)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImpl.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,87 @@
+package com.tyndalehouse.step.core.service.impl;
+
+import static org.apache.commons.lang.StringUtils.split;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.tyndalehouse.step.core.exceptions.StepInternalException;
+import com.tyndalehouse.step.core.models.Definition;
+import com.tyndalehouse.step.core.service.JSwordService;
+import com.tyndalehouse.step.core.service.ModuleService;
+import com.tyndalehouse.step.core.utils.StringConversionUtils;
+
+/**
+ * Looks up module information, for example lexicon definitions for particular references
+ * 
+ * @author Chris Burrell
+ * 
+ */
+public class ModuleServiceImpl implements ModuleService {
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+    private Map<String, String> defaultModuleLexicons;
+
+    @Autowired
+    private JSwordService jsword;
+
+    public Definition getDefinition(final String reference) {
+        final String lookupModule = getLookupModule(reference);
+        if (lookupModule != null) {
+            return new Definition(reference, this.jsword.getOsisText(lookupModule,
+                    StringConversionUtils.getAnyKey(reference, false)));
+        }
+
+        this.logger.warn("No module could be found for [{}]", reference);
+        return null;
+    }
+
+    public List<Definition> getDefinitions(final String references) {
+        // first we split the definitions in separate parts
+        final String[] refs = split(references);
+
+        if (refs == null) {
+            throw new StepInternalException("No references were provided");
+        }
+
+        final List<Definition> defs = new ArrayList<Definition>();
+        for (final String r : refs) {
+            this.logger.debug("Looking up {}", r);
+            final Definition definition = getDefinition(r);
+            if (definition != null) {
+                defs.add(definition);
+            }
+        }
+
+        return defs;
+    }
+
+    /**
+     * TODO: later we can drive this with a dropdown on the UI Based on the reference provided, we determine the correct
+     * module to lookup
+     * 
+     * @param reference the reference to base the lookup option on
+     * @return the initials of the module to lookup
+     */
+    String getLookupModule(final String reference) {
+        for (final Entry<String, String> e : this.defaultModuleLexicons.entrySet()) {
+            if (reference.startsWith(e.getKey())) {
+                return e.getValue();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @param defaultModuleLexicons the defaultModuleLexicons to set
+     */
+    public void setDefaultModuleLexicons(final Map<String, String> defaultModuleLexicons) {
+        this.defaultModuleLexicons = defaultModuleLexicons;
+    }
+
+}

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/utils/StringConversionUtils.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/utils/StringConversionUtils.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/utils/StringConversionUtils.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -52,22 +52,34 @@
      * @return the shortened key
      */
     public static String getAnyKey(final String potentialKey) {
+        return getAnyKey(potentialKey, true);
+    }
+
+    /**
+     * in this case, we assume that a key starts shortly after the last ':' with a number
+     * 
+     * @param potentialKey a key that can potentially be shortened
+     * @param trimInitial trim initial character after ':'
+     * @return the shortened key
+     */
+    public static String getAnyKey(final String potentialKey, final boolean trimInitial) {
         // find first colon and start afterwards, -1 yields 0, which is the beginning of the string
         // so we can work with that.
         int start = potentialKey.lastIndexOf(KEY_SEPARATOR) + 1;
 
         // start at the first char after the colon
         // int start = lastColon + 1;
-        final char protocol = potentialKey.charAt(start);
-        if (protocol == 'G' || protocol == 'H') {
-            start++;
-        }
+        if (trimInitial) {
+            final char protocol = potentialKey.charAt(start);
+            if (protocol == 'G' || protocol == 'H') {
+                start++;
+            }
 
-        // finally, we may have 0s:
-        while (potentialKey.charAt(start) == '0') {
-            start++;
+            // finally, we may have 0s:
+            while (potentialKey.charAt(start) == '0') {
+                start++;
+            }
         }
-
         return potentialKey.substring(start);
     }
 }

Modified: trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/xsl/XslConversionType.java
===================================================================
--- trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/xsl/XslConversionType.java	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/xsl/XslConversionType.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -1,10 +1,16 @@
 package com.tyndalehouse.step.core.xsl;
 
+/**
+ * Defines which types of XSL stylesheets are available
+ * 
+ * @author Chris
+ * 
+ */
 public enum XslConversionType {
     /**
      * a standard text, where only one line of text will be displayed, (i.e. normal style)
      */
-    DEFAULT("default.xsl"),
+    DEFAULT,
     /**
      * identifies a text that requires outputs on multiple lines
      */
@@ -15,6 +21,10 @@
      */
     private final String file;
 
+    private XslConversionType() {
+        this("default.xsl");
+    }
+
     private XslConversionType(final String file) {
         this.file = file;
     }

Modified: trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl
===================================================================
--- trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl	2010-12-01 22:09:54 UTC (rev 190)
@@ -70,7 +70,7 @@
   <xsl:param name="VLine" select="'false'"/>
 
   <!-- Whether to show non-canonical "headings" or not -->
-  <xsl:param name="Headings" select="'true'"/>
+  <xsl:param name="Headings" select="'false'"/>
 
   <!-- Whether to show notes or not -->
   <xsl:param name="Notes" select="'false'"/>
@@ -78,11 +78,8 @@
   <!-- Whether to have linking cross references or not -->
   <xsl:param name="XRef" select="'false'"/>
 
-  <!-- Whether to output no Verse numbers -->
-  <xsl:param name="NoVNum" select="'false'"/>
-
   <!-- Whether to output Verse numbers or not -->
-  <xsl:param name="VNum" select="'true'"/>
+  <xsl:param name="VNum" select="'false'"/>
 
   <!-- Whether to output Chapter and Verse numbers or not -->
   <xsl:param name="CVNum" select="'false'"/>
@@ -91,7 +88,7 @@
   <xsl:param name="BCVNum" select="'false'"/>
 
   <!-- Whether to output superscript verse numbers or normal size ones -->
-  <xsl:param name="TinyVNum" select="'true'"/>
+  <xsl:param name="TinyVNum" select="'false'"/>
 
   <!-- The order of display. Hebrew is rtl (right to left) -->
   <xsl:param name="direction" select="'ltr'"/>
@@ -314,7 +311,7 @@
 
   <xsl:template name="versenum">
     <!-- Are verse numbers wanted? -->
-    <xsl:if test="$NoVNum = 'false'">
+    <xsl:if test="$VNum = 'true'">
       <!-- An osisID can be a space separated list of them -->
       <xsl:variable name="firstOsisID" select="substring-before(concat(@osisID, ' '), ' ')"/>
       <xsl:variable name="book" select="substring-before($firstOsisID, '.')"/>
@@ -460,8 +457,14 @@
   <!--=======================================================================-->
   <xsl:template match="w">
     <!-- Output the content followed by all the lemmas and then all the morphs. -->
-    <xsl:apply-templates/>
-    
+    <xsl:choose>
+	    <xsl:when test="normalize-space(@lemma) != '' or normalize-space(@morph) != ''">
+	    	<span onclick="javascript:showAllStrongMorphs(&quot;{@lemma} {@morph}&quot;)"><xsl:apply-templates/></span>
+	    </xsl:when>
+		<xsl:otherwise>
+			<xsl:apply-templates/>
+		</xsl:otherwise>
+    </xsl:choose>
     <!--
         except when followed by a text node or non-printing node.
         This is true whether the href is output or not.

Modified: trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl
===================================================================
--- trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl	2010-12-01 22:09:54 UTC (rev 190)
@@ -63,7 +63,7 @@
   <xsl:param name="VLine" select="'false'"/>
 
   <!-- Whether to show non-canonical "headings" or not -->
-  <xsl:param name="Headings" select="'true'"/>
+  <xsl:param name="Headings" select="'false'"/>
 
   <!-- Whether to show notes or not -->
   <xsl:param name="Notes" select="'false'"/>
@@ -71,11 +71,8 @@
   <!-- Whether to have linking cross references or not -->
   <xsl:param name="XRef" select="'false'"/>
 
-  <!-- Whether to output no Verse numbers -->
-  <xsl:param name="NoVNum" select="'false'"/>
-
   <!-- Whether to output Verse numbers or not -->
-  <xsl:param name="VNum" select="'true'"/>
+  <xsl:param name="VNum" select="'false'"/>
 
   <!-- Whether to output Chapter and Verse numbers or not -->
   <xsl:param name="CVNum" select="'false'"/>
@@ -84,7 +81,7 @@
   <xsl:param name="BCVNum" select="'false'"/>
 
   <!-- Whether to output superscript verse numbers or normal size ones -->
-  <xsl:param name="TinyVNum" select="'true'"/>
+  <xsl:param name="TinyVNum" select="'false'"/>
 
   <!-- The order of display. Hebrew is rtl (right to left) -->
   <xsl:param name="direction" select="'ltr'"/>
@@ -104,6 +101,7 @@
   
   <!--  set up interlinear provider, if we have requested it -->
   <xsl:variable name="interlinearProvider" select="jsword:com.tyndalehouse.step.core.xsl.impl.MultiInterlinearProviderImpl.new(string($interlinearVersion), string($interlinearReference))" />
+  <xsl:variable name="punctuation" select="'|\,./&lt;&gt;?;\#:@~[]{}-=_+`¬!£$%^&amp;*()&quot;'" />
 
   <!--=======================================================================-->
   <xsl:template match="/">
@@ -318,7 +316,7 @@
 
   <xsl:template name="versenum">
     <!-- Are verse numbers wanted? -->
-    <xsl:if test="$NoVNum = 'false'">
+    <xsl:if test="$VNum = 'true'">
       <!-- An osisID can be a space separated list of them -->
       <xsl:variable name="firstOsisID" select="substring-before(concat(@osisID, ' '), ' ')"/>
       <xsl:variable name="book" select="substring-before($firstOsisID, '.')"/>
@@ -470,17 +468,18 @@
 			<xsl:apply-templates />
 		</xsl:variable>
 	
-		<!-- we check the next node too, since it might be punctuation, etc. In 
-			that case, it makes sense to include it in the bit word part that gets past 
-			down TODO TODO TODO -->
+		<xsl:variable name="nextText" select="normalize-space(following-sibling::node()[1][self::text()])" />
+		<xsl:if test="not(jsword:org.apache.commons.lang.StringUtils.containsOnly($nextText, $punctuation))">
+			<xsl:variable name="nextText" select="''"/>
+		</xsl:if>
 
 		<!-- start the block -->
-		<span class="w">
+		<span class="w" onclick="javascript:showAllStrongMorphs(&quot;{@lemma} {@morph}&quot;)">
 			<!-- 1st - Output first line or a blank if no text available. -->
 			<span class="text">
 				<xsl:call-template name="outputNonBlank">
 					<xsl:with-param name="string">
-						<xsl:value-of select="$innerWordText" />
+						<xsl:value-of select="concat($innerWordText, $nextText)" />
 					</xsl:with-param>
 				</xsl:call-template>
 			</span>
@@ -1385,6 +1384,7 @@
   to any punctuation really, since all other words should be contained in a W  -->
   <xsl:template match="text()">
   		<xsl:choose>
+			<xsl:when test="jsword:org.apache.commons.lang.StringUtils.containsOnly(normalize-space(.), $punctuation)" />
 	  		<xsl:when test="name(..) = 'verse' and normalize-space(.) != ''"><span class="w"><span class="text"><xsl:value-of select="."/></span></span></xsl:when>
 	  		<xsl:when test="normalize-space(.) != ''"><xsl:value-of select="."/></xsl:when>
   		</xsl:choose>

Added: trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/old_default.xsl
===================================================================
--- trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/old_default.xsl	                        (rev 0)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/old_default.xsl	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,1349 @@
+<?xml version="1.0"?>
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: default.xsl 1943 2009-03-25 11:43:28Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ * @author Chris Burrell [chris at burrell dot me dot uk] 
+ -->
+ <xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0"
+  xmlns:jsword="http://xml.apache.org/xalan/java"
+  extension-element-prefixes="jsword">
+
+  <!--  Version 3.0 is necessary to get br to work correctly. -->
+  <xsl:output method="html" version="3.0" omit-xml-declaration="yes" indent="no"/>
+
+  <!-- Be very careful about introducing whitespace into the document.
+       strip-space merely remove space between one tag and another tag.
+       This may cause significant whitespace to be removed.
+       
+       It is easy to have apply-templates on a line to itself which if
+       it encounters text before anything else will introduce whitespace.
+       With the browser we are using, span will introduce whitespace
+       but font does not. Therefore we use font as a span.
+    -->
+  <!-- gdef and hdef refer to hebrew and greek definitions keyed by strongs -->
+  <!-- The absolute base for relative references. -->
+  <xsl:param name="greek.def.protocol" select="'gdef:'"/>
+  <xsl:param name="hebrew.def.protocol" select="'hdef:'"/>
+  <xsl:param name="lex.def.protocol" select="'lex:'"/>
+  <!-- currently these are not used, but they are for morphologic forms -->
+  <xsl:param name="greek.morph.protocol" select="'gmorph:'"/>
+  <xsl:param name="hebrew.morph.protocol" select="'hmorph:'"/>
+
+  <!-- The absolute base for relative references. -->
+  <xsl:param name="baseURL" select="''"/>
+
+  <!-- Whether to show Strongs or not -->
+  <xsl:param name="StrongsNumbers" select="'false'"/>
+
+  <!-- Whether to show morphologic forms or not -->
+  <xsl:param name="Morph" select="'false'"/>
+
+  <!-- Whether to start each verse on an new line or not -->
+  <xsl:param name="VLine" select="'false'"/>
+
+  <!-- Whether to show non-canonical "headings" or not -->
+  <xsl:param name="Headings" select="'false'"/>
+
+  <!-- Whether to show notes or not -->
+  <xsl:param name="Notes" select="'false'"/>
+
+  <!-- Whether to have linking cross references or not -->
+  <xsl:param name="XRef" select="'false'"/>
+
+  <!-- Whether to output Verse numbers or not -->
+  <xsl:param name="VNum" select="'false'"/>
+
+  <!-- Whether to output Chapter and Verse numbers or not -->
+  <xsl:param name="CVNum" select="'false'"/>
+
+  <!-- Whether to output Book, Chapter and Verse numbers or not -->
+  <xsl:param name="BCVNum" select="'false'"/>
+
+  <!-- Whether to output superscript verse numbers or normal size ones -->
+  <xsl:param name="TinyVNum" select="'false'"/>
+
+  <!-- The order of display. Hebrew is rtl (right to left) -->
+  <xsl:param name="direction" select="'ltr'"/>
+
+  <!-- Create a global key factory from which OSIS ids will be generated -->
+  <xsl:variable name="keyf" select="jsword:org.crosswire.jsword.passage.PassageKeyFactory.instance()"/>
+  <!-- Create a global number shaper that can transform 0-9 into other number systems. -->
+  <xsl:variable name="shaper" select="jsword:org.crosswire.common.icu.NumberShaper.new()"/>
+
+  <!--=======================================================================-->
+  <xsl:template match="/">
+      <div>
+        <!-- If there are notes, output a table with notes in the 2nd column. -->
+        <!-- There is a rendering bug which prevents the notes from adhering to the right edge. -->
+        <xsl:choose>
+          <xsl:when test="$Notes = 'true' and //note[not(@type = 'x-strongsMarkup')]">
+            <xsl:choose>
+              <xsl:when test="$direction != 'rtl'">
+                <table cols="2" cellpadding="5" cellspacing="5">
+                  <tr>
+                    <!-- The two rows are swapped until the bug is fixed. -->
+                    <td valign="top" class="notes">
+                      <p>&#160;</p>
+                      <xsl:apply-templates select="//verse" mode="print-notes"/>
+                    </td>
+                    <td valign="top" class="text">
+                      <xsl:apply-templates/>
+                    </td>
+                  </tr>
+                </table>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- reverse the table for Right to Left languages -->
+                <table cols="2" cellpadding="5" cellspacing="5">
+                  <!-- In a right to left, the alignment should be reversed too -->
+                  <tr align="right">
+                    <td valign="top" class="notes">
+                      <p>&#160;</p>
+                      <xsl:apply-templates select="//note" mode="print-notes"/>
+                    </td>
+                    <td valign="top" class="text">
+                      <xsl:apply-templates/>
+                    </td>
+                  </tr>
+                </table>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </div>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == A proper OSIS document has osis as its root.
+    == We dig deeper for its content.
+    -->
+  <xsl:template match="osis">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == An OSIS document may contain more that one work.
+    == Each work is held in an osisCorpus element.
+    == If there is only one work, then this element will (should) be absent.
+    == Process each document in turn.
+    == It might be reasonable to dig into the header element of each work
+    == and get its title.
+    == Otherwise, we ignore the header and work elements and just process
+    == the osisText elements.
+    -->
+  <xsl:template match="osisCorpus">
+    <xsl:apply-templates select="osisText"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == Each work has an osisText element.
+    == We ignore the header and work elements and process its div elements.
+    == While divs can be milestoned, the osisText element requires container
+    == divs.
+    -->
+  <xsl:template match="osisText">
+    <xsl:apply-templates select="div"/>
+  </xsl:template>
+  
+  <!-- Ignore headers and its elements -->
+  <xsl:template match="header"/>
+  <xsl:template match="revisionDesc"/>
+  <xsl:template match="work"/>
+   <!-- <xsl:template match="title"/> who's parent is work -->
+  <xsl:template match="contributor"/>
+  <xsl:template match="creator"/>
+  <xsl:template match="subject"/>
+  <!-- <xsl:template match="date"/> who's parent is work -->
+  <xsl:template match="description"/>
+  <xsl:template match="publisher"/>
+  <xsl:template match="type"/>
+  <xsl:template match="format"/>
+  <xsl:template match="identifier"/>
+  <xsl:template match="source"/>
+  <xsl:template match="language"/>
+  <xsl:template match="relation"/>
+  <xsl:template match="coverage"/>
+  <xsl:template match="rights"/>
+  <xsl:template match="scope"/>
+  <xsl:template match="workPrefix"/>
+  <xsl:template match="castList"/>
+  <xsl:template match="castGroup"/>
+  <xsl:template match="castItem"/>
+  <xsl:template match="actor"/>
+  <xsl:template match="role"/>
+  <xsl:template match="roleDesc"/>
+  <xsl:template match="teiHeader"/>
+  <xsl:template match="refSystem"/>
+
+
+  <!-- Ignore titlePage -->
+  <xsl:template match="titlePage"/>
+
+  <!--=======================================================================-->
+  <!-- 
+    == Div provides the major containers for a work.
+    == Divs are milestoneable.
+    -->
+  <xsl:template match="div[@type='x-center']">
+    <div align="center">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="div" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- Handle verses as containers and as a start verse.                     -->
+  <xsl:template match="verse[not(@eID)]">
+    <!-- output each preverse element in turn -->
+    <xsl:for-each select=".//*[@subType = 'x-preverse' or @subtype = 'x-preverse']">
+      <xsl:choose>
+        <xsl:when test="local-name() = 'title'">
+          <!-- Always show canonical titles or if headings is turned on -->
+          <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+            <h3 class="heading"><xsl:apply-templates /></h3>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates />
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+      <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <span class="verse"><xsl:call-template name="versenum"/><xsl:apply-templates/></span>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse[not(@eID)]" mode="jesus">
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <xsl:variable name="title" select=".//title"/>
+    <xsl:if test="string-length($title) > 0">
+      <h3 class="heading"><xsl:value-of select="$title"/></h3>
+    </xsl:if>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+      <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates mode="jesus"/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="versenum"/><xsl:apply-templates mode="jesus"/>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse" mode="print-notes">
+    <xsl:if test=".//note[not(@type) or not(@type = 'x-strongsMarkup')]">
+      <xsl:variable name="passage" select="jsword:getValidKey($keyf, @osisID)"/>
+      <a href="#{substring-before(concat(@osisID, ' '), ' ')}">
+        <xsl:value-of select="jsword:getName($passage)"/>
+      </a>
+      <xsl:apply-templates select=".//note" mode="print-notes" />
+      <div><xsl:text>&#160;</xsl:text></div>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="versenum">
+    <!-- Are verse numbers wanted? -->
+    <xsl:if test="$VNum = 'true'">
+      <!-- An osisID can be a space separated list of them -->
+      <xsl:variable name="firstOsisID" select="substring-before(concat(@osisID, ' '), ' ')"/>
+      <xsl:variable name="book" select="substring-before($firstOsisID, '.')"/>
+      <xsl:variable name="chapter" select="jsword:shape($shaper, substring-before(substring-after($firstOsisID, '.'), '.'))"/>
+      <!-- If n is present use it for the number -->
+      <xsl:variable name="verse">
+        <xsl:choose>
+          <xsl:when test="@n">
+            <xsl:value-of select="jsword:shape($shaper, string(@n))"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="jsword:shape($shaper, substring-after(substring-after($firstOsisID, '.'), '.'))"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:variable name="versenum">
+        <xsl:choose>
+          <xsl:when test="$BCVNum = 'true'">
+            <xsl:variable name="passage" select="jsword:getValidKey($keyf, @osisID)"/>
+            <xsl:value-of select="jsword:getName($passage)"/>
+          </xsl:when>
+          <xsl:when test="$CVNum = 'true'">
+            <xsl:value-of select="concat($chapter, ' : ', $verse)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$verse"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <!--
+        == Surround versenum with dup
+        -->
+      <xsl:choose>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'true'">
+          <a name="{@osisID}"><span class="verseNumber"><xsl:value-of select="$versenum"/></span></a>
+        </xsl:when>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'false'">
+          <span class="verseNumber"><xsl:value-of select="$versenum"/></span>
+        </xsl:when>
+        <xsl:when test="$TinyVNum = 'false' and $Notes = 'true'">
+          <a name="{@osisID}">(<xsl:value-of select="$versenum"/>)</a>
+          <xsl:text> </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          (<xsl:value-of select="$versenum"/>)
+          <xsl:text> </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+    <xsl:if test="$VNum = 'false' and $Notes = 'true'">
+      <a name="{@osisID}"></a>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="a">
+    <a href="{@href}"><xsl:apply-templates/></a>
+  </xsl:template>
+
+  <xsl:template match="a" mode="jesus">
+    <a href="{@href}"><xsl:apply-templates mode="jesus"/></a>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- When we encounter a note, we merely output a link to the note. -->
+  <xsl:template match="note[@type = 'x-strongsMarkup']"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="jesus"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="print-notes"/>
+
+  <xsl:template match="note">
+    <xsl:if test="$Notes = 'true'">
+      <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="note" mode="jesus">
+    <xsl:if test="$Notes = 'true'">
+     <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="$siblings[$next-position] and name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="note" mode="print-notes">
+    <div class="margin">
+      <strong><xsl:call-template name="generateNoteXref"/></strong>
+      <a name="note-{generate-id(.)}">
+        <xsl:text> </xsl:text>
+      </a>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!--
+    == If the n attribute is present then use that for the cross ref otherwise create a letter.
+    == Note: numbering restarts with each verse.
+    -->
+  <xsl:template name="generateNoteXref">
+    <xsl:choose>
+      <xsl:when test="@n">
+        <xsl:value-of select="@n"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:number level="any" from="/osis//verse" format="a"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <xsl:template match="p" mode="jesus">
+    <p><xsl:apply-templates mode="jesus"/></p>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="p" mode="print-notes">
+    <!-- FIXME: This ignores text in the note. -->
+    <!-- don't put para's in notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="w">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates/>
+    
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="w" mode="jesus">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates mode="jesus"/>
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="seg">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class-1'">
+          <xsl:apply-templates/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="seg" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class:1'">
+          <xsl:apply-templates mode="jesus"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <!-- expansion is OSIS, expan is TEI -->
+  <xsl:template match="abbr">
+    <font class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@expan">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expan"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </font>
+  </xsl:template>
+
+  <xsl:template match="abbr" mode="jesus">
+    <font class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@expan">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expan"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates mode="jesus"/>
+    </font>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="speaker[@who = 'Jesus']">
+    <span class="jesus"><xsl:apply-templates mode="jesus"/></span>
+  </xsl:template>
+
+  <xsl:template match="speaker">
+    <span class="speech"><xsl:apply-templates/></span>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']" mode="jesus">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@level]">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title[@level]" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="reference">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="reference" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates mode="jesus"/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="caption">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="caption" mode="jesus">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="catchWord">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="catchWord" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!--
+      <cell> is handled shortly after <table> below and thus does not appear
+      here.
+  -->
+  
+  <xsl:template match="closer">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="closer" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="date">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="date" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="figure">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="figure" mode="jesus">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates mode="jesus"/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="foreign">
+    <em class="foreign"><xsl:apply-templates/></em>
+  </xsl:template>
+  
+  <xsl:template match="foreign" mode="jesus">
+    <em class="foreign"><xsl:apply-templates mode="jesus"/></em>
+  </xsl:template>
+  
+  <!-- This is a subheading. -->
+  <xsl:template match="head//head">
+    <h5 class="head"><xsl:apply-templates/></h5>
+  </xsl:template>
+  
+  <!-- This is a top-level heading. -->
+  <xsl:template match="head">
+    <h4 class="head"><xsl:apply-templates/></h4>
+  </xsl:template>
+  
+  <xsl:template match="index">
+    <a name="index{@id}" class="index"/>
+  </xsl:template>
+
+  <xsl:template match="inscription">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="inscription" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="item">
+    <li class="item"><xsl:apply-templates/></li>
+  </xsl:template>
+
+  <xsl:template match="item" mode="jesus">
+    <li class="item"><xsl:apply-templates mode="jesus"/></li>
+  </xsl:template>
+  
+  <!--
+      <item> and <label> are covered by <list> below and so do not appear here.
+  -->
+
+  <xsl:template match="lg">
+    <div class="lg"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg" mode="jesus">
+    <div class="lg"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg[@sID or @eID]"/>
+  <xsl:template match="lg[@sID or @eID]" mode="jesus"/>
+
+  <xsl:template match="l[@sID]"/>
+  <xsl:template match="l[@sID]" mode="jesus"/>
+
+  <xsl:template match="l[@eID]"><br/></xsl:template>
+  <xsl:template match="l[@eID]" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="l">
+    <xsl:apply-templates/><br/>
+  </xsl:template>
+  
+  <xsl:template match="l" mode="jesus">
+    <xsl:apply-templates mode="jesus"/><br/>
+  </xsl:template>
+
+  <!-- While a BR is a break, if it is immediately followed by punctuation,
+       indenting this rule can introduce whitespace.
+    -->
+  <xsl:template match="lb"><br /></xsl:template>
+  <xsl:template match="lb" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="list">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="."/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="."/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template match="list" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates mode="jesus"/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates mode="jesus"/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="mentioned">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="mentioned" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!-- Milestones represent characteristics of the original manuscript.
+    == that are being preserved. For this reason, most are ignored.
+    ==
+    == The defined types are:
+    == column   Marks the end of a column where there is a multi-column display.
+    == footer   Marks the footer region of a page.
+    == halfLine Used to mark half-line units if not otherwise encoded.
+    == header   Marks the header region of a page.
+    == line     Marks line breaks, particularly important in recording appearance of an original text, such as a manuscript.
+    == pb       Marks a page break in a text.
+    == screen   Marks a preferred place for breaks in an on-screen rendering of the text.
+    == cQuote   Marks the location of a continuation quote mark, with marker containing the publishers mark.
+    -->
+  <!--  This is used by the KJV for paragraph markers. -->
+  <xsl:template match="milestone[@type = 'x-p']"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+  <xsl:template match="milestone[@type = 'x-p']" mode="jesus"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']" mode="jesus">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']"><br/></xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']" mode="jesus"><br/></xsl:template>
+
+  <!--
+    == Milestone start and end are deprecated.
+    == At this point we expect them to not be in the document.
+    == These have been replace with milestoneable elements.
+    -->
+  <xsl:template match="milestoneStart"/>
+  <xsl:template match="milestoneEnd"/>
+  
+  <xsl:template match="name">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="name" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!-- If there is a milestoned q then just output a quotation mark -->
+  <xsl:template match="q[@sID or @eID]">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@sID or @eID]" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@who = 'Jesus']">
+    <span class="jesus"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></span>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']">
+    <span class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></span>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']" mode="jesus">
+    <span class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></span>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']">
+    <span class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></span>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']" mode="jesus">
+    <span class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></span>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'embedded']">
+    <xsl:choose>
+      <xsl:when test="@marker">
+        <xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@type = 'embedded']" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker">
+      <xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- An alternate reading. -->
+  <xsl:template match="rdg">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+   <xsl:template match="rdg" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--
+      <row> is handled near <table> below and so does not appear here.
+  -->
+  
+  <xsl:template match="salute">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+ <!-- Avoid adding whitespace -->
+  <xsl:template match="salute" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="signed">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="signed" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="speech">
+    <div class="speech"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="speech" mode="jesus">
+    <div class="speech"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <table class="table">
+      <xsl:copy-of select="@rows|@cols"/>
+      <xsl:if test="head">
+        <thead class="head"><xsl:apply-templates select="head"/></thead>
+      </xsl:if>
+      <tbody><xsl:apply-templates select="row"/></tbody>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="row">
+    <tr class="row"><xsl:apply-templates/></tr>
+  </xsl:template>
+  
+  <xsl:template match="cell">
+    <xsl:variable name="element-name">
+      <xsl:choose>
+        <xsl:when test="@role = 'label'">
+          <xsl:text>th</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>td</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="cell-direction">
+      <xsl:if test="@xml:lang">
+        <xsl:call-template name="getDirection">
+         <xsl:with-param name="lang"><xsl:value-of select="@xml:lang"/></xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:element name="{$element-name}">
+      <xsl:attribute name="class">cell</xsl:attribute>
+      <xsl:attribute name="valign">top</xsl:attribute>
+      <xsl:if test="@xml:lang">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="$cell-direction"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="$cell-direction = 'rtl'">
+        <xsl:attribute name="align">
+          <xsl:value-of select="'right'"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@rows">
+        <xsl:attribute name="rowspan">
+          <xsl:value-of select="@rows"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@cols">
+        <xsl:attribute name="colspan">
+          <xsl:value-of select="@cols"/>
+        </xsl:attribute>
+      </xsl:if>
+      <!-- hack alert -->
+      <xsl:choose>
+        <xsl:when test="$cell-direction = 'rtl'">
+          <xsl:text>&#8235;</xsl:text><xsl:apply-templates/><xsl:text>&#8236;</xsl:text>
+        </xsl:when>
+        <xsl:when test="$cell-direction = 'ltr'">
+          <xsl:text>&#8234;</xsl:text><xsl:apply-templates/><xsl:text>&#8236;</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="transChange">
+    <span><em><xsl:apply-templates/></em></span>
+  </xsl:template>
+  <xsl:template match="transChange" mode="jesus">
+    <span class="w"><em><xsl:apply-templates/></em></span>
+  </xsl:template>
+  
+  <!-- @type is OSIS, @rend is TEI -->
+  <xsl:template match="hi">
+    <xsl:variable name="style">
+      <xsl:choose>
+        <xsl:when test="@type">
+          <xsl:value-of select="@type"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@rend"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'acrostic'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="$style = 'bold'">
+        <strong><xsl:apply-templates/></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'emphasis'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'illuminated'">
+        <strong><em><xsl:apply-templates/></em></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'italic'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'line-through'">
+        <span class="strike"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'normal'">
+        <span class="normal"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'small-caps'">
+        <span class="small-caps"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'sub'">
+        <sub><xsl:apply-templates/></sub>
+      </xsl:when>
+      <xsl:when test="$style = 'super'">
+        <sup><xsl:apply-templates/></sup>
+      </xsl:when>
+      <xsl:when test="$style = 'underline'">
+        <span class="underline"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'x-caps'">
+        <span class="caps"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="hi" mode="jesus">
+    <xsl:variable name="style">
+      <xsl:choose>
+        <xsl:when test="@type">
+          <xsl:value-of select="@type"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@rend"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'acrostic'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="$style = 'bold'">
+        <strong><xsl:apply-templates/></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'emphasis'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'illuminated'">
+        <strong><em><xsl:apply-templates/></em></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'italic'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'line-through'">
+        <span class="strike"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'normal'">
+        <span class="normal"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'small-caps'">
+        <span class="small-caps"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'sub'">
+        <sub><xsl:apply-templates/></sub>
+      </xsl:when>
+      <xsl:when test="$style = 'super'">
+        <sup><xsl:apply-templates/></sup>
+      </xsl:when>
+      <xsl:when test="$style = 'underline'">
+        <span class="underline"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:when test="$style = 'x-caps'">
+        <span class="caps"><xsl:apply-templates/></span>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--
+    The following elements are actually TEI and there is some expectation
+    that these will make it into OSIS.
+  -->
+  <xsl:template match="superentry">
+    <!-- output each preverse element in turn -->
+    <xsl:for-each select="entry|entryFree">
+      <xsl:apply-templates/><br/><br/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="entry">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="entryFree">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="form">
+    <xsl:apply-templates/><br/>
+  </xsl:template>
+
+  <xsl:template match="orth">
+    <font class="orth"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="pron">
+    <font class="pron"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="etym">
+    <font class="etym"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="def">
+    <font class="def"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="usg">
+    <font class="usg"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="@xml:lang">
+    <xsl:variable name="dir">
+      <xsl:if test="@xml:lang">
+        <xsl:call-template name="getDirection">
+         <xsl:with-param name="lang"><xsl:value-of select="@xml:lang"/></xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:if test="$dir">
+      <xsl:attribute name="dir">
+        <xsl:value-of select="$dir"/>
+      </xsl:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="small-caps">
+  <xsl:value-of select="translate(., 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+  </xsl:template>
+
+  <!--
+    The direction is deduced from the xml:lang attribute and is assumed to be meaningful for those elements.
+    Note: there is a bug that prevents dir=rtl from working.
+    see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4296022 and 4866977
+  -->
+  <xsl:template name="getDirection">
+    <xsl:param name="lang"/>
+    <xsl:choose>
+      <xsl:when test="$lang = 'he' or $lang = 'ar' or $lang = 'fa' or $lang = 'ur' or $lang = 'syr'">
+        <xsl:value-of select="'rtl'"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="'ltr'"/>
+      </xsl:otherwise>
+    </xsl:choose>
+   </xsl:template>
+   
+	<xsl:template name="string-replace-all">
+	<xsl:param name="text" />
+	<xsl:param name="replace" />
+	<xsl:param name="by" />
+	<xsl:choose>
+		<xsl:when test="contains($text, $replace)">
+			<xsl:value-of select="substring-before($text,$replace)" />
+			<xsl:value-of select="$by" />
+			<xsl:call-template name="string-replace-all">
+				<xsl:with-param name="text" select="substring-after($text,$replace)" />
+				<xsl:with-param name="replace" select="$replace" />
+				<xsl:with-param name="by" select="$by" />
+			</xsl:call-template>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:value-of select="$text" />
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>  
+</xsl:stylesheet>

Added: trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImplTest.java
===================================================================
--- trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImplTest.java	                        (rev 0)
+++ trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/ModuleServiceImplTest.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,23 @@
+package com.tyndalehouse.step.core.service.impl;
+
+import static junit.framework.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+
+public class ModuleServiceImplTest {
+    /**
+     * tests that different definitions references resolve to the right module by default
+     */
+    @Test
+    public void testGetLookupModule() {
+        final ModuleServiceImpl msi = new ModuleServiceImpl();
+        final Map<String, String> defaultModules = new HashMap<String, String>();
+        msi.setDefaultModuleLexicons(defaultModules);
+
+        defaultModules.put("key:", "module");
+        assertEquals("module", msi.getLookupModule("key:H2929"));
+    }
+}

Added: trunk/step/step-server/pom.xml
===================================================================
--- trunk/step/step-server/pom.xml	                        (rev 0)
+++ trunk/step/step-server/pom.xml	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<parent>
+		<groupId>com.tyndalehouse.step</groupId>
+		<artifactId>step-parent</artifactId>
+		<version>1.0-SNAPSHOT</version>
+		<relativePath>../step-parent/pom.xml</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.tyndalehouse</groupId>
+	<artifactId>step-server</artifactId>
+	<packaging>jar</packaging>
+	<name>STEP :: Server wrapper for local execution</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty</artifactId>
+			<version>6.1.22</version>
+		</dependency>
+	</dependencies>
+</project>

Added: trunk/step/step-server/src/main/java/com/tyndalehouse/step/server/StepServer.java
===================================================================
--- trunk/step/step-server/src/main/java/com/tyndalehouse/step/server/StepServer.java	                        (rev 0)
+++ trunk/step/step-server/src/main/java/com/tyndalehouse/step/server/StepServer.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,50 @@
+package com.tyndalehouse.step.server;
+
+//import java.awt.Desktop;
+import java.awt.Desktop;
+import java.net.URI;
+import java.net.URL;
+
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.webapp.WebAppContext;
+import org.mortbay.xml.XmlConfiguration;
+
+public class StepServer {
+
+    /**
+     * creates and configures the Jetty server
+     * 
+     * @return the Server object if required to make modifications
+     * @throws Exception any uncaught exceptions that should be logged before exiting
+     */
+    private Server start() throws Exception {
+        final Server jetty = new Server();
+        final URL jettyConfig = StepServer.class.getClassLoader().getResource("jetty.xml");
+        final URL warURL = StepServer.class.getClassLoader().getResource("war");
+
+        // configure jetty
+        final XmlConfiguration configuration = new XmlConfiguration(jettyConfig);
+        configuration.configure(jetty);
+
+        // configure our web application
+        jetty.setHandler(new WebAppContext(warURL.toExternalForm(), "/step-web"));
+
+        // start the server
+        jetty.start();
+        return jetty;
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(final String[] args) {
+        try {
+            // TODO setup logger somewhere!
+            final StepServer ms = new StepServer();
+            ms.start();
+            Desktop.getDesktop().browse(new URI("http://localhost:8080/step-web"));
+        } catch (final Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Added: trunk/step/step-server/src/main/resources/jetty.xml
===================================================================
--- trunk/step/step-server/src/main/resources/jetty.xml	                        (rev 0)
+++ trunk/step/step-server/src/main/resources/jetty.xml	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,192 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+
+<!-- =============================================================== -->
+<!-- Configure the Jetty Server                                      -->
+<!--                                                                 -->
+<!-- Documentation of this file format can be found at:              -->
+<!-- http://docs.codehaus.org/display/JETTY/jetty.xml                -->
+<!--                                                                 -->
+<!-- =============================================================== -->
+
+<Configure id="Server" class="org.mortbay.jetty.Server">
+
+    <!-- =========================================================== -->
+    <!-- Server Thread Pool                                          -->
+    <!-- =========================================================== -->
+    <Set name="ThreadPool">
+      <!-- Local execution doesn't require that many threads, some css,js,servlets, so probably no more than 10 -->
+      <New class="org.mortbay.thread.BoundedThreadPool">
+        <Set name="minThreads">10</Set>
+        <Set name="maxThreads">25</Set>
+      </New>
+    </Set>
+
+
+
+    <!-- =========================================================== -->
+    <!-- Set connectors                                              -->
+    <!-- =========================================================== -->
+    <!-- One of each type!                                           -->
+    <!-- =========================================================== -->
+
+    <!-- Use this connector for many frequently idle connections
+         and for threadless continuations.
+    -->    
+    <Call name="addConnector">
+      <Arg>
+          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
+            <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
+            <Set name="maxIdleTime">30000</Set>
+            <Set name="Acceptors">1</Set>
+            <Set name="statsOn">false</Set>
+            <Set name="confidentialPort">8443</Set>
+	    <Set name="lowResourcesConnections">1000</Set>
+	    <Set name="lowResourcesMaxIdleTime">500</Set>
+          </New>
+      </Arg>
+    </Call>
+
+    <!-- Use this connector if NIO is not available.
+    <Call name="addConnector">
+      <Arg>
+          <New class="org.mortbay.jetty.bio.SocketConnector">
+            <Set name="port">8081</Set>
+            <Set name="maxIdleTime">50000</Set>
+            <Set name="lowResourceMaxIdleTime">1500</Set>
+          </New>
+      </Arg>
+    </Call>
+    -->
+
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+    <!-- To add a HTTPS SSL listener                                     -->
+    <!-- see jetty-ssl.xml to add an ssl connector. use                  -->
+    <!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml             -->
+    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+    
+    <!-- =========================================================== -->
+    <!-- Set up global session ID manager                            -->
+    <!-- =========================================================== -->
+    <!--
+    <Set name="sessionIdManager">
+      <New class="org.mortbay.jetty.servlet.HashSessionIdManager">
+        <Set name="workerName">node1</Set>
+      </New>
+    </Set>
+    -->
+
+    <!-- =========================================================== -->
+    <!-- Set handler Collection Structure                            --> 
+    <!-- =========================================================== -->
+    <Set name="handler">
+      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
+        <Set name="handlers">
+         <Array type="org.mortbay.jetty.Handler">
+           <Item>
+             <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
+           </Item>
+           <Item>
+             <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
+           </Item>
+           <Item>
+             <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
+           </Item>
+         </Array>
+        </Set>
+      </New>
+    </Set>
+    
+    <!-- =========================================================== -->
+    <!-- Configure the context deployer                              -->
+    <!-- A context deployer will deploy contexts described in        -->
+    <!-- configuration files discovered in a directory.              -->
+    <!-- The configuration directory can be scanned for hot          -->
+    <!-- deployments at the configured scanInterval.                 -->
+    <!--                                                             -->
+    <!-- This deployer is configured to deploy contexts configured   -->
+    <!-- in the $JETTY_HOME/contexts directory                       -->
+    <!--                                                             -->
+    <!-- =========================================================== -->
+    <Call name="addLifeCycle">
+      <Arg>
+        <New class="org.mortbay.jetty.deployer.ContextDeployer">
+          <Set name="contexts"><Ref id="Contexts"/></Set>
+          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
+          <Set name="scanInterval">1</Set>
+        </New>
+      </Arg>
+    </Call>
+
+    <!-- =========================================================== -->
+    <!-- Configure the webapp deployer.                              -->
+    <!-- A webapp  deployer will deploy standard webapps discovered  -->
+    <!-- in a directory at startup, without the need for additional  -->
+    <!-- configuration files.    It does not support hot deploy or   -->
+    <!-- non standard contexts (see ContextDeployer above).          -->
+    <!--                                                             -->
+    <!-- This deployer is configured to deploy webapps from the      -->
+    <!-- $JETTY_HOME/webapps directory                               -->
+    <!--                                                             -->
+    <!-- Normally only one type of deployer need be used.            -->
+    <!--                                                             -->
+    <!-- =========================================================== -->
+    <Call name="addLifeCycle">
+      <Arg>
+        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
+          <Set name="contexts"><Ref id="Contexts"/></Set>
+          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
+	  <Set name="parentLoaderPriority">false</Set>
+	  <Set name="extract">true</Set>
+	  <Set name="allowDuplicates">false</Set>
+          <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
+        </New>
+      </Arg>
+    </Call>
+
+    <!-- =========================================================== -->
+    <!-- Configure Authentication Realms                             -->
+    <!-- Realms may be configured for the entire server here, or     -->
+    <!-- they can be configured for a specific web app in a context  -->
+    <!-- configuration (see $(jetty.home)/contexts/test.xml for an   -->
+    <!-- example).                                                   -->
+    <!-- =========================================================== -->
+    <Set name="UserRealms">
+      <Array type="org.mortbay.jetty.security.UserRealm">
+        <!--
+        <Item>
+          <New class="org.mortbay.jetty.security.HashUserRealm">
+            <Set name="name">Test Realm</Set>
+            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
+          </New>
+        </Item>
+	-->
+      </Array>
+    </Set>
+
+    <!-- =========================================================== -->
+    <!-- Configure Request Log                                       -->
+    <!-- Request logs  may be configured for the entire server here, -->
+    <!-- or they can be configured for a specific web app in a       -->
+    <!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
+    <!-- for an example).                                            -->
+    <!-- =========================================================== -->
+    <Ref id="RequestLog">
+      <Set name="requestLog">
+        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
+          <Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Arg>
+          <Set name="retainDays">90</Set>
+          <Set name="append">true</Set>
+          <Set name="extended">false</Set>
+          <Set name="LogTimeZone">GMT</Set>
+        </New>
+      </Set>
+    </Ref>
+
+    <!-- =========================================================== -->
+    <!-- extra options                                               -->
+    <!-- =========================================================== -->
+    <Set name="stopAtShutdown">true</Set>
+    <!-- ensure/prevent Server: header being sent to browsers        -->
+    <Set name="sendServerVersion">true</Set>
+</Configure>

Added: trunk/step/step-server/src/main/webapps/README.txt
===================================================================
--- trunk/step/step-server/src/main/webapps/README.txt	                        (rev 0)
+++ trunk/step/step-server/src/main/webapps/README.txt	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1 @@
+Jetty relies on having a webapps folder - therefore we create one as a placeholder
\ No newline at end of file

Added: trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/ModuleController.java
===================================================================
--- trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/ModuleController.java	                        (rev 0)
+++ trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/ModuleController.java	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,33 @@
+package com.tyndalehouse.step.rest.controllers;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.tyndalehouse.step.core.service.ModuleService;
+
+ at RequestMapping(value = "/module", method = RequestMethod.GET)
+ at Controller
+public class ModuleController {
+    @Autowired
+    private ModuleService moduleDefintions;
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    /**
+     * a REST method that returns version of the Bible that are available
+     * 
+     * @param reference a reference for a module to lookup
+     * @return all versions of modules that are considered to be Bibles.
+     */
+    @RequestMapping(value = "/definitions/{reference}")
+    public @ResponseBody
+    String getDefinition(@PathVariable final String reference) {
+        this.logger.debug("Getting definition for {}", reference);
+        return this.moduleDefintions.getDefinition(reference).getExplanation();
+    }
+}

Modified: trunk/step/step-web/src/main/resources/log4j.properties
===================================================================
--- trunk/step/step-web/src/main/resources/log4j.properties	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/resources/log4j.properties	2010-12-01 22:09:54 UTC (rev 190)
@@ -7,6 +7,7 @@
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=%d %-5p %l %x - %m%n
 
+log4j.category.com.tyndalehouse=DEBUG
 
 # messages on second appender
 #log4j.appender.A2=org.apache.log4j.RollingFileAppender

Modified: trunk/step/step-web/src/main/webapp/WEB-INF/step-rest-servlet.xml
===================================================================
--- trunk/step/step-web/src/main/webapp/WEB-INF/step-rest-servlet.xml	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/WEB-INF/step-rest-servlet.xml	2010-12-01 22:09:54 UTC (rev 190)
@@ -10,7 +10,18 @@
 	<context:component-scan base-package="com.tyndalehouse.step.rest" />
 	<context:annotation-config />
 	
-	<bean id="bibleInformation" class="com.tyndalehouse.step.core.service.impl.BibleInformationServiceImpl" />
+	<bean id="bibleInformation" class="com.tyndalehouse.step.core.service.impl.BibleInformationServiceImpl">
+	</bean>
+	
+	<bean id="moduleService" class="com.tyndalehouse.step.core.service.impl.ModuleServiceImpl">
+		<property name="defaultModuleLexicons">
+			<map>
+				<entry key="strong:H" value="StrongsHebrew" />
+				<entry key="strong:G" value="StrongsGreek" />
+				<entry key="robinson:" value="Robinson" />
+			</map>
+		</property>
+	</bean>
 
 	<!-- Configures Spring MVC -->
 	<import resource="mvc-config.xml" />

Modified: trunk/step/step-web/src/main/webapp/css/initial-fonts.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/initial-fonts.css	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/css/initial-fonts.css	2010-12-01 22:09:54 UTC (rev 190)
@@ -3,10 +3,15 @@
 	font-family: Verdana;
 }
 
+
+
 .inactive {
 	color: #ccc;
 }
 
+.ui-helper-reset {
+	font-size: 70%;	
+}
 
 .ui-widget {
 	font-family: Verdana;

Modified: trunk/step/step-web/src/main/webapp/css/initial-layout.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/initial-layout.css	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/css/initial-layout.css	2010-12-01 22:09:54 UTC (rev 190)
@@ -30,6 +30,13 @@
     overflow: hidden !important;
 }
 
+.column .ui-layout-pane-north {
+	border: 0 !important;
+	padding-top: 0px;
+	padding-bottom: 0px;
+}
+
+
 .ui-autocomplete {
 	max-height: 500px;
 	overflow-y: auto;
@@ -56,7 +63,7 @@
 }
 
 .toolbarContainer {
-	display: none;
+/*	display: none; */
 	margin-top: 3px;
 	margin-bottom: 3px;
 	text-align: left;
@@ -74,7 +81,7 @@
 #loading { 
 	margin-top: 3px;
 	display: none;
-	z-index: 9999; /** always on top */
+	z-index: 9998; /** always on top, but not on top of lexicon def? */
 }
 
 #error {
@@ -83,3 +90,13 @@
 	margin: 0px;
 }
 
+#lexiconDefinition {
+	display: inline-block;
+	z-index: 9999;
+	width: 400px;
+	bottom: 0px;
+	right: 0px;
+	left: -1000px;
+}
+
+

Modified: trunk/step/step-web/src/main/webapp/index.jsp
===================================================================
--- trunk/step/step-web/src/main/webapp/index.jsp	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/index.jsp	2010-12-01 22:09:54 UTC (rev 190)
@@ -14,25 +14,32 @@
     <script src="libs/jquery-1.4.2.min.js" type="text/javascript"></script>
     <script src="libs/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>
     <script src="libs/jquery.layout-latest.js" type="text/javascript"></script>
+    <script src="libs/jquery-shout.js" type="text/javascript"></script>
     <script src="js/util.js" type="text/javascript"></script>
     <script src="js/passage_toolbar.js" type="text/javascript"></script>
     <script src="js/passage.js" type="text/javascript"></script>
+<!--    <script src="js/bookmark.js" type="text/javascript"></script>-->
+    <script src="js/lexicon_definition.js" type="text/javascript"></script>
+    <script src="js/ui_hooks.js" type="text/javascript"></script>
     <script src="js/init.js" type="text/javascript"></script>
 </HEAD>
 <body>
 
+<div id="leftColumn" class="column">
+	<!--  the toolbar -->
+	<div class="ui-layout-north toolbar"></div>
 
-<div class="passageContainer leftPassage">
-	<div>
-	    <input class="passageVersion defaultValue" type="text" value="Select a Bible version, e.g. ESV" />
-	    <input class="passageReference defaultValue" type="text"  value="Select a reference, e.g. Gen 1:1" /><button class="searchButton">Search</button>
-	    <input id="leftCheck" type="checkbox" class="toolbarButton"><label for="leftCheck">Toolbar</label></input>
+	<div class="passageContainer leftPassage ui-layout-center">
+		<div id="leftPassagePane">
+		    <input class="passageVersion defaultValue" type="text" value="Select a Bible version, e.g. ESV" />
+		    <input class="passageReference defaultValue" type="text"  value="Select a reference, e.g. Gen 1:1" /><button class="searchButton">Search</button>
+		    <input id="leftCheck" type="checkbox" class="toolbarButton"><label for="leftCheck">Toolbar</label></input>
+		</div>
+	    <div class="passageText ui-widget"></div>
 	</div>
-
-    <div class="passageText ui-widget"></div>
-    
 </div>
 
+
 <div class="ui-layout-center bookmarks" id="bookmarkPane">
 	<div class="ui-layout-north northBookmark">
 		<img src="images/step-logo.png" alt="STEP :: Scripture Tools for Every Pastor" />
@@ -43,14 +50,19 @@
 	</div>
 </div>
 
-<div class="passageContainer rightPassage">
-	<div>
-	    <input class="passageVersion defaultValue" type="text" value="Select a Bible version, e.g. ESV" />
-	    <input class="passageReference defaultValue" type="text"  value="Select a reference, e.g. Gen 1:1" /><button class="searchButton">Search</button>
-	    <input id="rightCheck" type="checkbox" class="toolbarButton"><label for="rightCheck">Toolbar</label></input>
-	</div>
-
-    <div class="passageText ui-widget"></div>
+<div id="rightColumn" class="column">
+	<!--  the toolbar -->
+	<div class="ui-layout-north toolbar"></div>
+	<div class="passageContainer rightPassage ui-layout-center">
+		<div id="rightPassagePane">
+		    <input class="passageVersion defaultValue" type="text" value="Select a Bible version, e.g. ESV" />
+		    <input class="passageReference defaultValue" type="text"  value="Select a reference, e.g. Gen 1:1" /><button class="searchButton">Search</button>
+		    <input id="rightCheck" type="checkbox" class="toolbarButton"><label for="rightCheck">Toolbar</label></input>
+		</div>
+	
+	    <div class="passageText ui-widget"></div>
+    </div>
+	
 </div>
 
 <div id="loading"><img alt="Loading..." src="images/wait16.gif" />Loading...</div>

Modified: trunk/step/step-web/src/main/webapp/js/bookmark.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/bookmark.js	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/js/bookmark.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -10,6 +10,7 @@
 	//we will store the elements in here, with their jquery wrapper
 	this.currentBookmarks = [];
 }
+
 //
 ///**
 // * Adding a bookmark

Modified: trunk/step/step-web/src/main/webapp/js/init.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/init.js	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/js/init.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -1,3 +1,5 @@
+
+
 // call the initialisation functions
 init();
 
@@ -6,6 +8,7 @@
 		initLayout();
 		initGlobalHandlers();
 		initDefaultValues();
+		initLexicon();
 		initData();
 	});
 }
@@ -23,9 +26,9 @@
 		autoReopen : true, // auto-open panes that were previously
 		autoBindCustomButtons : true,
 		north__paneSelector: '#error',
-		west__paneSelector : '.leftPassage',
+		west__paneSelector : '#leftColumn',
 		center__paneSelector : '.bookmarks',
-		east__paneSelector : '.rightPassage',
+		east__paneSelector : '#rightColumn',
 		west__size : .45, // percentage size expresses as a decimal
 		east__size : .45,
 		north__minSize : 0,
@@ -132,22 +135,58 @@
 			}
 		}
 		strongedVersions[0] = {label: "All available versions", value: allVersionsKey };
+		initPassages(parsedResponse, strongedVersions, options);
+	});
+}
 
+/**
+ * creates the passages components
+ * @param allVersions the list of versions to be given to a dropdown
+ * @param strongedVersions a list of version containing strong tagging
+ * @param options a list of options to be displayed in the toolbar
+ */
+function initPassages(allVersions, strongedVersions, options) {
+	//set up the left column
+	var columnLayouts = [
+	                     createColumnLayout('#leftColumn', 'leftColumnLayout', '.toolbar', '.leftPassage'),
+	                     createColumnLayout('#rightColumn', 'rightColumnLayout', '.toolbar', '.rightPassage')
+	                     ];
+	
+	//set up initial passages with reference data:
+	var versions = ["KJV" ];
+	var passages = ["Romans 1:1-3"];
+	$(".column").each(
+		function(index) {
+			var passage = new Passage($(".passageContainer", this), allVersions, columnLayouts[index]);
+			var toolbar = new Toolbar(passage, $(".toolbar", this), options, strongedVersions);
+			passage.setToolbar(toolbar);
+			
+			if(index < versions.length) {
+				passage.changePassage(versions[index], passages[index]);
+			}
+		}
+	);
+}
+
+function createColumnLayout(container, name, north, center) {
+	return $(container).layout({
+		name : name, 
+		resizable: false, 
+		closable: true,
+		slidable: true,
+		spacing_open: 0,
+		spacing_closed: 0,
 		
-		//set up initial passages with reference data:
-		var versions = ["KJV" ];
-		var passages = ["Romans 1:1-3"];
-		$(".passageContainer").each(
-				function(index) {
-					var passage = new Passage(this, parsedResponse);
-					var toolbar = new Toolbar(passage, options, strongedVersions);
-					passage.setToolbar(toolbar);
-					
-					if(index < versions.length) {
-						passage.changePassage(versions[index], passages[index]);
-					}
-				})
-		});
+		autoResize : true, // try to maintain pane-percentages
+		autoReopen : true, // auto-open panes that were previously
+		autoBindCustomButtons : true,
+		north__initClosed: true,
+		north__paneSelector : north,
+		center__paneSelector : center,
+		north__size : 50,
+		
+		noRoomToOpenAction : "hide"
+	});
 }
 
 function initGlobalHandlers() {
@@ -179,6 +218,10 @@
 	});
 }
 
+function initLexicon() {
+	var lexicon = new LexiconDefinition();
+}
+
 function raiseError(error) {
 	$("#error").text(error);
 	$('body').layout().open("north");

Added: trunk/step/step-web/src/main/webapp/js/lexicon_definition.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/lexicon_definition.js	                        (rev 0)
+++ trunk/step/step-web/src/main/webapp/js/lexicon_definition.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,74 @@
+
+/**
+ * The bookmarks components record events that are happening across the application,
+ * for e.g. passage changes, but will also show related information to the passage.
+ */
+function LexiconDefinition() {
+	var self = this;
+	//listen for particular types of events and call the prototype functions
+	this.getPopup().hear("show-all-strong-morphs", function(selfElement, data) {
+		self.showAllStrongMorphs(data);
+	} );
+}
+
+LexiconDefinition.prototype.getPopup = function() {
+	if(this.popup) {
+		return this.popup;
+	}
+	
+	//create the popup container
+	$("body").append("<span id='lexiconDefinition'><ul></ul></span>");
+	this.popup = $("#lexiconDefinition");
+	this.popup.tabs().draggable();
+	return this.popup;
+}
+
+LexiconDefinition.prototype.showStrong = function(s) {
+	
+}
+
+LexiconDefinition.prototype.showMorphs = function(s) {
+	
+}
+
+LexiconDefinition.prototype.showAllStrongMorphs = function(s) {
+	var self = this;
+	var popup = self.getPopup();
+	
+	//create all tabs - first remove everything, then readd.
+	popup.tabs("destroy");
+	popup.tabs();
+	
+	var tabs = s.split(" ");
+	$(tabs).each(function() {
+		popup.tabs("add", "rest/module/definitions/" + this, self.getShortKey(this));
+	});
+
+	popup.tabs("option", {
+		collapsible: true,
+		selected: 0
+	});
+	
+	//TODO this is a workaround because of bug http://bugs.jqueryui.com/ticket/5069
+	popup.tabs("select", 1);
+	popup.tabs("select", 0);
+	
+	//if left position is negative, then we assume it's off screen and need position
+	if(popup.css("left")[0] == '-') {
+		//position in the middle
+		popup.position({
+			of: $("body"),
+			my: "right top",
+			at: "right top",
+			collision: "fit flip",
+		});
+	}
+}
+
+LexiconDefinition.prototype.getShortKey = function(k) {
+	var subKey = k.substring(k.indexOf(':') + 1);
+	if(subKey[0] == 'G' || subKey[0] == 'H') {
+		return subKey.substring(1);
+	}
+	return subKey;
+}

Modified: trunk/step/step-web/src/main/webapp/js/passage.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage.js	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/js/passage.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -2,10 +2,14 @@
  * Definition of the Passage component responsible for displaying
  * OSIS passages appropriately. Ties the search box for the reference
  * and the version together to the passage displayed
+ * @param passageContainer the passage Container containing the whole control
+ * @param versions the list of versions to use to populate the dropdown
+ * @param columnLayout a handle to the layout manager to activate various panels
  */
-function Passage(passageContainer, versions) {
+function Passage(passageContainer, versions, columnLayout) {
 	var self = this;
 	this.container = passageContainer;
+	this.columnLayout = columnLayout;
 	this.version = $(".passageVersion", passageContainer);
 	this.reference = $(".passageReference", passageContainer);
 	this.passage = $(".passageText", passageContainer);
@@ -26,7 +30,8 @@
 		icons: { primary: "ui-icon-wrench" }, 
 		text: false
 	}).change(function() {
-		this.checked ? self.toolbar.open() : self.toolbar.close();
+		this.checked ? self.columnLayout.open("north") : self.columnLayout.close("north");
+//		this.checked ? self.toolbar.open() : self.toolbar.close();
 	});
 	
 	

Modified: trunk/step/step-web/src/main/webapp/js/passage_toolbar.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage_toolbar.js	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/js/passage_toolbar.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -5,15 +5,14 @@
  */
 	//static id
 var toolbarId = 0;
-function Toolbar(passage, buttonOptions, strongedVersions) {
+function Toolbar(passage, columnContainer, buttonOptions, strongedVersions) {
 
 	var self = this;
 	this.passage = passage;
 	
 	//create toolbar
-	var passageContainer = passage.getPassageContainer();
-	$(passage.getPassageContainer()).prepend('<div class="toolbarContainer ui-widget-content ui-corner-all" />');
-	this.toolbarContainer = $(".toolbarContainer", passageContainer);
+	columnContainer.append('<div class="toolbarContainer ui-widget-content ui-corner-all" />');
+	this.toolbarContainer = $(".toolbarContainer", columnContainer);
 
 	
 	//create a button for each option
@@ -25,8 +24,11 @@
 		//find the newly created button
 		var newButton = $('#sb' + toolbarId, self.toolbarContainer);
 		newButton.button().click(function() { self.passage.changePassage(); });
-	
 		
+		if(this.enabledByDefault) {
+			newButton.attr("checked", "checked");
+		}
+		
 		//finally, if we're looking at the interlinear, then create a dropdown with potential versions
 		if (this.key == "INTERLINEAR") {
 			self.createInterlinearDropdown(toolbarId, strongedVersions, newButton);

Added: trunk/step/step-web/src/main/webapp/js/ui_hooks.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/ui_hooks.js	                        (rev 0)
+++ trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -0,0 +1,32 @@
+/**
+ * This file defines a number of hooks that the server code can call.
+ * The aim is to redirect the calls quickly to other parts of the UI
+ */
+
+/**
+ * called when click on a piece of text.
+ * @param strongMorphs all the strongs and morphs associated with this "word"
+ */
+function showAllStrongMorphs(strongMorphs) {
+	$.shout("show-all-strong-morphs", strongMorphs);
+}
+
+/**
+ * Called when clicking on a strong link
+ * @param strong strong to be displayed
+ */
+function showStrong(strong) {
+	//need to find what event is coming in, to get the clicked element and pass that down
+	
+	//invoke show-all-strong-morphs first, for all 
+	
+	//select span containing text <strong>, then get its parent and invoke click() on it. 
+}
+
+/**
+ * called when clicking on a morph
+ * @param morph the moprh that is clicked on
+ */
+function showMorph(morph) {
+	
+}

Modified: trunk/step/step-web/src/main/webapp/libs/jquery-ui-1.8.5.custom.min.js
===================================================================
--- trunk/step/step-web/src/main/webapp/libs/jquery-ui-1.8.5.custom.min.js	2010-11-21 21:48:31 UTC (rev 189)
+++ trunk/step/step-web/src/main/webapp/libs/jquery-ui-1.8.5.custom.min.js	2010-12-01 22:09:54 UTC (rev 190)
@@ -452,8 +452,23 @@
 function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this));this.blur();return false}c.cookie&&b._cookie(c.selected,c.cookie);if(l.length){i.length&&b.element.queue("tabs",function(){s(g,i)});b.element.queue("tabs",function(){r(g,l)});b.load(b.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",
 function(){return false})},_getIndex:function(a){if(typeof a=="string")a=this.anchors.index(this.anchors.filter("[href$="+a+"]"));return a},destroy:function(){var a=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=d.data(this,"href.tabs");if(e)this.href=
 e;var b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){b.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});a.cookie&&this._cookie(null,a.cookie);return this},add:function(a,e,b){if(b===p)b=this.anchors.length;
-var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e));a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=d("#"+a);j.length||(j=d(h.panelTemplate).attr("id",a).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(b>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[b]);
-j.insertBefore(this.panels[b])}h.disabled=d.map(h.disabled,function(k){return k>=b?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[b],this.panels[b]));return this},remove:function(a){a=this._getIndex(a);var e=this.options,b=this.lis.eq(a).remove(),c=this.panels.eq(a).remove();
+var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e));
+
+//a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);
+
+e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);
+
+//temporary hack while waiting for fix:  http://bugs.jqueryui.com/ticket/5069
+//var j=d("#"+a);j.length||(j=d(h.panelTemplate).attr("id",a).data("destroy.tabs",true));
+//j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");
+
+if(b>=this.lis.length){e.appendTo(this.list);
+//j.appendTo(this.list[0].parentNode)
+}else{e.insertBefore(this.lis[b]);
+//j.insertBefore(this.panels[b])
+}h.disabled=d.map(h.disabled,function(k){return k>=b?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");
+//j.removeClass("ui-tabs-hide");
+this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[b],this.panels[b]));return this},remove:function(a){a=this._getIndex(a);var e=this.options,b=this.lis.eq(a).remove(),c=this.panels.eq(a).remove();
 if(b.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(a+(a+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=a}),function(h){return h>=a?--h:h});this._tabify();this._trigger("remove",null,this._ui(b.find("a")[0],c[0]));return this},enable:function(a){a=this._getIndex(a);var e=this.options;if(d.inArray(a,e.disabled)!=-1){this.lis.eq(a).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(b){return b!=a});this._trigger("enable",null,
 this._ui(this.anchors[a],this.panels[a]));return this}},disable:function(a){a=this._getIndex(a);var e=this.options;if(a!=e.selected){this.lis.eq(a).addClass("ui-state-disabled");e.disabled.push(a);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))}return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},
 load:function(a){a=this._getIndex(a);var e=this,b=this.options,c=this.anchors.eq(a)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(a).addClass("ui-state-processing");if(b.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(b.spinner)}this.xhr=d.ajax(d.extend({},b.ajaxOptions,{url:h,success:function(k,n){d(e._sanitizeSelector(c.hash)).html(k);e._cleanup();b.cache&&d.data(c,"cache.tabs",




More information about the Tynstep-svn mailing list