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>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 /> <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> </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> <h3>Notes:</h3>
<p> <p>
multiple lookups can be made using a semicolon as a separator, i.e. "Ruth 1; g1234; Jesus"). <br /> 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; var original_q = q;
// its a strongs lookup // its a strongs lookup
var dict = q.substring(0, 1); var dict = q.substring(0, 1);
if (dict.search(/h/i) != -1) { if (dict.search(/h/i) != -1) {
dict = "heb"; dict = "heb";
} else { } else {
@ -176,10 +176,6 @@ var Settings = {
if (ref != undefined && ref.trim() != "") if (ref != undefined && ref.trim() != "")
{ {
Search(ref); 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. // put together the display.
// ok. we have to do this because click events seem to be cumulative with jquery. // 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) { t.find(".link").click(function(e) {
Util.HandleLink(e); Util.HandleLink(e);
@ -514,7 +510,7 @@ var Strongs = {
DisplayStrongs: function(r) { DisplayStrongs: function(r) {
try { try {
var t = Strongs.BuildStrongs(r); var t = Strongs.BuildStrongs(r);
$("#result").prepend(t); $("#result").prepend(t);
return false; return false;
} catch (err) { } catch (err) {
@ -664,12 +660,12 @@ var Words = {
if (refs.length > 0) { if (refs.length > 0) {
return refs[0].refs; return refs[0].refs;
} else { } else {
return null; return [];
} }
} catch (err) { } catch (err) {
Util.HandleError(err); Util.HandleError(err);
} }
return null; return [];
}, },
BuildIndexArray: function() { BuildIndexArray: function() {
var words = new Array(); var words = new Array();

View File

@ -38,7 +38,7 @@ $(document).ready(function()
// load querystring // load querystring
var ref = decodeURIComponent(Util.GetUrlVars().r); var ref = decodeURIComponent(Util.GetUrlVars().r);
if (ref !== "undefined") { 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(); Settings.Load();
// now load the passage from the querystring. // now load the passage from the querystring.
Search(ref); Search(ref);
@ -47,7 +47,7 @@ $(document).ready(function()
Settings.Load(); 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() $(window).bind("resize", function()
{ {
$(".my-breakpoint.ui-grid-c .ui-block-a").css("width", 55); $(".my-breakpoint.ui-grid-c .ui-block-a").css("width", 55);