[Tynstep-svn] r216 - in trunk/step: step-core/src/main/java/com/tyndalehouse/step/core/service/impl step-core/src/main/resources/com/tyndalehouse/step/core/service/impl step-web/src/main/webapp/css step-web/src/main/webapp/js step-web/src/main/webapp/libs/menu

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Tue Mar 1 15:28:39 MST 2011


Author: ChrisBurrell
Date: 2011-03-01 15:28:39 -0700 (Tue, 01 Mar 2011)
New Revision: 216

Modified:
   trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java
   trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl
   trunk/step/step-web/src/main/webapp/css/passage.css
   trunk/step/step-web/src/main/webapp/js/interlinear_popup.js
   trunk/step/step-web/src/main/webapp/js/passage.js
   trunk/step/step-web/src/main/webapp/js/toolbar_menu.js
   trunk/step/step-web/src/main/webapp/js/ui_hooks.js
   trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css
Log:
TYNSTEP-84, TYNSTEP-98, TYNSTEP-104

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	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2011-03-01 22:28:39 UTC (rev 216)
@@ -128,29 +128,36 @@
             final BookData bookData = new BookData(currentBook, currentBook.getKey(reference));
             final Set<XslConversionType> requiredTransformation = identifyStyleSheet(options);
 
-            final SAXEventProvider osissep = bookData.getSAXEventProvider();
-            TransformingSAXEventProvider htmlsep = null;
-            htmlsep = (TransformingSAXEventProvider) new Converter() {
+            // TODO: This is a workaround while jsword is being fixed. see JS-109, and email from CJB on
+            // 27/02/2011
+            synchronized (this) {
+                final SAXEventProvider osissep = bookData.getSAXEventProvider();
+                TransformingSAXEventProvider htmlsep = null;
+                htmlsep = (TransformingSAXEventProvider) new Converter() {
 
-                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);
+                    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);
 
-                        // set parameters here
-                        setOptions(tsep, options, version, reference);
-                        setupInterlinearOptions(tsep, interlinearVersion, reference);
-                        return tsep;
-                    } catch (final URISyntaxException e) {
-                        throw new StepInternalException("Failed to load resource correctly", e);
+                            // set parameters here
+                            setOptions(tsep, options, version, reference);
+                            setupInterlinearOptions(tsep, interlinearVersion, reference);
+                            return tsep;
+                        } catch (final URISyntaxException e) {
+                            throw new StepInternalException("Failed to load resource correctly", e);
+                        }
                     }
-                }
 
-            }.convert(osissep);
-            return XMLUtil.writeToString(htmlsep);
+                }.convert(osissep);
+                return XMLUtil.writeToString(htmlsep);
+            }
         } catch (final NoSuchKeyException e) {
             throw new StepInternalException("The verse specified was not found: " + reference, e);
         } catch (final BookException e) {

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	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl	2011-03-01 22:28:39 UTC (rev 216)
@@ -500,7 +500,24 @@
   </xsl:template>
 
   <!--=======================================================================-->
+  <!-- This section defines the interlinear word 							 -->
+  <!--=======================================================================-->
 	<xsl:template match="w">
+		<xsl:call-template name="outputInterlinearWord">
+			<xsl:with-param name="classes" select="'w'" />
+		</xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="w" mode="jesus">
+		<xsl:call-template name="outputInterlinearWord">
+			<xsl:with-param name="classes" select="'w jesus'" />
+		</xsl:call-template>
+	</xsl:template>
+
+
+	<xsl:template name="outputInterlinearWord">
+		<xsl:param name="classes" select="'w'" />
+	
 		<!-- Output the content followed by all the lemmas and then all the morphs. 
 			So, we know we have a number of lines to create, therefore, we'll create 
 			that many! -->
@@ -514,7 +531,8 @@
 		</xsl:if>
 
 		<!-- start the block -->
-		<span class="w" onclick="javascript:showAllStrongMorphs("{@lemma} {@morph}")">
+		
+		<span class="{$classes}" onclick="javascript:showAllStrongMorphs("{@lemma} {@morph}")">
 			<!-- 1st - Output first line or a blank if no text available. -->
 			<span class="text">
 				<xsl:call-template name="outputNonBlank">
@@ -1097,7 +1115,7 @@
   </xsl:template>
   
   <xsl:template match="q[@who = 'Jesus']">
-    <font class="jesus"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></font>
+    <xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus" /><xsl:value-of select="@marker"/>
   </xsl:template>
 
   <xsl:template match="q[@type = 'blockquote']">
@@ -1553,7 +1571,13 @@
 
   <!-- If the parent of the text is a verse then, we need to wrap in span. This applies
   to any punctuation really, since all other words should be contained in a W  -->
-  <xsl:template match="text()">
+  <xsl:template match="text()" mode="jesus">
+  	<xsl:call-template name="matchSimpleText"></xsl:call-template>
+  </xsl:template>
+  
+  
+  
+  <xsl:template match="text()" name="matchSimpleText">
   		<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>

Modified: trunk/step/step-web/src/main/webapp/css/passage.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/passage.css	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/css/passage.css	2011-03-01 22:28:39 UTC (rev 216)
@@ -1,7 +1,7 @@
 .passageText {
 	margin-top: 1px;
 	overflow: auto;
-	height: 96%;
+	padding: 0px 5px;
 	position: relative;
 	text-align: left;
 }
@@ -160,21 +160,22 @@
 
 
 .editable {
-	border: 0px;
+	border: 1px dashed black;
 }
 
 .editable:hover {
-	border: 1px dashed black;
+	border: 1px solid black;
 	font-style: italic;
 }
 
 .editable:focus {
 	border: 1px solid black;
-	font-style: italic;
+	font-style: normal;
 }
 
 .headingContainer {
-	height: 30px;	
+	height: 30px;
+	padding-bottom: 5px;
 }
 
 H2.heading, input.heading {

Modified: trunk/step/step-web/src/main/webapp/js/interlinear_popup.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2011-03-01 22:28:39 UTC (rev 216)
@@ -134,7 +134,7 @@
 			},
 			modal: true,
 			width: DEFAULT_POPUP_WIDTH,
-			title: "Please choose one or more versions for the interlinear" + self.passageId
+			title: "Please choose one or more versions for the interlinear"
 		});
 	});
 }

