[Tynstep-svn] r265 - in trunk/step: step-core/src/main/java/com/tyndalehouse/step/core/models step-core/src/main/java/com/tyndalehouse/step/core/service/impl step-core/src/main/resources/com/tyndalehouse/step/core/service/impl step-core/src/test/java/com/tyndalehouse/step/core/service/impl step-web/src/main/webapp 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
Thu Apr 26 09:41:32 MST 2012


Author: ChrisBurrell
Date: 2012-04-26 09:41:32 -0700 (Thu, 26 Apr 2012)
New Revision: 265

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/service/impl/JSwordServiceImpl.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-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java
   trunk/step/step-web/src/main/webapp/css/initial-layout.css
   trunk/step/step-web/src/main/webapp/index.html
   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/ui_hooks.js
   trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css
   trunk/step/step-web/src/main/webapp/panemenu.html
Log:
TYNSTEP-151

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	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/models/LookupOption.java	2012-04-26 16:41:32 UTC (rev 265)
@@ -52,6 +52,10 @@
      */
     VERSE_NUMBERS("VNum", XslConversionType.DEFAULT, true),
     /**
+     * verses to be displayed on new line
+     */
+    VERSE_NEW_LINE("VLine", XslConversionType.DEFAULT),
+    /**
      * enabling red letter for the Words of Jesus
      */
     RED_LETTER("RedLetterText", XslConversionType.DEFAULT),
@@ -69,7 +73,7 @@
      */
     INTERLINEAR("Interlinear", XslConversionType.INTERLINEAR),
     /**
-     * Showing headings
+     * Showing tiny verse numbers
      */
     TINY_VERSE_NUMBERS("TinyVNum", XslConversionType.DEFAULT);
 

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	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-core/src/main/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImpl.java	2012-04-26 16:41:32 UTC (rev 265)
@@ -276,8 +276,9 @@
         // some options are always there for Bibles:
         if (BIBLE.equals(book.getBookCategory())) {
             options.add(LookupOption.VERSE_NUMBERS);
+            options.add(LookupOption.VERSE_NEW_LINE);
 
-            // TODO bug in modules? in jsword?
+            // TODO FIXME bug in modules? in jsword?
             options.add(LookupOption.RED_LETTER);
         }
 

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	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl	2012-04-26 16:41:32 UTC (rev 265)
@@ -242,7 +242,7 @@
       </xsl:choose>
     </xsl:for-each>
     <!-- Handle the KJV paragraph marker. -->
-    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <xsl:if test="milestone[@type = 'x-p']"><p /></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. -->
@@ -275,7 +275,7 @@
       <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>
+    <xsl:if test="milestone[@type = 'x-p']"><p /></xsl:if>
     <!-- Always output the verse -->
     <xsl:choose>
       <xsl:when test="$VLine = 'true'">
@@ -803,22 +803,22 @@
   <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[@eID]"><p /></xsl:template>
+  <xsl:template match="l[@eID]" mode="jesus"><p /></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:apply-templates mode="jesus"/><p />
   </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="lb[@type = 'x-end-paragraph']" ><p /></xsl:template>
+  <xsl:template match="lb" mode="jesus"><p /></xsl:template>
 
   <xsl:template match="list">
     <xsl:choose>

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	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl	2012-04-26 16:41:32 UTC (rev 265)
@@ -270,7 +270,7 @@
       </xsl:choose>
     </xsl:for-each>
     <!-- Handle the KJV paragraph marker. -->
-    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <xsl:if test="milestone[@type = 'x-p']"><p /></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. -->
@@ -303,7 +303,7 @@
       <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>
+    <xsl:if test="milestone[@type = 'x-p']"><p /></xsl:if>
     <!-- Always output the verse -->
     <xsl:choose>
       <xsl:when test="$VLine = 'true'">
@@ -966,8 +966,8 @@
   <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[@eID]"><p /></xsl:template>
+  <xsl:template match="l[@eID]" mode="jesus"><p /></xsl:template>
 
   <xsl:template match="l">
     <xsl:apply-templates/><br/>
@@ -980,8 +980,8 @@
   <!-- 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="lb"><br /></xsl:template>
+  <xsl:template match="lb" mode="jesus">a<br/></xsl:template>
 
   <xsl:template match="list">
     <xsl:choose>

Modified: trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java
===================================================================
--- trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-core/src/test/java/com/tyndalehouse/step/core/service/impl/JSwordServiceImplTest.java	2012-04-26 16:41:32 UTC (rev 265)
@@ -206,21 +206,19 @@
     }
 
     /**
-     * tests that the XSLT transformation is handled correctly
+     * Justs shows XML on the stdout
      * 
-     * @throws BookException uncaught exception
-     * @throws NoSuchKeyException uncaught exception
-     * @throws IOException uncaught exception
-     * @throws JDOMException uncaught exception
+     * @throws BookException an exceptioon
+     * @throws NoSuchKeyException an exception
+     * @throws IOException an exception
+     * @throws JDOMException an exception
      */
     @Test
