Skip to content

Commit

Permalink
Url Accepts MT Book Number
Browse files Browse the repository at this point in the history
The URL will now accept the MT book number, as well as the SBL abbreviation.
  • Loading branch information
DavidTroidl committed Aug 1, 2020
1 parent b7ad61c commit d524b9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions structure/OshbVerse/Script/ReferenceLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ refLocation = function() {
results;
if (url.length > 75) {return parts;} // Excessively long URL.
results = url.search.match(/b=(\w+)/);
if (results && results[1] && sblNames.indexOf(results[1]) >= 0) {
parts.book = results[1];
if (results && results[1]) {
if (sblNames.indexOf(results[1]) >= 0) {
parts.book = results[1];
} else {
mtNum = parseInt(results[1]);
if (mtNum > 0 && mtNum < 40) {
parts.book = sblNames[mtNum - 1];
} else {
return parts; // Unknown book number.
}
}
} else {
return parts; // Unknown book abbreviation.
}
Expand Down
4 changes: 3 additions & 1 deletion structure/OshbVerse/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Several new components have been added to facilitate the popup display, and
interpretation of the cantillation marks. Altogether, we have:

- ReferenceLocation.js (Added 8/2/2019) manages URL locations, to
make and process the link.
make and process the link. Expanded 8/1/2020, to accept the MT book
number, as well as the SBL abbreviation, in the URL.

- AccentCatalog.js catalogs the accents by type and scope.

Expand Down Expand Up @@ -70,6 +71,7 @@ The OshbVerse demo is licensed under a
license. For attribution purposes, credit the Open Scriptures Hebrew Bible
Project.

Updated August 1, 2020
Updated August 2, 2019
Updated June 9, 2018
Updated June 22, 2017
Expand Down

0 comments on commit d524b9b

Please sign in to comment.