Modified: trunk/step/step-web/src/main/webapp/js/passage.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage.js	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/js/passage.js	2011-03-01 22:28:39 UTC (rev 216)
@@ -48,8 +48,6 @@
 	});
 }
 
-
-
 /**
  * changes the passage, with optional parameters
  */
@@ -105,8 +103,11 @@
  * @strongReference the reference look for across this passage pane and highlight
  */
 Passage.prototype.highlightStrong = function(strongReference) {
-	$(".verse span[onclick*=" + strongReference + "]", this.container).css("text-decoration", "underline");
-	$("span.w[onclick*=" + strongReference + "] span.text", this.container).css("text-decoration", "underline");
+	//check for black listed strongs
+	if($.inArray(strongReference, Passage.getBlackListedStrongs()) == -1) {
+		$(".verse span[onclick*=" + strongReference + "]", this.container).css("text-decoration", "underline");
+		$("span.w[onclick*=" + strongReference + "] span.text", this.container).css("text-decoration", "underline");
+	}
 }
 
 /**
@@ -156,6 +157,14 @@
 }
 
 /**
+ * static method that returns strongs that should not be tagged in the UI
+ */
+Passage.getBlackListedStrongs = function() {
+	return ["strong:G3588"];
+}
+
+
+/**
  * sets the toolbar so that the passage can open/close it
  */
 Passage.prototype.setToolbar = function(toolbar) {

Modified: trunk/step/step-web/src/main/webapp/js/toolbar_menu.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/toolbar_menu.js	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/js/toolbar_menu.js	2011-03-01 22:28:39 UTC (rev 216)
@@ -88,7 +88,7 @@
  */
 ToolbarMenu.prototype.checkItemIsSelectable = function(selectedItem) {
 	//we only deal with elements that are enabled
-	if(this.getItemSelector().hasClass("disabled")) {
+	if(this.getItemSelector(selectedItem).hasClass("disabled")) {
 		return false;
 	}
 	return true;

Modified: trunk/step/step-web/src/main/webapp/js/ui_hooks.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2011-03-01 22:28:39 UTC (rev 216)
@@ -74,7 +74,7 @@
 */
 function showMorphOrStrong(tag, sourceElement) {
 	//trigger the parent event - to show everything
-	$(sourceElement).parent().click()
+	$(sourceElement).parent().click();
 	
 	//need to find what event is coming in, to get the clicked element and pass that down
 	$("#lexiconDefinition span:contains(" + tag + ")").parent().click();	

Modified: trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css
===================================================================
--- trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css	2011-02-27 23:10:46 UTC (rev 215)
+++ trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css	2011-03-01 22:28:39 UTC (rev 216)
@@ -76,12 +76,16 @@
 }
 
 .ddsmoothmenu ul li ul li a.disabled {
-	background-color: grey;
+	background-color: lightgrey;
+	color: grey;
+	font-style: italic;
 }
 
 
 .ddsmoothmenu ul li ul li a.disabled:hover {
-	background-color: grey;
+	background-color: lightgrey;
+	color: grey;
+	font-style: italic;
 }
 
 




More information about the Tynstep-svn mailing list