BUGFIX: nulls in search causing errors

* returned [] instead of null fixes issues
 * cleanup
 * added titles to strongs refs are properly saved to state
 * added terms excluded from search index
This commit is contained in:
jason.wall 2014-12-25 20:03:50 -05:00
parent f9dc9e5819
commit 799dd61dbb
3 changed files with 9 additions and 11 deletions

View File

@ -94,6 +94,8 @@
<b>G1234</b> (displays the Strong's definition for the Greek # 1234)<br />
<b>Jesus</b> (searches for "Jesus". all search terms assume boolean AND, i.e. "Jesus Christ" assumes "Jesus AND Christ". an word without a number is interpreted as search).<br />
</p>
<h3>Terms Excluded from Search Index</h3>
<p> "us", "these", "her", "saith", "shalt", "let", "do", "your", "we", "no", "go", "if", "at", "an", "so", "before", "also", "on", "had", "you", "there", "then", "up", "by", "upon", "were", "are", "this", "when", "thee", "their", "ye", "will", "as", "thy", "my", "me", "have", "from", "was", "but", "which", "thou", "all", "it", "with", "them", "him", "they", "is", "be", "not", "his", "i", "shall", "a", "for", "unto", "he", "in", "to", "that", "of", "and", "the"</p>
<h3>Notes:</h3>
<p>
multiple lookups can be made using a semicolon as a separator, i.e. "Ruth 1; g1234; Jesus"). <br />

View File

@ -95,7 +95,7 @@ var Search = function(sv) {
var original_q = q;
// its a strongs lookup
var dict = q.substring(0, 1);
if (dict.search(/h/i) != -1) {
dict = "heb";
} else {
@ -176,10 +176,6 @@ var Settings = {
if (ref != undefined && ref.trim() != "")
{
Search(ref);
//var myref = new Reference(ref);
//var r = Bible.GetPassage(myref.book, myref.startchapter, myref.endchapter, myref.startverse, myref.endverse);
//Bible.DisplayPassage(r.cs, myref, r.testament);
}
});
}
@ -492,7 +488,7 @@ var Strongs = {
// put together the display.
// ok. we have to do this because click events seem to be cumulative with jquery.
var t = $("<div class='strongsdef result'><a href='javascript:void();' class='removeresult' style='border: 0;'><img style='border: 0px;' src='images/delete.png' width='48' height='48' /></a><span class='resultbody'><b>" + trans + " (" + r.sn + ")</b> - " + pron + " - " + title + " - " + desc + "<br />" + rtxt + crtxt + "</span><br clear='all' /></div>");
var t = $("<div class='strongsdef result'><a href='javascript:void();' class='removeresult' style='border: 0;'><img style='border: 0px;' src='images/delete.png' width='48' height='48' /></a><span class='resultbody'><h2><a href='http://www.dynamicbible.com/?r=" + r.prefix + r.sn + "'>" + r.prefix + r.sn + "</a></h2><b>" + trans + " (" + r.sn + ")</b> - " + pron + " - " + title + " - " + desc + "<br />" + rtxt + crtxt + "</span><br clear='all' /></div>");
t.find(".link").click(function(e) {
Util.HandleLink(e);
@ -514,7 +510,7 @@ var Strongs = {
DisplayStrongs: function(r) {
try {
var t = Strongs.BuildStrongs(r);
$("#result").prepend(t);
return false;
} catch (err) {
@ -664,12 +660,12 @@ var Words = {
if (refs.length > 0) {
return refs[0].refs;
} else {
return null;
return [];
}
} catch (err) {
Util.HandleError(err);
}
return null;
return [];
},
BuildIndexArray: function() {
var words = new Array();

View File

@ -38,7 +38,7 @@ $(document).ready(function()
// load querystring
var ref = decodeURIComponent(Util.GetUrlVars().r);
if (ref !== "undefined") {
// remember the settings, first, because if you have results, the load process would wipe out the passage you want to load.
// remember the settings, first, because if you have results, the load process would wipe out the passage you want to load.
Settings.Load();
// now load the passage from the querystring.
Search(ref);
@ -47,7 +47,7 @@ $(document).ready(function()
Settings.Load();
}
// you need to do this last, otherwise the settings load resets the window height.
// you need to do this last, otherwise the settings load resets the window height.
$(window).bind("resize", function()
{
$(".my-breakpoint.ui-grid-c .ui-block-a").css("width", 55);