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

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Sat Apr 28 08:18:18 MST 2012


Author: ChrisBurrell
Date: 2012-04-28 08:18:18 -0700 (Sat, 28 Apr 2012)
New Revision: 269

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/interlinear.xsl
   trunk/step/step-web/src/main/webapp/css/passage.css
   trunk/step/step-web/src/main/webapp/index.html
   trunk/step/step-web/src/main/webapp/js/passage.js
   trunk/step/step-web/src/main/webapp/js/ui_hooks.js
Log:
TYNSTEP-121

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-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/default.xsl	2012-04-28 15:18:18 UTC (rev 269)
@@ -679,14 +679,14 @@
         <xsl:variable name="versification" select="jsword:getVersification($v11nf, $v11n)"/>
         <xsl:variable name="passage" select="jsword:getValidKey($keyf, $versification, @osisRef)"/>
         <xsl:variable name="passageKey" select="jsword:getName($passage)"/>
-        <a href="#" class="linkRef" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:changePassage(this, "{$passageKey}");"><xsl:apply-templates/></a>
+        <a href="#" title="Click for more options" class="linkRef" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:showPreviewOptions();"><xsl:apply-templates/></a>
   </xsl:template>
   
   <xsl:template match="reference" mode="jesus">
         <xsl:variable name="versification" select="jsword:getVersification($v11nf, $v11n)"/>
         <xsl:variable name="passage" select="jsword:getValidKey($keyf, $versification, @osisRef)"/>
         <xsl:variable name="passageKey" select="jsword:getName($passage)"/>
-        <a href="#" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:changePassage(this, "{$passageKey}");"><xsl:apply-templates/></a>
+        <a href="#" title="Click for more options" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:showPreviewOptions();"><xsl:apply-templates/></a>
   </xsl:template>
   
   <!--=======================================================================-->

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-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-core/src/main/resources/com/tyndalehouse/step/core/service/impl/interlinear.xsl	2012-04-28 15:18:18 UTC (rev 269)
@@ -809,25 +809,17 @@
 
   <!--=======================================================================-->
   <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:variable name="versification" select="jsword:getVersification($v11nf, $v11n)"/>
+        <xsl:variable name="passage" select="jsword:getValidKey($keyf, $versification, @osisRef)"/>
+        <xsl:variable name="passageKey" select="jsword:getName($passage)"/>
+        <a href="#" title="Click for more options" class="linkRef" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:showOptions();"><xsl:apply-templates/></a>
   </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:variable name="versification" select="jsword:getVersification($v11nf, $v11n)"/>
+        <xsl:variable name="passage" select="jsword:getValidKey($keyf, $versification, @osisRef)"/>
+        <xsl:variable name="passageKey" select="jsword:getName($passage)"/>
+        <a href="#" title="Click for more options" onmouseover="javascript:viewPassage(this, "{$passageKey}");" onclick="javascript:showOptions();"><xsl:apply-templates/></a>
   </xsl:template>
   
   <!--=======================================================================-->

Modified: trunk/step/step-web/src/main/webapp/css/passage.css
===================================================================
--- trunk/step/step-web/src/main/webapp/css/passage.css	2012-04-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-web/src/main/webapp/css/passage.css	2012-04-28 15:18:18 UTC (rev 269)
@@ -293,15 +293,33 @@
 	color: white;
 	font-weight: solid;
 	z-index: 9999999;
-	max-width: 280px;
-	max-height: 200px;
+	max-width: 350px;
+	max-height: 350px;
 	background-color: #F6A828 ;
 	border: 2px solid #E78F08;
 	overflow: hidden;
-	padding: 5px;
+	margin: 5px;
 }
 
-.previewReferenceKey {
+#previewReference a {
+	float: right;
+}
+
+
+#previewBar {
+	border: 2px	 solid #E78F08;
+	background-color: #E78F08;
+	border-bottom: none;
+	margin: 0px;
+	height: 28px;
+}
+
+#previewReference p {
+	margin: 0px;
+}
+
+
+#previewReference .previewReferenceKey {
 	font-style: italic;
 }
 

