[jsword-svn] r1814 - in trunk/incubator/jsword-www/jswordweb: . WEB-INF/lib
Apache
apache at www.crosswire.org
Mon Apr 28 12:59:57 MST 2008
Author:
Date: 2008-04-28 12:59:56 -0700 (Mon, 28 Apr 2008)
New Revision: 1814
Modified:
trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-1.0.8.jar
trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-common-1.0.8.jar
trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-common-swing-1.0.8.jar
trunk/incubator/jsword-www/jswordweb/iBD.js
trunk/incubator/jsword-www/jswordweb/index.html
Log:
add parallel
Modified: trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-1.0.8.jar
===================================================================
(Binary files differ)
Modified: trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-common-1.0.8.jar
===================================================================
(Binary files differ)
Modified: trunk/incubator/jsword-www/jswordweb/WEB-INF/lib/jsword-common-swing-1.0.8.jar
===================================================================
(Binary files differ)
Modified: trunk/incubator/jsword-www/jswordweb/iBD.js
===================================================================
--- trunk/incubator/jsword-www/jswordweb/iBD.js 2008-04-24 20:31:14 UTC (rev 1813)
+++ trunk/incubator/jsword-www/jswordweb/iBD.js 2008-04-28 19:59:56 UTC (rev 1814)
@@ -27,7 +27,7 @@
var stylesheet = "iBD.xsl";
// Prevent the server from being hammered.
-var verseLimit = 10;
+var verseLimit = 5;
var verseStart= 0;
var total= 0;
@@ -47,7 +47,6 @@
JSword.getInstalledBooks("bookCategory=Bible", loadBooks);
JSword.getInstalledBooks("bookCategory=Dictionary", loadDictionaries);
JSword.getInstalledBooks("bookCategory=Commentary", loadCommentaries);
-
// Constrain the display area to be within the boundary of the window.
window.onresize = ibdResize;
ibdResize();
@@ -77,6 +76,7 @@
// Then populate it with data, using column "0" as the key and "1" as the display value
// Use "0", "0" to only show the books "initials"
dwr.util.addOptions("books", data, "0", "0");
+ dwr.util.addOptions("parallels", data, "0", "0");
}
/**
* Load the list of known Dictionaries
@@ -106,6 +106,20 @@
var dom = parser.parseFromString(data, "text/xml");
Sarissa.updateContentFromNode(dom, $("display"), processor);
}
+/**
+ * Called when book data has been fetched
+ */
+function loadDisplay_dict(data)
+{
+ var processor = new XSLTProcessor();
+ var xslDoc = Sarissa.getDomDocument();
+ xslDoc.async = false;
+ xslDoc.load(stylesheet);
+ processor.importStylesheet(xslDoc);
+ var parser = new DOMParser();
+ var dom = parser.parseFromString(data, "text/xml");
+ Sarissa.updateContentFromNode(dom, $("display_dict"), processor);
+}
function displayTotal(data)
{
total=data;
@@ -126,6 +140,7 @@
function pick_commentary()
{
locate_commentary();
+locate();
}
/**
@@ -133,7 +148,7 @@
*/
function locate()
{
- var book = getBook();
+ var book = getBooks();
var ref = getPassage();
if (book && ref)
{
@@ -143,14 +158,20 @@
}
return false;
}
+function trial(){
+ var ref = getPassage();
+var books="KJV:ASV:ChiUns";
+
+ JSword.getOSISString(books, ref, verseStart,verseLimit, loadDisplay);
+}
function locate_dictionary()
{
var dict= getDictionary();
var ref= getSearch();
- /** var ref = getPassage();*/
+ //var ref = getPassage();
if (dict&& ref)
{
- JSword.getOSISString(dict, ref, verseStart,verseLimit, loadDisplay);
+ JSword.getOSISString(dict, ref, verseStart,verseLimit, loadDisplay_dict);
return true;
}
return false;
@@ -161,11 +182,23 @@
var ref = getPassage();
if (dict&& ref)
{
- JSword.getOSISString(dict, ref, verseStart,verseLimit, loadDisplay);
+ addBooks(dict);
return true;
}
return false;
}
+function unpick_commentary()
+{
+ var dict= getCommentary();
+ var ref = getPassage();
+ if (dict&& ref)
+ {
+ removeBooks(dict);
+locate();
+ return true;
+ }
+ return false;
+}
function prev()
{
@@ -173,7 +206,7 @@
if (verseStart<0){
verseStart=0;
}
- var book = getBook();
+ var book = getBooks();
var ref = getPassage();
if (book && ref)
{
@@ -188,7 +221,7 @@
if (verseStart>total){
verseStart=total-verseLimit-1;
}
- var book = getBook();
+ var book = getBooks();
var ref = getPassage();
if (book && ref)
{
@@ -292,6 +325,31 @@
{
return dwr.util.getValue("books");
}
+var selectedbooks=new Array();
+function addBooks(selected){
+ var index=selectedbooks.indexOf(selected);
+ if (index==-1){
+ selectedbooks.push(selected);
+ }
+}
+function removeBooks(selected){
+ var index=selectedbooks.indexOf(selected);
+ if (index!=-1){
+ selectedbooks.splice(index,1);
+ }
+
+}
+function pick_parallel(){
+ addBooks(getParallel());
+locate();
+ }
+function unpick_parallel(){
+ removeBooks(getParallel());
+locate();
+ }
+function getBooks(){
+ return getBook()+","+selectedbooks.toString();
+}
function getDictionary()
{
return dwr.util.getValue("dictionaries");
@@ -300,6 +358,10 @@
{
return dwr.util.getValue("commentaries");
}
+function getParallel()
+{
+ return dwr.util.getValue("parallels");
+}
/**
* Set the book to search or locate against
Modified: trunk/incubator/jsword-www/jswordweb/index.html
===================================================================
--- trunk/incubator/jsword-www/jswordweb/index.html 2008-04-24 20:31:14 UTC (rev 1813)
+++ trunk/incubator/jsword-www/jswordweb/index.html 2008-04-28 19:59:56 UTC (rev 1814)
@@ -18,18 +18,26 @@
<link rel="stylesheet" type="text/css" href="iBD.css"/>
</head>
<body onload="init()">
+ <div id="bibleBox">
Bibles:
- <div id="bibleBox">
<select id="books" onchange="pick();"></select>
</div>
+ <div id="dictionarybox">
Dictionaries:
- <div id="dictionarybox">
<select id="dictionaries" onchange="pick_dictionary();"></select>
</div>
+ <div id="commentarybox">
Commentaries:
- <div id="commentarybox">
- <select id="commentaries" onchange="pick_commentary();"></select>
+ <select id="commentaries"></select>
+ <button type="button" id="pick_commentary" onclick="pick_commentary();">+</button>
+ <button type="button" id="unpick_commentary" onclick="unpick_commentary();">-</button>
</div>
+ <div id="parallelbox">
+Parallels:
+ <select id="parallels"></select>
+ <button type="button" id="pick_parallel" onclick="pick_parallel();">+</button>
+ <button type="button" id="unpick_parallel" onclick="unpick_parallel();">-</button>
+ </div>
<div id="locateBox" align="left">
<input type="text" id="passageRequest" onkeypress="dwr.util.onReturn(event, locate)"/>
@@ -46,8 +54,8 @@
</div>
Total:<div id="total"></div>
- <div id="display"></div>
-
+ <div id="display" style="width=80%"></div>
+ <div id="display_dict" style="width=20%"></div>
</body>
</html>
More information about the jsword-svn
mailing list