From 894bb171b19d6f67515d413c4cb68720006649f1 Mon Sep 17 00:00:00 2001 From: "jwall@VAPPRCSN015.vap.local" Date: Wed, 2 Nov 2011 13:50:08 -0400 Subject: [PATCH] .. --- about.html | 86 ----------- css/bible.css | 37 ++++- help.html | 75 --------- js/common.js | 213 ++++++++++++++++++++----- js/reference.js | 404 ------------------------------------------------ xml/crgrk33.xml | 288 ++++++++++++++++++++++++++++++++++ 6 files changed, 496 insertions(+), 607 deletions(-) delete mode 100644 about.html delete mode 100644 help.html delete mode 100644 js/reference.js create mode 100644 xml/crgrk33.xml diff --git a/about.html b/about.html deleted file mode 100644 index fca860c6..00000000 --- a/about.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - About The Bible with Strong's Numbers and Cross References (AJAX Enabled) by Walljm.com - - - - -
-
-

About the King James Bible with Strong's Numbers and Cross References (AJAX Enabled)

- -

Thanks

-

Several people have helped me with the AJAX Bible and I would like to take some time to thanks them. -

    -
  • Jeremy Wall, my brother, wrote the perl script that used the expat parser to generate the index I use for word search. His script parsed the bible in 2 minutes. Hoo. Rah. -
  • Daniel Bergey graciously donated his time and expertise and styled the AJAX Bible. -
  • The Zephania Bible Project which supplied all my raw xml data. You can see the links below for specific files and resources I used. -
-

- -

Notes:

-

-

    -
  • The AJAX Bible works fine in Firefox, IE6, and Safari. I can't garuntee any other browser will - work. If the browser impliments the DOM and the xmlhttp function the same - as Firefox, It should work.
  • -
  • The word search index has a list of excluded words that made the index overly large. Here they are, for reference: and, of, not, for, shall, it, that, the, than, then, they, unto, them, in, he, this, thou, and to.
  • -
  • The AJAX Bible is implimented completely without databases, relying on xml - files for its data. I did it this way so that it could be run from your - desktop without the need for a webserver. You can download the AJAX - Bible in its current form here. - Unzip and run the index.html file in your browser. :)
  • -
-

-

Things to Do:

-

-

    -
  • Add Textus Receptus Greek NT -
  • Replace Strongs cross refs with Websters Lexicon. -
-

- -

Useful Resources

-

-

-

- -

License

-

- The Ajax Bible uses a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. - -