-    public void testAbsenceOfParagraphMark() throws BookException, NoSuchKeyException, JDOMException,
-            IOException {
-        final String testReference = "Acts 1:15";
-        final String testVersion = "KJV";
-
-        final Book currentBook = Books.installed().getBook(testVersion);
-        final BookData bookData = new BookData(currentBook, currentBook.getKey(testReference));
+    public void testPrettyXml() throws BookException, NoSuchKeyException, JDOMException, IOException {
+        final String version = "KJV";
+        final String ref = "Genesis 46:9-10";
+        final Book currentBook = Books.installed().getBook(version);
+        final BookData bookData = new BookData(currentBook, currentBook.getKey(ref));
         final Element osisFragment = bookData.getOsisFragment();
 
         final XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());
@@ -231,12 +229,13 @@
         final List<LookupOption> options = new ArrayList<LookupOption>();
         // options.add(LookupOption.STRONG_NUMBERS);
 
-        final String osisText = jsi.getOsisText(testVersion, testReference, options, "").getValue();
+        final String osisText = jsi.getOsisText(version, ref, options, "").getValue();
         final SAXBuilder sb = new SAXBuilder();
         final Document d = sb.build(new StringReader(osisText));
 
         LOGGER.debug("\n {}", xmlOutputter.outputString(d));
         Assert.assertTrue(osisText.contains("span"));
+
     }
 
     // /**

Modified: trunk/step/step-web/src/main/webapp/css/initial-layout.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/initial-layout.css	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/css/initial-layout.css	2012-04-26 16:41:32 UTC (rev 265)
@@ -277,6 +277,7 @@
 
 .inactive {
 	color: grey;
+	font-style: italic;
 }
 
 #loading { 

Modified: trunk/step/step-web/src/main/webapp/index.html
===================================================================
--- trunk/step/step-web/src/main/webapp/index.html	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/index.html	2012-04-26 16:41:32 UTC (rev 265)
@@ -151,7 +151,7 @@
 	Please enter a year: <input type="text" id="scrollToYear" />
 </div>
 
-<div id="previewReference" ></div>
+<div id="previewReference" style="display: none"></div>
 
 </body>
 

Modified: trunk/step/step-web/src/main/webapp/js/interlinear_popup.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/js/interlinear_popup.js	2012-04-26 16:41:32 UTC (rev 265)
@@ -26,6 +26,10 @@
 	});
 	
 	
+	this.interlinearPopup.hear("version-changed-" + this.passageId, function() {
+		self.refreshCheckBoxes();
+	});
+	
 	//now do the handlers
 	this.refreshCheckBoxes(versionsFromServer);
 	this.addShowHandler();
@@ -37,19 +41,24 @@
 InterlinearPopup.prototype.refreshCheckBoxes = function(versionsFromServer) {
 	var strongedVersions = [];
 	var ii = 0;
-	
+
 	//delete current popup
 	$("table", this.interlinearPopup).remove();
 	
-	//iterate through all versions for those that have strong numbers
-	$.each(versionsFromServer, function(index, item) {
-		var showingText = "[" + item.initials + "] " + item.name;
-		if(item.hasStrongs) {
-			strongedVersions[ii++] = { label: showingText, value: item.initials};
-		}
-	});
-	
-	this.createCheckboxes(strongedVersions);
+	//if we've been passed in versions, then store
+	if(versionsFromServer) {
+		//iterate through all versions for those that have strong numbers
+		$.each(versionsFromServer, function(index, item) {
+			var showingText = "[" + item.initials + "] " + item.name;
+			if(item.hasStrongs) {
+				strongedVersions[ii++] = { label: showingText, value: item.initials};
+			}
+		});
+		
+		this.versions = strongedVersions;
+	}
+
+	this.createCheckboxes(this.versions);
 	this.addHandlersToCheckboxes();
 	this.addAllOptionsHandler();
 };
@@ -63,31 +72,38 @@
 	var allOptionsValue = "";
 	var allCheckBoxes = "";
 	var interlinearChoices = $(".interlinearChoices", this.interlinearPopup);