Modified: trunk/step/step-web/src/main/webapp/index.html
===================================================================
--- trunk/step/step-web/src/main/webapp/index.html	2012-04-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-web/src/main/webapp/index.html	2012-04-28 15:18:18 UTC (rev 269)
@@ -151,7 +151,11 @@
 	Please enter a year: <input type="text" id="scrollToYear" />
 </div>
 
-<div id="previewReference" style="display: none"></div>
+<div id="previewReference" style="display: none"><div id="previewBar" style="display: none;">
+	<a href="#" id="previewClose">Close this popup</a>
+	<a href="#" id="previewRight">See passage on the right pane</a>
+	<a href="#" id="previewLeft">See passage on the left pane</a>
+</div><span id="popupText"></span></div>
 
 </body>
 

Modified: trunk/step/step-web/src/main/webapp/js/passage.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-web/src/main/webapp/js/passage.js	2012-04-28 15:18:18 UTC (rev 269)
@@ -361,20 +361,20 @@
 	var offset = (80 * (this.passageId == 0 ? 1 : -1)) + " 0";
 	
 	$.getSafe(BIBLE_GET_BIBLE_TEXT + this.version.val() + "/" + reference, function(data) {
+		$("#popupText").html(data.value + "<span class='previewReferenceKey'>[" + data.reference + "]</span>");
+
 		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) {
+		}).on("mouseleave.previewscripture", function(s) {
 			popup.hide();
 		});
 		
-		$(".notesPane").mouseleave(function(s) {
+		$(".notesPane").on("mouseleave.previewscripture", function(s) {
 			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-28 13:31:27 UTC (rev 268)
+++ trunk/step/step-web/src/main/webapp/js/ui_hooks.js	2012-04-28 15:18:18 UTC (rev 269)
@@ -116,10 +116,43 @@
  * @param passageReference
  */
 function viewPassage(element, passageReference) {
-	$.shout("show-preview-" + getPassageId(element), { source: element, reference: passageReference});
+	//only shout preview if the preview bar is not displaying options on it.
+	if(!$("#previewBar").is(":visible") || !$("#previewReference").is(":visible")) {
+		$.shout("show-preview-" + getPassageId(element), { source: element, reference: passageReference});
+	}
 }
 
 /**
+ * we show the preview options in the box that shows the reference.
+ */
+function showPreviewOptions() {
+	var previewBar = $("#previewBar");
+	$("#previewLeft", previewBar).button({text: false, icons: { primary:"ui-icon-arrowthick-1-w" }}).click(
+			function(){
+				$.shout("new-passage-0", $("#previewReference .previewReferenceKey").text().replace(/[\[\]]/g, ""));
+				$("#previewClose").trigger("click");
+			});
+	$("#previewClose", previewBar).button({text: false, icons: { primary:"ui-icon-close" }}).click(
+			function() { 
+				$("#previewBar").hide();
+				$("#previewReference").hide();
+			});
+	$("#previewRight", previewBar).button({text: false, icons: { primary:"ui-icon-arrowthick-1-e" }}).click(
+			function(){
+				$.shout("new-passage-1", $("#previewReference .previewReferenceKey").text());
+				$("#previewClose").trigger("click");
+			});
+	previewBar.show();
+	
+	//we remove handlers that close the popup and make it resizable and draggable + remove margin from container top
+	$("#previewReference").resizable({maxWidth: 500}).off("mouseleave.previewscripture").draggable({handle: "#previewBar"});
+	$(".notesPane").off("mouseleave.previewscripture");
+	$(".notesPane").off("mouseleave");
+	//remove any margin from the container top
+	
+}
+
+/**
  * shows the login popup
  */
 function login() {




More information about the Tynstep-svn mailing list