-
-
- \ No newline at end of file diff --git a/css/bible.css b/css/bible.css index 32fa493a..180c56ed 100644 --- a/css/bible.css +++ b/css/bible.css @@ -52,6 +52,7 @@ h3 { #main { margin: 0 3px 0 3px; } + #searchresultswrap { font: 11px verdana; width: 20%; @@ -68,23 +69,44 @@ h3 { border-top: 2px solid #999; border-left: 2px solid #999; } + #searchresults { xmargin-right: 10px; padding: 10px; - overflow: auto; + overflow:scroll; + height: 700px; border-right: 2px solid #999; border-bottom: 2px solid #999; border-left: 2px solid #999; } #searchresults ul { - margin-left: 0; - padding-left: 0px; -} -#searchresults ul { - padding-left: 15px; - list-style: circle; + margin: 0; + padding: 0; + list-style-type: none; list-style-position: inside; } +#searchresults ul li +{ + margin: 0 0 3px 0; +} +#searchresults ul a +{ + width: 100%; + height: 30px; + display: block; + line-height: 30px; + background-color: #ddd; + padding: 3px; + text-align:center; + font-size: 21px; + font-family: Georgia, Serif; + text-decoration: none; + color: Maroon; +} +#searchresults ul a:hover +{ + background-color: #fff; +} #resultwrap { width: 80%; float: left; @@ -105,6 +127,7 @@ h3 { xbackground: #eef; padding: 10px 10px; } + #result { font: 13px georgia; margin: 0 0 12px 12px; diff --git a/help.html b/help.html deleted file mode 100644 index a8d68d5a..00000000 --- a/help.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - Help with The Bible with Strong's Numbers and Cross References (AJAX Enabled) by Walljm.com - - - - -
-
-

Help with the King James Bible with Strong's Numbers and Cross References (AJAX Enabled)

- -

How To Search

-

- The search function does not behave like most typical search engines. You can't use quotes or punctuation, and it won't recognize boolean - operators as such (it will treat them as search terms if they aren't on the ignore list wich is [and, of, not, for, shall, it, that, the, than, then, they, unto, them, in, he, this, thou, and to.]). - - The search terms should be seperated by a space. The results will return a reference for every verse that has all the search terms in it, - without regard to the order they are found. -

-

How To Lookup a Strongs Number

-

The engine will recognize strongs numbers if found in the format (H|G)XXXX, i.e. G1 or H32. The "G" stands for Greek, and the "H" for Hebrew. - This notation is how the numbers will appear in the strongs definitions, and are hyperlinked for easy lookup. -

-

How To Lookup a Reference

-

References will be recognized by the engine as long as there is a number along with a word. If the book doesn't exist or the abbreviation you used - is not recognized, nothing will be returned.
-

How to Lookup a Reference, a Search term, and a Strongs Number all at once

-

- Try seperating your queries with a semi-colon, like so "John 3:16; John 11:32; Jesus Wept; H1234;" -

- Acceptable forms of notation are shown below: - -

- -

- Most common forms of abbreviation are recognized. Numbers that prefix a book can be noted like so: 1, I, First, 2, II, or Second, and are case insensitive. -

-

License

-

The Ajax Bible uses a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. - -

-
-
- - \ No newline at end of file diff --git a/js/common.js b/js/common.js index 69e8c475..bde628c1 100644 --- a/js/common.js +++ b/js/common.js @@ -1,6 +1,72 @@ +function SortNumeric(x, y) +{ + return x - y +} + +String.prototype.trim = function() +{ + return this.replace(/^\s+|\s+$/g, ""); +} +String.prototype.ltrim = function() +{ + return this.replace(/^\s+/, ""); +} +String.prototype.rtrim = function() +{ + return this.replace(/\s+$/, ""); +} + +function Traverse(node, testament) +{ + var treeText = ""; + if (node != null) + { + if (node.hasChildNodes()) + { + if (node.nodeName == "strongs") + { + // you need to test if this is the OT or NT and set the attribute accordingly. + var t = ""; + if (testament == "old") + { + t= "H"; + } + if (testament == "new") + { + t="G"; + } + treeText += "" + Traverse(node.childNodes.item(0), testament) + ""; + } else + { + treeText += '<' + node.nodeName + '>'; + for (var i = 0; i < node.childNodes.length; i++) + { + treeText += Traverse(node.childNodes.item(i), testament); + } + treeText += ''; + } + } else + { + if (node.nodeValue != null) + { + if (node.nodeValue.search(/^(\,|\.|\:|\?|\;|\!)/) != -1) + { + treeText += node.nodeValue; + } else + { + treeText += " " + node.nodeValue; + } + } + } + } + return treeText; +} + + // // This function is what gets executed by the search box. // + function Search(sv) { var qs = sv.split(";"); @@ -36,9 +102,10 @@ function Search(sv) var passage = ""; if (q.trim() != "") { - var myReference = new Reference(q.trim()); - getVersesByRef(myReference.book, myReference.chapter, myReference.startverse, myReference.endverse); - passage += myReference.bookname + " " + myReference.chapter + ":" + myReference.startverse + "-" + myReference.endverse; + var myref = new Reference(q.trim()); + var r = Bible.GetPassage(myref.book, myref.chapter, myref.startverse, myref.endverse); + + Bible.DisplayPassage(r.vs, myref.book, myref.chapter, myref.startverse, myref.endverse, r.testament); } } } @@ -49,18 +116,97 @@ function Search(sv) return false; } +var RMAC = { + +} + +var Bible = { + DisplayPassage: function(vs, b, ch, sv, ev, testament) + { + var r = ""; + + for (var i = 0; i < vs.length; i++) + { + var v = vs[i]; + + r += "" + $(v).attr("number") + ". "; + + for (var j = 0; j < v.childNodes.length; j++) + { + r += Traverse(v.childNodes[j], testament); + } + + + r += "
"; + } + + var t = $("
" + "

" + bookName(b) + " " + ch + ":" + sv + "-" + ev + "

" + r + "

"); + + t.find(".hiddenlink").click(function(e) + { + Util.HandleHiddenLink(e); + }); + t.find(".removeresult").click(function(e) + { + Util.RemoveResult(e); + }); + $("#result").append(t); + }, + GetPassage: function(b, ch, sv, ev) + { + var xml; // the verses from the chapter. + var vs = new Array(); // the verses requested. + var r = {}; + + var url = "xml/" + b + "-" + ch + ".xml" + $.ajax({ + async: false, + type: "GET", + url: url, + dataType: "xml", + success: function(d, t, x) + { + xml = d; + }, + error: function(request, status, error) + { + Utility.handleError(error, request); + } + }); + + // get the verses requested. + if (ev == "*") + { + vs = $(xml).find("verse"); + } + else + { + for (var i = sv; i <= ev; i++) + { + vs.unshift($(xml).find('verse[number="' + i + '"]')[0]) + } + } + r.vs = vs; + r.testament = $(xml).find("book").attr("testament"); + return r; + } +} + var Util = { HandleLink: function(e) { Search($(e.target).text()); }, + HandleHiddenLink: function(e) + { + Search($(e.target).find(".searchvalue").text()); + }, RemoveResult: function(e) { $(e.target).parent().parent().remove(); } } - var Strongs = { GetStrongs: function(sn, dict) { @@ -124,7 +270,7 @@ var Strongs = { cr.each(function(i) { - crtxt += $(this).find("t").text() + ":"; + crtxt += $(this).find("t").text() + ": "; $(this).find("r").each(function(j) { @@ -132,9 +278,8 @@ var Strongs = { crtxt += "" + bookName(ref[0]) + " " + ref[1] + ":" + ref[2] + ", "; }); crtxt = crtxt.substr(0, crtxt.length - 2); - crtxt += " ; "; + crtxt += "
"; }); - crtxt = crtxt.substr(0, crtxt.length - 2); crtxt += ""; // put together the display. @@ -155,22 +300,23 @@ var Strongs = { } } -var RMAC = { - -} - -var Bible = { - -} - var Words = { - DisplayResults: function(r) + ConvertResultsToArray: function(r) { - var txt = "Query: " + query + "'