+	var displayedVersion = $(".passageContainer[passage-id = " + this.passageId +"] .passageVersion").val();
 	
 	var row = 0;
 	for(ii = 0 ; ii < strongedVersions.length; ii++) {
 		var longName = strongedVersions[ii].label;
 		var shortName = longName.length > 20 ? shortenName(longName, 20) : longName;
+		var disabledOption = displayedVersion == strongedVersions[ii].value;
+		var disabledCheckBox = disabledOption ? "disabled='disabled' " : "";
+		var disabledLabel = disabledOption ? "inactive" : "";
 		
 		//created a checkbox for this, that adds the text if checked to the input
-		if((row % 2) == 0) {
+		if((ii % 2) == 0) {
 			allCheckBoxes += "<tr>";
 		}
 		
 		allCheckBoxes += "<td>";
-		allCheckBoxes += "<input id='il_" + ii + "' type='checkbox' value='" + strongedVersions[ii].value + "' />" +
-						  "<label for='il_" + ii + "' title='" + longName + "'>" + shortName + "</label>";
+		allCheckBoxes += "<input id='il_" + ii + "' type='checkbox' value='" + strongedVersions[ii].value + "' "; 
+		allCheckBoxes += disabledCheckBox + " />"+
+						  "<label for='il_" + ii + "' title='" + longName + "' class='" + disabledLabel +"'>" + shortName + "</label>";
 		allCheckBoxes += "</td>";
 	
+		
+		
 		if((row % 2) == 1) {
 			allCheckBoxes += "</tr>";
 		}
 		
-		row++;
-		
-		allOptionsValue += strongedVersions[ii].value;
-		if(ii < strongedVersions.length -1) {
-			allOptionsValue += ',';
+		if(displayedVersion != strongedVersions[ii].value) {
+			allOptionsValue += strongedVersions[ii].value;
+			if(ii < strongedVersions.length -1) {
+				allOptionsValue += ',';
+			}
 		}
 	}
 	

Modified: trunk/step/step-web/src/main/webapp/js/passage.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-26 16:41:32 UTC (rev 265)
@@ -320,17 +320,21 @@
 	var offset = (80 * (this.passageId == 0 ? 1 : -1)) + " 0";
 	
 	$.getSafe(BIBLE_GET_BIBLE_TEXT + this.version.val() + "/" + reference, function(data) {
-		$("#previewReference").html(data.value + "<span class='previewReferenceKey'>[" + data.reference + "]</span>");
-		$("#previewReference").show().position({
+		var popup = $("#previewReference");
+		
+		popup.html(data.value + "<span class='previewReferenceKey'>[" + data.reference + "]</span>");
+		popup.show().position({
 			of: $(source),
 			my: myAnchor + " center",
 			at: "center " + "center",
 			offset: offset,
 			collision: "fit"
+		}).mouseleave(function(s) {
+			popup.hide();
 		});
 		
 		$(".notesPane").mouseleave(function(s) {
-			$("#previewReference").hide();
+			popup.hide();
 		});
 	});
 };

Modified: trunk/step/step-web/src/main/webapp/js/ui_hooks.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2012-04-26 16:41:32 UTC (rev 265)
@@ -57,6 +57,7 @@
 }
 
 
+
 /** a simpler toggler for the menu items */
 function toggleMenuItem(menuItem) {
 	//the hook needs to find the passage id if we're a sub menu

Modified: trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css
===================================================================
--- trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/libs/menu/ddsmoothmenu.css	2012-04-26 16:41:32 UTC (rev 265)
@@ -152,7 +152,7 @@
 .ddsmoothmenu ul li ul li a {
 	font-weight: normal;
 /*	 13px Verdana;*/
-	width: 160px; /*width of sub menus*/
+	width: 175px; /*width of sub menus*/
 	padding: 5px;
 	margin: 0;
 	border-top-width: 0;

Modified: trunk/step/step-web/src/main/webapp/panemenu.html
===================================================================
--- trunk/step/step-web/src/main/webapp/panemenu.html	2012-04-26 14:03:58 UTC (rev 264)
+++ trunk/step/step-web/src/main/webapp/panemenu.html	2012-04-26 16:41:32 UTC (rev 265)
@@ -3,6 +3,7 @@
 	<ul>
 		<li><a href="#"  name="HEADINGS" onclick="toggleMenuItem(this);">Headings</a></li>
 		<li><a href="#" name="VERSE_NUMBERS" onclick="toggleMenuItem(this);">Verse Numbers</a></li>
+		<li><a href="#" name="VERSE_NEW_LINE" onclick="toggleMenuItem(this);">Verses on separate lines</a>
 		<li><a href="#" name="RED_LETTER" onclick="toggleMenuItem(this);">Red Letters</a></li>
 		<li><a href="#" name="NOTES" onclick="toggleMenuItem(this);">Notes and References</a></li>
 		<li><a href="#" name="STRONG_NUMBERS" onclick="toggleMenuItem(this);">Strong Numbers</a></li>




More information about the Tynstep-svn mailing list