- minor cleanup of unused vars, formatting

This commit is contained in:
walljm 2013-04-09 11:53:04 -04:00
parent b896020dc2
commit 12f9e1194d
4 changed files with 52 additions and 40 deletions

View File

@ -28,7 +28,6 @@ function parseReference(ref, r) {
function parseBook(ref, data, errAcc) { function parseBook(ref, data, errAcc) {
ref = ref.toLowerCase().trim(); ref = ref.toLowerCase().trim();
var bibleNames = new Object;
var fbook = ref.substring(0, ref.search(/\w\s+\d/i)+1); var fbook = ref.substring(0, ref.search(/\w\s+\d/i)+1);
var rest = ref.slice(ref.search(/\w\s+\d/i)+1); var rest = ref.slice(ref.search(/\w\s+\d/i)+1);
@ -439,7 +438,6 @@ function parseBook(ref, data, errAcc) {
function parseFirstNum(ref, r, errAcc) { function parseFirstNum(ref, r, errAcc) {
ref = ref.ltrim(); ref = ref.ltrim();
var ch = "";
var found = false; var found = false;
for (var i = 0; i <= ref.length; i++) { for (var i = 0; i <= ref.length; i++) {
var c = ref.charAt(i); var c = ref.charAt(i);
@ -463,7 +461,6 @@ function parseFirstNum(ref, r, errAcc) {
function parseSecondNum(ref, r, errAcc, skipColon) { function parseSecondNum(ref, r, errAcc, skipColon) {
ref = ref.toLowerCase().ltrim(); ref = ref.toLowerCase().ltrim();
var vs = "";
if (!skipColon) { if (!skipColon) {
if (ref[0] != ":") { if (ref[0] != ":") {
return ref; return ref;
@ -528,6 +525,7 @@ function maybeParseRangeSep(ref, r, errAcc) {
return ""; return "";
}); });
} }
function Reference(ref) function Reference(ref)
{ {
r = { r = {
@ -540,6 +538,7 @@ function Reference(ref)
second: '' second: ''
} }
}; };
// First collect all our tokens so to speak // First collect all our tokens so to speak
parseReference(ref.toLowerCase().trim(), r); parseReference(ref.toLowerCase().trim(), r);
this.book = r.start.book; this.book = r.start.book;
@ -548,6 +547,7 @@ function Reference(ref)
this.startchapter = r.start.first; this.startchapter = r.start.first;
this.endchapter = r.start.first; this.endchapter = r.start.first;
this.startverse = '1'; this.startverse = '1';
// Then start our statemachine. // Then start our statemachine.
// Determine start verse // Determine start verse
if (r.start.second != '') { if (r.start.second != '') {

View File

@ -3,18 +3,19 @@ function SortNumeric(x, y)
return x - y return x - y
} }
String.prototype.trim = function() String.prototype.trim = function()
{ {
return this.replace(/^\s+|\s+$/g, ""); return this.replace(/^\s+|\s+$/g, "");
} }
String.prototype.ltrim = function() String.prototype.ltrim = function()
{ {
return this.replace(/^\s+/, ""); return this.replace(/^\s+/, "");
} }
String.prototype.rtrim = function() String.prototype.rtrim = function()
{ {
return this.replace(/\s+$/, ""); return this.replace(/\s+$/, "");
} }
function Traverse(node, testament) function Traverse(node, testament)
{ {
try try
@ -122,7 +123,6 @@ function Search(sv)
// its a verse reference. // its a verse reference.
else else
{ {
var passage = "";
if (q.trim() != "") if (q.trim() != "")
{ {
var myref = new Reference(q.trim()); var myref = new Reference(q.trim());
@ -147,7 +147,6 @@ function Search(sv)
return false; return false;
} }
var Settings = { var Settings = {
Load: function() Load: function()
{ {
@ -276,6 +275,7 @@ var Bible = {
try try
{ {
var r = ""; var r = "";
// make the end verse pretty. // make the end verse pretty.
var tvs = cs[cs.length - 1].vss.length; var tvs = cs[cs.length - 1].vss.length;
@ -303,10 +303,16 @@ var Bible = {
if (v.w[w].s != undefined) if (v.w[w].s != undefined)
{ {
var strongs_pre = ""; var strongs_pre = "";
if (testament == "old") { strongs_pre = "H"; } if (testament == "old") {
if (testament == "new") {strongs_pre = "G"; } strongs_pre = "H";
}
if (testament == "new") {
strongs_pre = "G";
}
var sp = ""; var sp = "";
if (v.w[w].t.substr(v.w[w].t.length-1) == " ") { sp = " "; } if (v.w[w].t.substr(v.w[w].t.length-1) == " ") {
sp = " ";
}
r += "<a href='javascript:void();' class='hiddenlink' title='Strongs #: " + v.w[w].s + "'><span class='searchvalue' style='display:none'>" + strongs_pre + v.w[w].s + "</span>" + v.w[w].t.trim() + "</a>"+sp; r += "<a href='javascript:void();' class='hiddenlink' title='Strongs #: " + v.w[w].s + "'><span class='searchvalue' style='display:none'>" + strongs_pre + v.w[w].s + "</span>" + v.w[w].t.trim() + "</a>"+sp;
} }
else else

View File

@ -28,7 +28,6 @@ function parseReference(ref, r) {
function parseBook(ref, data, errAcc) { function parseBook(ref, data, errAcc) {
ref = ref.toLowerCase().trim(); ref = ref.toLowerCase().trim();
var bibleNames = new Object;
var fbook = ref.substring(0, ref.search(/\w\s+\d/i)+1); var fbook = ref.substring(0, ref.search(/\w\s+\d/i)+1);
var rest = ref.slice(ref.search(/\w\s+\d/i)+1); var rest = ref.slice(ref.search(/\w\s+\d/i)+1);
@ -439,7 +438,6 @@ function parseBook(ref, data, errAcc) {
function parseFirstNum(ref, r, errAcc) { function parseFirstNum(ref, r, errAcc) {
ref = ref.ltrim(); ref = ref.ltrim();
var ch = "";
var found = false; var found = false;
for (var i = 0; i <= ref.length; i++) { for (var i = 0; i <= ref.length; i++) {
var c = ref.charAt(i); var c = ref.charAt(i);
@ -463,7 +461,6 @@ function parseFirstNum(ref, r, errAcc) {
function parseSecondNum(ref, r, errAcc, skipColon) { function parseSecondNum(ref, r, errAcc, skipColon) {
ref = ref.toLowerCase().ltrim(); ref = ref.toLowerCase().ltrim();
var vs = "";
if (!skipColon) { if (!skipColon) {
if (ref[0] != ":") { if (ref[0] != ":") {
return ref; return ref;
@ -528,6 +525,7 @@ function maybeParseRangeSep(ref, r, errAcc) {
return ""; return "";
}); });
} }
function Reference(ref) function Reference(ref)
{ {
r = { r = {
@ -540,6 +538,7 @@ function Reference(ref)
second: '' second: ''
} }
}; };
// First collect all our tokens so to speak // First collect all our tokens so to speak
parseReference(ref.toLowerCase().trim(), r); parseReference(ref.toLowerCase().trim(), r);
this.book = r.start.book; this.book = r.start.book;
@ -548,6 +547,7 @@ function Reference(ref)
this.startchapter = r.start.first; this.startchapter = r.start.first;
this.endchapter = r.start.first; this.endchapter = r.start.first;
this.startverse = '1'; this.startverse = '1';
// Then start our statemachine. // Then start our statemachine.
// Determine start verse // Determine start verse
if (r.start.second != '') { if (r.start.second != '') {

View File

@ -3,18 +3,19 @@ function SortNumeric(x, y)
return x - y return x - y
} }
String.prototype.trim = function() String.prototype.trim = function()
{ {
return this.replace(/^\s+|\s+$/g, ""); return this.replace(/^\s+|\s+$/g, "");
} }
String.prototype.ltrim = function() String.prototype.ltrim = function()
{ {
return this.replace(/^\s+/, ""); return this.replace(/^\s+/, "");
} }
String.prototype.rtrim = function() String.prototype.rtrim = function()
{ {
return this.replace(/\s+$/, ""); return this.replace(/\s+$/, "");
} }
function Traverse(node, testament) function Traverse(node, testament)
{ {
try try
@ -122,7 +123,6 @@ function Search(sv)
// its a verse reference. // its a verse reference.
else else
{ {
var passage = "";
if (q.trim() != "") if (q.trim() != "")
{ {
var myref = new Reference(q.trim()); var myref = new Reference(q.trim());
@ -147,7 +147,6 @@ function Search(sv)
return false; return false;
} }
var Settings = { var Settings = {
Load: function() Load: function()
{ {
@ -276,6 +275,7 @@ var Bible = {
try try
{ {
var r = ""; var r = "";
// make the end verse pretty. // make the end verse pretty.
var tvs = cs[cs.length - 1].vss.length; var tvs = cs[cs.length - 1].vss.length;
@ -303,10 +303,16 @@ var Bible = {
if (v.w[w].s != undefined) if (v.w[w].s != undefined)
{ {
var strongs_pre = ""; var strongs_pre = "";
if (testament == "old") { strongs_pre = "H"; } if (testament == "old") {
if (testament == "new") {strongs_pre = "G"; } strongs_pre = "H";
}
if (testament == "new") {
strongs_pre = "G";
}
var sp = ""; var sp = "";
if (v.w[w].t.substr(v.w[w].t.length-1) == " ") { sp = " "; } if (v.w[w].t.substr(v.w[w].t.length-1) == " ") {
sp = " ";
}
r += "<a href='javascript:void();' class='hiddenlink' title='Strongs #: " + v.w[w].s + "'><span class='searchvalue' style='display:none'>" + strongs_pre + v.w[w].s + "</span>" + v.w[w].t.trim() + "</a>"+sp; r += "<a href='javascript:void();' class='hiddenlink' title='Strongs #: " + v.w[w].s + "'><span class='searchvalue' style='display:none'>" + strongs_pre + v.w[w].s + "</span>" + v.w[w].t.trim() + "</a>"+sp;
} }
else else