diff --git a/src/pages/notes/[...id].astro b/src/pages/notes/[...id].astro index f4fdcd1..d0bad52 100644 --- a/src/pages/notes/[...id].astro +++ b/src/pages/notes/[...id].astro @@ -61,6 +61,7 @@ const meta = `{ diff --git a/src/styles/global.css b/src/styles/global.css index f47d6d8..6ceee65 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -149,14 +149,14 @@ dialog.scripture { @apply mt-0 pl-14; } button[data-close] { - @apply absolute top-0 right-0 pr-2 pb-2 pt-2 text-sm text-gray-500 cursor-pointer hover:text-red-900; + @apply absolute top-0 right-0 pr-2 pb-4 pt-2 text-sm text-gray-500 cursor-pointer hover:text-red-900; @apply dark:text-gray-400 dark:hover:text-red-500; span { text-transform: uppercase; } } h1 { - @apply font-bold mb-2 text-2xl; + @apply font-bold mb-2 mt-0 text-2xl; @apply dark:text-neutral-300; } nav { diff --git a/src/utils/meta.js b/src/utils/meta.js index 2ba184c..77a40ed 100644 --- a/src/utils/meta.js +++ b/src/utils/meta.js @@ -2,6 +2,9 @@ export const aliases = {"genesis": "gen", "gn": "gen", "exodus": "exo", "ex": "exo", "leviticus": "lev", "lv": "lev", "numbers": "num", "nm": "num", "numb": "num", "nmb": "num", "nmbs": "num", "deuteronomy": "deu", "dt": "deu", "deut": "deu", "deuter": "deu", "joshua": "jos", "js": "jos", "josh": "jos", "judges": "jdg", "jd": "jdg", "jdgs": "jdg", "ruth": "rut", "rt": "rut", "1 samuel": "1sa", "1s": "1sa", "1sam": "1sa", "1 s": "1sa", "1 sa": "1sa", "1 sam": "1sa", "1 kingdoms": "1sa", "1 realms": "1sa", "2 samuel": "2sa", "2s": "2sa", "2sam": "2sa", "2 s": "2sa", "2 sa": "2sa", "2 sam": "2sa", "2 kingdoms": "2sa", "2 realms": "2sa", "1 kings": "1ki", "1k": "1ki", "1kgs": "1ki", "1king": "1ki", "1 k": "1ki", "1 ki": "1ki", "1 kgs": "1ki", "1 king": "1ki", "3k": "1ki", "3kgs": "1ki", "3king": "1ki", "3 k": "1ki", "3 ki": "1ki", "3 kgs": "1ki", "3 king": "1ki", "3 kingdoms": "1ki", "3 realms": "1ki", "2 kings": "2ki", "2k": "2ki", "2kgs": "2ki", "2king": "2ki", "2 k": "2ki", "2 ki": "2ki", "2 kgs": "2ki", "2 king": "2ki", "4k": "2ki", "4kgs": "2ki", "4king": "2ki", "4 k": "2ki", "4 ki": "2ki", "4 kgs": "2ki", "4 king": "2ki", "4 kingdoms": "2ki", "4 realms": "2ki", "1 chronicles": "1ch", "1c": "1ch", "1chr": "1ch", "1chron": "1ch", "1 c": "1ch", "1 ch": "1ch", "1 chr": "1ch", "1 chron": "1ch", "2 chronicles": "2ch", "2c": "2ch", "2chr": "2ch", "2chron": "2ch", "2 c": "2ch", "2 ch": "2ch", "2 chr": "2ch", "2 chron": "2ch", "ezra": "ezr", "ez": "ezr", "nehemiah": "neh", "nh": "neh", "esther": "est", "es": "est", "job": "job", "jb": "job", "psalms": "psa", "ps": "psa", "psalm": "psa", "pss": "psa", "proverbs": "pro", "pr": "pro", "prov": "pro", "ecclesiastes": "ecc", "ec": "ecc", "eccl": "ecc", "eccle": "ecc", "song of solomon": "sng", "song of songs": "sng", "sn": "sng", "son": "sng", "song": "sng", "sol": "sng", "isaiah": "isa", "is": "isa", "isai": "isa", "jeremiah": "jer", "jr": "jer", "jere": "jer", "jerem": "jer", "lamentations": "lam", "lm": "lam", "lamen": "lam", "ezekiel": "ezk", "eze": "ezk", "ezek": "ezk", "daniel": "dan", "dn": "dan", "hosea": "hos", "hs": "hos", "joel": "jol", "jl": "jol", "amos": "amo", "am": "amo", "obadiah": "oba", "ob": "oba", "obd": "oba", "obad": "oba", "jonah": "jon", "jo": "jon", "micah": "mic", "micha": "mic", "mc": "mic", "nahum": "nam", "na": "nam", "habakkuk": "hab", "hb": "hab", "haba": "hab", "habak": "hab", "zephaniah": "zep", "zf": "zep", "zef": "zep", "haggai": "hag", "hg": "hag", "zechariah": "zec", "ze": "zec", "zech": "zec", "malachi": "mal", "ml": "mal", "mala": "mal", "matthew": "mat", "mt": "mat", "matt": "mat", "mark": "mrk", "mk": "mrk", "luke": "luk", "lk": "luk", "john": "jhn", "jn": "jhn", "acts": "act", "ac": "act", "romans": "rom", "rm": "rom", "rms": "rom", "1 corinthians": "1co", "1cor": "1co", "1corin": "1co", "1 co": "1co", "1 cor": "1co", "1 corin": "1co", "2 corinthians": "2co", "2cor": "2co", "2corin": "2co", "2 co": "2co", "2 cor": "2co", "2 corin": "2co", "galatians": "gal", "gl": "gal", "ephesians": "eph", "ep": "eph", "ef": "eph", "philippians": "php", "ph": "php", "phil": "php", "colossians": "col", "cl": "col", "colo": "col", "1 thessalonians": "1th", "1thes": "1th", "1thess": "1th", "1 thes": "1th", "1 thess": "1th", "2 thessalonians": "2th", "2thes": "2th", "2thess": "2th", "2 thes": "2th", "2 thess": "2th", "1 timothy": "1ti", "1tim": "1ti", "1 ti": "1ti", "1 tim": "1ti", "2 timothy": "2ti", "2tim": "2ti", "2 ti": "2ti", "2 tim": "2ti", "titus": "tit", "ti": "tit", "philemon": "phm", "pi": "phm", "philm": "phm", "philem": "phm", "hebrews": "heb", "he": "heb", "james": "jas", "ja": "jas", "jam": "jas", "1 peter": "1pe", "1p": "1pe", "1pt": "1pe", "1pet": "1pe", "1 p": "1pe", "1 pe": "1pe", "1 pt": "1pe", "1 pet": "1pe", "2 peter": "2pe", "2p": "2pe", "2pt": "2pe", "2pet": "2pe", "2 p": "2pe", "2 pe": "2pe", "2 pt": "2pe", "2 pet": "2pe", "1 john": "1jn", "1jon": "1jn", "1 jn": "1jn", "1 jon": "1jn", "2 john": "2jn", "2jon": "2jn", "2 jn": "2jn", "2 jon": "2jn", "3 john": "3jn", "3jon": "3jn", "3 jn": "3jn", "3 jon": "3jn", "jude": "jud", "ju": "jud", "revelation": "rev", "rv": "rev", "reve": "rev", "tobit": "tob", "tb": "tob", "judith": "jdt", "jt": "jdt", "wisdom": "wis", "wisdom of solomon": "wis", "ws": "wis", "wos": "wis", "sirach": "sir", "sr": "sir", "baruch": "bar", "br": "bar", "bel and the dragon": "bel", "bl": "bel", "bd": "bel", "batd": "bel", "susanna": "sus", "su": "sus", "1 maccabees": "1ma", "1mac": "1ma", "1 mac": "1ma", "2 maccabees": "2ma", "2mac": "2ma", "2 mac": "2ma", "3 maccabees": "3ma", "3mac": "3ma", "3 mac": "3ma", "4 maccabees": "4ma", "4mac": "4ma", "4 mac": "4ma", "1 esdras": "1es", "1esd": "1es", "1 esd": "1es", "epistle of jeremy": "lje", "ej": "lje", "eoj": "lje", "prayer of ezarias": "s3y", "az": "s3y", "poe": "s3y", "prayer of manasses": "man", "prayer of manasseh": "man", "mana": "man", "pom": "man", "gen": "gen", "exo": "exo", "lev": "lev", "num": "num", "deu": "deu", "jos": "jos", "jdg": "jdg", "rut": "rut", "1sa": "1sa", "2sa": "2sa", "1ki": "1ki", "2ki": "2ki", "1ch": "1ch", "2ch": "2ch", "ezr": "ezr", "neh": "neh", "est": "est", "psa": "psa", "pro": "pro", "ecc": "ecc", "sng": "sng", "isa": "isa", "jer": "jer", "lam": "lam", "ezk": "ezk", "dan": "dan", "hos": "hos", "jol": "jol", "amo": "amo", "oba": "oba", "jon": "jon", "mic": "mic", "nam": "nam", "hab": "hab", "zep": "zep", "hag": "hag", "zec": "zec", "mal": "mal", "mat": "mat", "mrk": "mrk", "luk": "luk", "jhn": "jhn", "act": "act", "rom": "rom", "1co": "1co", "2co": "2co", "gal": "gal", "eph": "eph", "php": "php", "col": "col", "1th": "1th", "2th": "2th", "1ti": "1ti", "2ti": "2ti", "tit": "tit", "phm": "phm", "heb": "heb", "jas": "jas", "1pe": "1pe", "2pe": "2pe", "1jn": "1jn", "2jn": "2jn", "3jn": "3jn", "jud": "jud", "rev": "rev", "tob": "tob", "jdt": "jdt", "wis": "wis", "sir": "sir", "bar": "bar", "bel": "bel", "sus": "sus", "1ma": "1ma", "2ma": "2ma", "3ma": "3ma", "4ma": "4ma", "1es": "1es", "lje": "lje", "s3y": "s3y", "man": "man"}; -export const translations = ["AAB", "BSB", "ENGWEBP", "GHT", "eng_abt", "eng_asv", "eng_boy", "eng_bre", "eng_emtv", "eng_fbv", "eng_glw", "eng_kja", "eng_kjv", "eng_lsv", "eng_lxx", "eng_msb", "eng_net", "eng_pev", "eng_rv5", "eng_t4t", "eng_tce", "eng_ulb", "eng_w88", "eng_wbs", "eng_web", "eng_webu", "eng_wyc2017", "eng_wyc2018", "eng_ylt"]; +export const translations = {"BSB": ["Berean Standard Bible", "BSB", ["OT", "NT"]], "eng_msb": ["Majority Standard Bible", "MSB", ["NT"]], "eng_lsv": ["Literal Standard Version", "LSV", ["OT", "NT"]], "eng_net": ["NET Bible", "NETB", ["OT", "NT"]], "eng_asv": ["American Standard Version (1901)", "ASV", ["OT", "NT"]], "eng_abt": ["American Standard Version Byzantine Text", "ASVBT", ["OT", "NT"]], "eng_kjv": ["King James (Authorized) Version", "KJAV", ["OT", "NT"]], "eng_kja": ["King James Version + Apocrypha", "KJVA", ["OT", "NT", "APO"]], "eng_rv5": ["Revised Version with Apocrypha (1895)", "RVA", ["OT", "NT", "APO"]], "eng_ylt": ["Young's Literal Translation", "YLT", ["OT", "NT"]], "AAB": ["Accessible Ancients Bible", "AAB", ["OT", "NT"]], "eng_fbv": ["Free Bible Version", "FBV", ["OT", "NT"]], "eng_wbs": ["Noah Webster Bible", "NWB", ["OT", "NT"]], "eng_ulb": ["Unlocked Literal Bible", "ULB", ["OT", "NT"]], "ENGWEBP": ["World English Bible", "WEB", ["OT", "NT"]], "eng_web": ["World English Bible Classic", "WEBC", ["OT", "NT"]], "eng_webu": ["World English Bible Updated", "WEBU", ["OT", "NT"]], "eng_lxx": ["Septuagint in American English (2012)", "LXXSA", ["OT", "APO"]], "eng_bre": ["Brenton Septuagint Translation", "BST", ["OT", "APO"]], "eng_boy": ["Updated Brenton English Septuagint", "UBES", ["OT", "APO"]]}; + +export const meta = {"gen": {"tx": "BSB", "ts": "OT", "title": "Genesis"}, "exo": {"tx": "BSB", "ts": "OT", "title": "Exodus"}, "lev": {"tx": "BSB", "ts": "OT", "title": "Leviticus"}, "num": {"tx": "BSB", "ts": "OT", "title": "Numbers"}, "deu": {"tx": "BSB", "ts": "OT", "title": "Deuteronomy"}, "jos": {"tx": "BSB", "ts": "OT", "title": "Joshua"}, "jdg": {"tx": "BSB", "ts": "OT", "title": "Judges"}, "rut": {"tx": "BSB", "ts": "OT", "title": "Ruth"}, "1sa": {"tx": "BSB", "ts": "OT", "title": "1 Samuel"}, "2sa": {"tx": "BSB", "ts": "OT", "title": "2 Samuel"}, "1ki": {"tx": "BSB", "ts": "OT", "title": "1 Kings"}, "2ki": {"tx": "BSB", "ts": "OT", "title": "2 Kings"}, "1ch": {"tx": "BSB", "ts": "OT", "title": "1 Chronicles"}, "2ch": {"tx": "BSB", "ts": "OT", "title": "2 Chronicles"}, "ezr": {"tx": "BSB", "ts": "OT", "title": "Ezra"}, "neh": {"tx": "BSB", "ts": "OT", "title": "Nehemiah"}, "est": {"tx": "BSB", "ts": "OT", "title": "Esther"}, "job": {"tx": "BSB", "ts": "OT", "title": "Job"}, "psa": {"tx": "BSB", "ts": "OT", "title": "Psalms"}, "pro": {"tx": "BSB", "ts": "OT", "title": "Proverbs"}, "ecc": {"tx": "BSB", "ts": "OT", "title": "Ecclesiastes"}, "sng": {"tx": "BSB", "ts": "OT", "title": "Song of Solomon"}, "isa": {"tx": "BSB", "ts": "OT", "title": "Isaiah"}, "jer": {"tx": "BSB", "ts": "OT", "title": "Jeremiah"}, "lam": {"tx": "BSB", "ts": "OT", "title": "Lamentations"}, "ezk": {"tx": "BSB", "ts": "OT", "title": "Ezekiel"}, "dan": {"tx": "BSB", "ts": "OT", "title": "Daniel"}, "hos": {"tx": "BSB", "ts": "OT", "title": "Hosea"}, "jol": {"tx": "BSB", "ts": "OT", "title": "Joel"}, "amo": {"tx": "BSB", "ts": "OT", "title": "Amos"}, "oba": {"tx": "BSB", "ts": "OT", "title": "Obadiah"}, "jon": {"tx": "BSB", "ts": "OT", "title": "Jonah"}, "mic": {"tx": "BSB", "ts": "OT", "title": "Micah"}, "nam": {"tx": "BSB", "ts": "OT", "title": "Nahum"}, "hab": {"tx": "BSB", "ts": "OT", "title": "Habakkuk"}, "zep": {"tx": "BSB", "ts": "OT", "title": "Zephaniah"}, "hag": {"tx": "BSB", "ts": "OT", "title": "Haggai"}, "zec": {"tx": "BSB", "ts": "OT", "title": "Zechariah"}, "mal": {"tx": "BSB", "ts": "OT", "title": "Malachi"}, "mat": {"tx": "BSB", "ts": "NT", "title": "Matthew"}, "mrk": {"tx": "BSB", "ts": "NT", "title": "Mark"}, "luk": {"tx": "BSB", "ts": "NT", "title": "Luke"}, "jhn": {"tx": "BSB", "ts": "NT", "title": "John"}, "act": {"tx": "BSB", "ts": "NT", "title": "Acts"}, "rom": {"tx": "BSB", "ts": "NT", "title": "Romans"}, "1co": {"tx": "BSB", "ts": "NT", "title": "1 Corinthians"}, "2co": {"tx": "BSB", "ts": "NT", "title": "2 Corinthians"}, "gal": {"tx": "BSB", "ts": "NT", "title": "Galatians"}, "eph": {"tx": "BSB", "ts": "NT", "title": "Ephesians"}, "php": {"tx": "BSB", "ts": "NT", "title": "Philippians"}, "col": {"tx": "BSB", "ts": "NT", "title": "Colossians"}, "1th": {"tx": "BSB", "ts": "NT", "title": "1 Thessalonians"}, "2th": {"tx": "BSB", "ts": "NT", "title": "2 Thessalonians"}, "1ti": {"tx": "BSB", "ts": "NT", "title": "1 Timothy"}, "2ti": {"tx": "BSB", "ts": "NT", "title": "2 Timothy"}, "tit": {"tx": "BSB", "ts": "NT", "title": "Titus"}, "phm": {"tx": "BSB", "ts": "NT", "title": "Philemon"}, "heb": {"tx": "BSB", "ts": "NT", "title": "Hebrews"}, "jas": {"tx": "BSB", "ts": "NT", "title": "James"}, "1pe": {"tx": "BSB", "ts": "NT", "title": "1 Peter"}, "2pe": {"tx": "BSB", "ts": "NT", "title": "2 Peter"}, "1jn": {"tx": "BSB", "ts": "NT", "title": "1 John"}, "2jn": {"tx": "BSB", "ts": "NT", "title": "2 John"}, "3jn": {"tx": "BSB", "ts": "NT", "title": "3 John"}, "jud": {"tx": "BSB", "ts": "NT", "title": "Jude"}, "rev": {"tx": "BSB", "ts": "NT", "title": "Revelation"}, "tob": {"tx": "eng_lxx", "ts": "APO", "title": "Tobit"}, "jdt": {"tx": "eng_lxx", "ts": "APO", "title": "Judith"}, "wis": {"tx": "eng_lxx", "ts": "APO", "title": "Wisdom"}, "sir": {"tx": "eng_lxx", "ts": "APO", "title": "Sirach"}, "bar": {"tx": "eng_lxx", "ts": "APO", "title": "Baruch"}, "bel": {"tx": "eng_lxx", "ts": "APO", "title": "Bel and the Dragon"}, "sus": {"tx": "eng_lxx", "ts": "APO", "title": "Susanna"}, "1ma": {"tx": "eng_lxx", "ts": "APO", "title": "1 Maccabees"}, "2ma": {"tx": "eng_lxx", "ts": "APO", "title": "2 Maccabees"}, "3ma": {"tx": "eng_lxx", "ts": "APO", "title": "3 Maccabees"}, "4ma": {"tx": "eng_lxx", "ts": "APO", "title": "4 Maccabees"}, "1es": {"tx": "eng_lxx", "ts": "APO", "title": "1 Esdras"}, "lje": {"tx": "eng_lxx", "ts": "APO", "title": "Epistle of Jeremy"}, "s3y": {"tx": "eng_lxx", "ts": "APO", "title": "Prayer of Ezarias"}, "man": {"tx": "eng_lxx", "ts": "APO", "title": "Prayer of Manasses"}}; + +export const defaulttx = {"OT": "BSB", "NT": "BSB", "APO": "eng_kja", "LXX": "eng_lxx"}; -export const meta = {"gen": {"tx": "BSB", "title": "Genesis"}, "exo": {"tx": "BSB", "title": "Exodus"}, "lev": {"tx": "BSB", "title": "Leviticus"}, "num": {"tx": "BSB", "title": "Numbers"}, "deu": {"tx": "BSB", "title": "Deuteronomy"}, "jos": {"tx": "BSB", "title": "Joshua"}, "jdg": {"tx": "BSB", "title": "Judges"}, "rut": {"tx": "BSB", "title": "Ruth"}, "1sa": {"tx": "BSB", "title": "1 Samuel"}, "2sa": {"tx": "BSB", "title": "2 Samuel"}, "1ki": {"tx": "BSB", "title": "1 Kings"}, "2ki": {"tx": "BSB", "title": "2 Kings"}, "1ch": {"tx": "BSB", "title": "1 Chronicles"}, "2ch": {"tx": "BSB", "title": "2 Chronicles"}, "ezr": {"tx": "BSB", "title": "Ezra"}, "neh": {"tx": "BSB", "title": "Nehemiah"}, "est": {"tx": "BSB", "title": "Esther"}, "job": {"tx": "BSB", "title": "Job"}, "psa": {"tx": "BSB", "title": "Psalms"}, "pro": {"tx": "BSB", "title": "Proverbs"}, "ecc": {"tx": "BSB", "title": "Ecclesiastes"}, "sng": {"tx": "BSB", "title": "Song of Solomon"}, "isa": {"tx": "BSB", "title": "Isaiah"}, "jer": {"tx": "BSB", "title": "Jeremiah"}, "lam": {"tx": "BSB", "title": "Lamentations"}, "ezk": {"tx": "BSB", "title": "Ezekiel"}, "dan": {"tx": "BSB", "title": "Daniel"}, "hos": {"tx": "BSB", "title": "Hosea"}, "jol": {"tx": "BSB", "title": "Joel"}, "amo": {"tx": "BSB", "title": "Amos"}, "oba": {"tx": "BSB", "title": "Obadiah"}, "jon": {"tx": "BSB", "title": "Jonah"}, "mic": {"tx": "BSB", "title": "Micah"}, "nam": {"tx": "BSB", "title": "Nahum"}, "hab": {"tx": "BSB", "title": "Habakkuk"}, "zep": {"tx": "BSB", "title": "Zephaniah"}, "hag": {"tx": "BSB", "title": "Haggai"}, "zec": {"tx": "BSB", "title": "Zechariah"}, "mal": {"tx": "BSB", "title": "Malachi"}, "mat": {"tx": "BSB", "title": "Matthew"}, "mrk": {"tx": "BSB", "title": "Mark"}, "luk": {"tx": "BSB", "title": "Luke"}, "jhn": {"tx": "BSB", "title": "John"}, "act": {"tx": "BSB", "title": "Acts"}, "rom": {"tx": "BSB", "title": "Romans"}, "1co": {"tx": "BSB", "title": "1 Corinthians"}, "2co": {"tx": "BSB", "title": "2 Corinthians"}, "gal": {"tx": "BSB", "title": "Galatians"}, "eph": {"tx": "BSB", "title": "Ephesians"}, "php": {"tx": "BSB", "title": "Philippians"}, "col": {"tx": "BSB", "title": "Colossians"}, "1th": {"tx": "BSB", "title": "1 Thessalonians"}, "2th": {"tx": "BSB", "title": "2 Thessalonians"}, "1ti": {"tx": "BSB", "title": "1 Timothy"}, "2ti": {"tx": "BSB", "title": "2 Timothy"}, "tit": {"tx": "BSB", "title": "Titus"}, "phm": {"tx": "BSB", "title": "Philemon"}, "heb": {"tx": "BSB", "title": "Hebrews"}, "jas": {"tx": "BSB", "title": "James"}, "1pe": {"tx": "BSB", "title": "1 Peter"}, "2pe": {"tx": "BSB", "title": "2 Peter"}, "1jn": {"tx": "BSB", "title": "1 John"}, "2jn": {"tx": "BSB", "title": "2 John"}, "3jn": {"tx": "BSB", "title": "3 John"}, "jud": {"tx": "BSB", "title": "Jude"}, "rev": {"tx": "BSB", "title": "Revelation"}, "tob": {"tx": "eng_lxx", "title": "Tobit"}, "jdt": {"tx": "eng_lxx", "title": "Judith"}, "wis": {"tx": "eng_lxx", "title": "Wisdom"}, "sir": {"tx": "eng_lxx", "title": "Sirach"}, "bar": {"tx": "eng_lxx", "title": "Baruch"}, "bel": {"tx": "eng_lxx", "title": "Bel and the Dragon"}, "sus": {"tx": "eng_lxx", "title": "Susanna"}, "1ma": {"tx": "eng_lxx", "title": "1 Maccabees"}, "2ma": {"tx": "eng_lxx", "title": "2 Maccabees"}, "3ma": {"tx": "eng_lxx", "title": "3 Maccabees"}, "4ma": {"tx": "eng_lxx", "title": "4 Maccabees"}, "1es": {"tx": "eng_lxx", "title": "1 Esdras"}, "lje": {"tx": "eng_lxx", "title": "Epistle of Jeremy"}, "s3y": {"tx": "eng_lxx", "title": "Prayer of Ezarias"}, "man": {"tx": "eng_lxx", "title": "Prayer of Manasses"}}; diff --git a/src/utils/modal.js b/src/utils/modal.js index 3a77d66..d0bc9db 100644 --- a/src/utils/modal.js +++ b/src/utils/modal.js @@ -1,15 +1,10 @@ -import { aliases, meta } from './meta.js'; - +import { aliases, defaulttx, meta, translations } from './meta.js'; +import { hasLocalStorage } from './utils.js'; export const modal = (el) => { }; -const translations = { - 'BSB': 'Berean Standard Bible', - 'MSB': 'Majority Standard Bible', -}; - function parseRef(ref) { ref = ref.replace(/%3[Aa]/, ':').replace(/\+/, ' '); const m = ref.match(/((\d+(\+|\s))?[a-zA-Z]+)(\+|\s)?([0-9]+)?\:?([0-9]+(-?[0-9]+)?)?/); @@ -75,125 +70,216 @@ function parseRef(ref) { return refdata; } -function render(dialog, response, refs) { - const content = response?.chapter?.content; - let inSpan = false; +class RenderScripture { + translation = 'BSB'; + dialog = null; + sel = null; + ls = false; + ref = {}; - if (dialog === null || dialog === undefined) { - return; - } + constructor(dialog) { + this.dialog = dialog; - const section = document.createElement('section'); - const article = dialog?.querySelector('article'); - let para = document.createElement('p'); - - const heading = document.createElement('h1'); - heading.insertAdjacentText('beforeend', - `${refs.fullTitle()}`); - article.insertAdjacentElement('beforeend', heading); - - for (const c of content) { - if (c.type === 'heading') { - continue; + if (hasLocalStorage()) { + this.ls = true; + this.translation = localStorage.getItem('__translation') || 'BSB'; } - let verse = document.createElement('span'); + const elems = document.querySelectorAll('a[data-scripture]'); + elems.forEach((e) => { + e.addEventListener('click', (evt) => { + this.anchorClick(evt) + }); + }); + const sel = this.dialog[0]?.querySelector('select.translation'); + sel?.addEventListener('change', (evt) => { + this.txnOnChange(evt) + }); + this.sel = sel; - switch (c.type) { - case 'line_break': - if (inSpan) { - section.insertAdjacentElement('beforeend', para); - para = document.createElement('p'); + this.dialog[0]?.addEventListener('click', (evt) => { + if (evt.target === this.dialog[0]) { + this.closeDialog() } - break; - case 'verse': - if (!('number' in c)) { + }); + this.dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => { + evt.preventDefault(); + this.closeDialog(); + }); + + } + + anchorClick(evt) { + const scripture = evt.target.attributes.getNamedItem('data-scripture'); + const refs = parseRef(scripture.value); + const tx = refs.meta?.tx || 'BSB'; + this.ref = refs; + evt.preventDefault(); + this.dialog[0]?.showModal(); + this.dialog[0]?.setAttribute('data-scripture', scripture.value); + this.dialog[0]?.classList.remove("hidden"); + this.dialog[0]?.querySelector('.spinner svg') + .classList.remove('hidden'); + this.buildTranslationList(this.sel); + this.readScripture(refs); + } + + buildTranslationList(sel) { + sel?.replaceChildren(); + for (const tx in translations) { + const testament = meta[this.ref.book].ts; + if (translations[tx][2].indexOf(testament) == -1) { continue; } - if (!('verses' in refs) || (c.number >= refs.verses.start && c.number <= refs.verses.end)) { - inSpan = true; - } else { - inSpan = false; + const opt = document.createElement('option'); + opt.setAttribute('value', tx); + opt.insertAdjacentText('beforeend', translations[tx][0]); + if (tx == this.translation) { + opt.setAttribute('selected', 'selected'); } - if (inSpan) { - verse.insertAdjacentText('beforeend', c.number); - verse.classList.add('verse'); - para.insertAdjacentElement('beforeend', verse); - verse = document.createElement('span'); - for (const v of c.content) { - if (typeof(v) === 'string') { - para.insertAdjacentText('beforeend', v+' '); - continue - } - if ('lineBreak' in v) { - if (para.innerHTML.length != 0 || para.innerText.length != 0) { - section.insertAdjacentElement('beforeend', para); - para = document.createElement('p'); + sel?.insertAdjacentElement('beforeend', opt); + } + } + + closeDialog() { + this.dialog[0]?.close(); + this.dialog[0]?.classList.add('hidden'); + this.dialog[0]?.querySelector('article')?.replaceChildren(); + } + + txnOnChange(evt) { + const tx = evt.target.selectedOptions[0].value; + this.translation = tx; + if (this.ls) { + localStorage.setItem('__translation', tx); + } + const refs = parseRef(this.dialog[0]?.getAttribute('data-scripture')); + this.dialog[0]?.querySelector('article')?.replaceChildren(); + this.dialog[0]?.querySelector('.spinner svg') + .classList.remove('hidden'); + this.readScripture(refs); + } + + readScripture(refs) { + // Current translation. + let tx = this.translation; + // Previous translation. + const px = this.translation; + + const book = refs.book; + const chapter = refs.chapter; + const testament = meta[book].ts; + + // If the current translation doesn't contain the testament, switch to + // the default translation that does. + if (translations[tx][2].indexOf(testament) == -1) { + tx = defaulttx[testament]; + this.translation = tx; + } + + const uri = `https://bible.helloao.org/api/${tx}/${book.toUpperCase()}/${chapter}.json`; + fetch(uri) + .then((response) => { + if (!response.ok) { + console.error('query failed'); + console.log(response); + return; + } + return response.json(); + }) + .then((response) => { + this.render(response, refs); + this.dialog[0]?.querySelector('.spinner svg') + .classList.add('hidden'); + // Switch translation back if it's forced to a different + // translation from book availability. + if (this.translation != px) { + this.translation = px; + } + }); + } + + render(response, refs) { + const content = response?.chapter?.content; + let inSpan = false; + + if (this.dialog === null || this.dialog === undefined) { + return; + } + + const section = document.createElement('section'); + const article = this.dialog[0]?.querySelector('article'); + let para = document.createElement('p'); + + const heading = document.createElement('h1'); + heading.insertAdjacentText('beforeend', + `${refs.fullTitle()}`); + article.insertAdjacentElement('beforeend', heading); + + for (const c of content) { + if (c.type === 'heading') { + continue; + } + + let verse = document.createElement('span'); + + switch (c.type) { + case 'line_break': + if (inSpan) { + section.insertAdjacentElement('beforeend', para); + para = document.createElement('p'); + } + break; + case 'verse': + if (!('number' in c)) { + continue; + } + if (!('verses' in refs) || (c.number >= refs.verses.start && c.number <= refs.verses.end)) { + inSpan = true; + } else { + inSpan = false; + } + if (inSpan) { + verse.insertAdjacentText('beforeend', c.number); + verse.classList.add('verse'); + para.insertAdjacentElement('beforeend', verse); + verse = document.createElement('span'); + for (const v of c.content) { + if (typeof(v) === 'string') { + para.insertAdjacentText('beforeend', v+' '); + continue } - //para.insertAdjacentElement('beforeend', document.createElement('br')); - //para = document.createElement('p'); - } - if ('text' in v) { - para.insertAdjacentText('beforeend', v.text); - if ('poem' in v) { - para.classList.add('poem-'+v.poem); + if ('lineBreak' in v) { if (para.innerHTML.length != 0 || para.innerText.length != 0) { - section.insertAdjacentElement('beforeend', - para); + section.insertAdjacentElement('beforeend', para); + para = document.createElement('p'); + } + } + if ('text' in v) { + para.insertAdjacentText('beforeend', v.text); + if ('poem' in v) { + para.classList.add('poem-'+v.poem); + if (para.innerHTML.length != 0 || para.innerText.length != 0) { + section.insertAdjacentElement('beforeend', + para); + } + para = document.createElement('p'); } - para = document.createElement('p'); } } } + break; + default: + console.error('unhandled type:', c.type); } - break; - default: - console.error('unhandled type:', c.type); } - //console.log(c); + section.insertAdjacentElement('beforeend', para); + article.insertAdjacentElement('beforeend', section); } - section.insertAdjacentElement('beforeend', para); - article.insertAdjacentElement('beforeend', section); } export const bindModals = () => { const elems = document.querySelectorAll('a[data-scripture]'); const dialog = document.querySelectorAll('dialog[data-scripture]'); - elems.forEach((e) => { - e.addEventListener('click', (evt) => { - const scripture = e.attributes.getNamedItem('data-scripture'); - const refs = parseRef(scripture.value); - const tx = refs.meta?.tx || 'BSB'; - evt.preventDefault(); - const uri = `https://bible.helloao.org/api/${tx}/${refs.book.toUpperCase()}/${refs.chapter}.json`; - dialog[0]?.showModal(); - dialog[0]?.setAttribute('data-scripture', scripture); - dialog[0]?.classList.remove("hidden"); - dialog[0]?.querySelector('.spinner svg') - .classList.remove('hidden'); - - fetch(uri) - .then((response) => { - return response.json(); - }) - .then((response) => { - render(dialog[0], response, refs); - dialog[0]?.querySelector('.spinner svg') - .classList.add('hidden'); - }); - }); - }); - dialog[0]?.addEventListener('click', (evt) => { - if (evt.target === dialog[0]) { - dialog[0]?.close(); - dialog[0]?.classList.add('hidden'); - dialog[0]?.querySelector('article')?.replaceChildren(); - } - }); - dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => { - evt.preventDefault(); - dialog[0]?.close(); - dialog[0]?.classList.add('hidden'); - dialog[0]?.querySelector('article')?.replaceChildren(); - }); + const renderer = new RenderScripture(dialog); }; \ No newline at end of file diff --git a/src/utils/utils.js b/src/utils/utils.js new file mode 100644 index 0000000..b899baa --- /dev/null +++ b/src/utils/utils.js @@ -0,0 +1,16 @@ +export const hasLocalStorage = () => { + try { + var ls = localStorage; + var key = "__test"; + ls.setItem(key, key); + ls.removeItem(key); + return true; + } catch (e) { + return ( + e instanceof DOMException && + e.name === "QuotaExceededError" && + localStorage && + localStorage.length !== 0 + ); + } +} \ No newline at end of file diff --git a/tools/genbooks.py b/tools/genbooks.py index c914748..417744c 100644 --- a/tools/genbooks.py +++ b/tools/genbooks.py @@ -475,126 +475,139 @@ aliases = {i.lower(): k for k, v in alias_map.items() for i in v} for k in alias_map.keys(): aliases[k] = k -use_translations = [ - "AAB", # Accessible Ancients Bible AAB - "BSB", # Berean Standard Bible BSB - "ENGWEBP", # World English Bible WEB - "GHT", # Garth's Hyper-literal Translation GHT - "eng_abt", # American Standard Version Byzantine Text ASVBT - "eng_asv", # American Standard Version (1901) ASV - #"eng_bbe", # Bible in Basic English BBE - "eng_boy", # Updated Brenton English Septuagint UBES - "eng_bre", # Brenton Septuagint Translation BST - "eng_emtv", # English Majority Text Version EMTV - #"eng_f35", # The New Testament with Commentary TNTC - "eng_fbv", # Free Bible Version FBV - "eng_glw", # God's Living Word GLW - #"eng_gnv", # Geneva Bible 1599 GNV - "eng_kja", # King James Version + Apocrypha KJVA - "eng_kjv", # King James (Authorized) Version KJAV - "eng_lsv", # Literal Standard Version LSV - "eng_lxx", # LXX2012: Septuagint in American English 2012 LXXSA - "eng_msb", # Majority Standard Bible MSB - "eng_net", # NET Bible NETB - "eng_pev", # Plain English Version PEV - "eng_rv5", # Revised Version with Apocrypha (1895) RVA - "eng_t4t", # Translation for Translators T4T - "eng_tce", # Text-Critical English New Testament TCENT - #"eng_tnt", # Tyndale New Testament TNT - "eng_ulb", # Unlocked Literal Bible ULB - "eng_w88", # Wycliffe Bible W88 - "eng_wbs", # Noah Webster Bible NWB - "eng_web", # World English Bible Classic WEBC - "eng_webu", # World English Bible Updated WEBU - "eng_wyc2017", # Wycliffe's Bible with Modern Spelling WBMS - "eng_wyc2018", # Wycliffe's Bible with Modern Spelling (Enhanced) WBMSE - "eng_ylt", # Young's Literal Translation YLT -] +shorthand_defaults = { + "OT": "BSB", + "NT": "BSB", + "APO": "eng_kja", + "LXX": "eng_lxx", +} + +use_translations = { + "BSB": ["Berean Standard Bible", "BSB", ["OT", "NT"]], + "eng_msb": ["Majority Standard Bible", "MSB", ["NT"]], + "eng_lsv": ["Literal Standard Version", "LSV", ["OT", "NT"]], + "eng_net": ["NET Bible", "NETB", ["OT", "NT"]], + "eng_asv": ["American Standard Version (1901)", "ASV", ["OT", "NT"]], + "eng_abt": ["American Standard Version Byzantine Text", "ASVBT", ["OT", "NT"]], + "eng_kjv": ["King James (Authorized) Version", "KJAV", ["OT", "NT"]], + "eng_kja": ["King James Version + Apocrypha", "KJVA", ["OT", "NT", "APO"]], + "eng_rv5": ["Revised Version with Apocrypha (1895)", "RVA", ["OT", "NT", "APO"]], + "eng_ylt": ["Young's Literal Translation", "YLT", ["OT", "NT"]], + "AAB": ["Accessible Ancients Bible", "AAB", ["OT", "NT"]], + "eng_fbv": ["Free Bible Version", "FBV", ["OT", "NT"]], + "eng_wbs": ["Noah Webster Bible", "NWB", ["OT", "NT"]], + "eng_ulb": ["Unlocked Literal Bible", "ULB", ["OT", "NT"]], + "ENGWEBP": ["World English Bible", "WEB", ["OT", "NT"]], + "eng_web": ["World English Bible Classic", "WEBC", ["OT", "NT"]], + "eng_webu": ["World English Bible Updated", "WEBU", ["OT", "NT"]], + "eng_lxx": ["Septuagint in American English (2012)", "LXXSA", ["OT", "APO"]], + "eng_bre": ["Brenton Septuagint Translation", "BST", ["OT", "APO"]], + "eng_boy": ["Updated Brenton English Septuagint", "UBES", ["OT", "APO"]], + # Broken: Parser? + #"GHT": ["Garth's Hyper-literal Translation", "GHT"], + #"eng_bbe": ["Bible in Basic English BBE"], + # Broken: Parser? + #"eng_emtv": ["English Majority Text Version", "EMTV"], + #"eng_f35": ["The New Testament with Commentary TNTC"], + # Broken: Parser? + #"eng_glw": ["God's Living Word", "GLW"], + #"eng_gnv": ["Geneva Bible 1599 GNV"], + # Broken: Reads like heresy. + #"eng_pev": ["Plain English Version", "PEV"], + # Broken: Empty content. + #"eng_t4t": ["Translation for Translators", "T4T"], + # Broken: Parser? + #"eng_tce": ["Text-Critical English New Testament", "TCENT"], + #"eng_tnt": ["Tyndale New Testament TNT"], + #"eng_w88": ["Wycliffe Bible", "W88"], + #"eng_wyc2017": ["Wycliffe's Bible with Modern Spelling", "WBMS"], + #"eng_wyc2018": ["Wycliffe's Bible with Modern Spelling(Enhanced)", "WBMSE"], +} bookmeta = { - 'gen': {'tx': 'BSB'}, - 'exo': {'tx': 'BSB'}, - 'lev': {'tx': 'BSB'}, - 'num': {'tx': 'BSB'}, - 'deu': {'tx': 'BSB'}, - 'jos': {'tx': 'BSB'}, - 'jdg': {'tx': 'BSB'}, - 'rut': {'tx': 'BSB'}, - '1sa': {'tx': 'BSB'}, - '2sa': {'tx': 'BSB'}, - '1ki': {'tx': 'BSB'}, - '2ki': {'tx': 'BSB'}, - '1ch': {'tx': 'BSB'}, - '2ch': {'tx': 'BSB'}, - 'ezr': {'tx': 'BSB'}, - 'neh': {'tx': 'BSB'}, - 'est': {'tx': 'BSB'}, - 'job': {'tx': 'BSB'}, - 'psa': {'tx': 'BSB'}, - 'pro': {'tx': 'BSB'}, - 'ecc': {'tx': 'BSB'}, - 'sng': {'tx': 'BSB'}, - 'isa': {'tx': 'BSB'}, - 'jer': {'tx': 'BSB'}, - 'lam': {'tx': 'BSB'}, - 'ezk': {'tx': 'BSB'}, - 'dan': {'tx': 'BSB'}, - 'hos': {'tx': 'BSB'}, - 'jol': {'tx': 'BSB'}, - 'amo': {'tx': 'BSB'}, - 'oba': {'tx': 'BSB'}, - 'jon': {'tx': 'BSB'}, - 'mic': {'tx': 'BSB'}, - 'nam': {'tx': 'BSB'}, - 'hab': {'tx': 'BSB'}, - 'zep': {'tx': 'BSB'}, - 'hag': {'tx': 'BSB'}, - 'zec': {'tx': 'BSB'}, - 'mal': {'tx': 'BSB'}, - 'mat': {'tx': 'BSB'}, - 'mrk': {'tx': 'BSB'}, - 'luk': {'tx': 'BSB'}, - 'jhn': {'tx': 'BSB'}, - 'act': {'tx': 'BSB'}, - 'rom': {'tx': 'BSB'}, - '1co': {'tx': 'BSB'}, - '2co': {'tx': 'BSB'}, - 'gal': {'tx': 'BSB'}, - 'eph': {'tx': 'BSB'}, - 'php': {'tx': 'BSB'}, - 'col': {'tx': 'BSB'}, - '1th': {'tx': 'BSB'}, - '2th': {'tx': 'BSB'}, - '1ti': {'tx': 'BSB'}, - '2ti': {'tx': 'BSB'}, - 'tit': {'tx': 'BSB'}, - 'phm': {'tx': 'BSB'}, - 'heb': {'tx': 'BSB'}, - 'jas': {'tx': 'BSB'}, - '1pe': {'tx': 'BSB'}, - '2pe': {'tx': 'BSB'}, - '1jn': {'tx': 'BSB'}, - '2jn': {'tx': 'BSB'}, - '3jn': {'tx': 'BSB'}, - 'jud': {'tx': 'BSB'}, - 'rev': {'tx': 'BSB'}, + 'gen': {'tx': 'BSB', 'ts': 'OT'}, + 'exo': {'tx': 'BSB', 'ts': 'OT'}, + 'lev': {'tx': 'BSB', 'ts': 'OT'}, + 'num': {'tx': 'BSB', 'ts': 'OT'}, + 'deu': {'tx': 'BSB', 'ts': 'OT'}, + 'jos': {'tx': 'BSB', 'ts': 'OT'}, + 'jdg': {'tx': 'BSB', 'ts': 'OT'}, + 'rut': {'tx': 'BSB', 'ts': 'OT'}, + '1sa': {'tx': 'BSB', 'ts': 'OT'}, + '2sa': {'tx': 'BSB', 'ts': 'OT'}, + '1ki': {'tx': 'BSB', 'ts': 'OT'}, + '2ki': {'tx': 'BSB', 'ts': 'OT'}, + '1ch': {'tx': 'BSB', 'ts': 'OT'}, + '2ch': {'tx': 'BSB', 'ts': 'OT'}, + 'ezr': {'tx': 'BSB', 'ts': 'OT'}, + 'neh': {'tx': 'BSB', 'ts': 'OT'}, + 'est': {'tx': 'BSB', 'ts': 'OT'}, + 'job': {'tx': 'BSB', 'ts': 'OT'}, + 'psa': {'tx': 'BSB', 'ts': 'OT'}, + 'pro': {'tx': 'BSB', 'ts': 'OT'}, + 'ecc': {'tx': 'BSB', 'ts': 'OT'}, + 'sng': {'tx': 'BSB', 'ts': 'OT'}, + 'isa': {'tx': 'BSB', 'ts': 'OT'}, + 'jer': {'tx': 'BSB', 'ts': 'OT'}, + 'lam': {'tx': 'BSB', 'ts': 'OT'}, + 'ezk': {'tx': 'BSB', 'ts': 'OT'}, + 'dan': {'tx': 'BSB', 'ts': 'OT'}, + 'hos': {'tx': 'BSB', 'ts': 'OT'}, + 'jol': {'tx': 'BSB', 'ts': 'OT'}, + 'amo': {'tx': 'BSB', 'ts': 'OT'}, + 'oba': {'tx': 'BSB', 'ts': 'OT'}, + 'jon': {'tx': 'BSB', 'ts': 'OT'}, + 'mic': {'tx': 'BSB', 'ts': 'OT'}, + 'nam': {'tx': 'BSB', 'ts': 'OT'}, + 'hab': {'tx': 'BSB', 'ts': 'OT'}, + 'zep': {'tx': 'BSB', 'ts': 'OT'}, + 'hag': {'tx': 'BSB', 'ts': 'OT'}, + 'zec': {'tx': 'BSB', 'ts': 'OT'}, + 'mal': {'tx': 'BSB', 'ts': 'OT'}, + 'mat': {'tx': 'BSB', 'ts': 'NT'}, + 'mrk': {'tx': 'BSB', 'ts': 'NT'}, + 'luk': {'tx': 'BSB', 'ts': 'NT'}, + 'jhn': {'tx': 'BSB', 'ts': 'NT'}, + 'act': {'tx': 'BSB', 'ts': 'NT'}, + 'rom': {'tx': 'BSB', 'ts': 'NT'}, + '1co': {'tx': 'BSB', 'ts': 'NT'}, + '2co': {'tx': 'BSB', 'ts': 'NT'}, + 'gal': {'tx': 'BSB', 'ts': 'NT'}, + 'eph': {'tx': 'BSB', 'ts': 'NT'}, + 'php': {'tx': 'BSB', 'ts': 'NT'}, + 'col': {'tx': 'BSB', 'ts': 'NT'}, + '1th': {'tx': 'BSB', 'ts': 'NT'}, + '2th': {'tx': 'BSB', 'ts': 'NT'}, + '1ti': {'tx': 'BSB', 'ts': 'NT'}, + '2ti': {'tx': 'BSB', 'ts': 'NT'}, + 'tit': {'tx': 'BSB', 'ts': 'NT'}, + 'phm': {'tx': 'BSB', 'ts': 'NT'}, + 'heb': {'tx': 'BSB', 'ts': 'NT'}, + 'jas': {'tx': 'BSB', 'ts': 'NT'}, + '1pe': {'tx': 'BSB', 'ts': 'NT'}, + '2pe': {'tx': 'BSB', 'ts': 'NT'}, + '1jn': {'tx': 'BSB', 'ts': 'NT'}, + '2jn': {'tx': 'BSB', 'ts': 'NT'}, + '3jn': {'tx': 'BSB', 'ts': 'NT'}, + 'jud': {'tx': 'BSB', 'ts': 'NT'}, + 'rev': {'tx': 'BSB', 'ts': 'NT'}, # Apocrypha. - 'tob': {'tx': 'eng_lxx'}, - 'jdt': {'tx': 'eng_lxx'}, - 'wis': {'tx': 'eng_lxx'}, - 'sir': {'tx': 'eng_lxx'}, - 'bar': {'tx': 'eng_lxx'}, - 'bel': {'tx': 'eng_lxx'}, - 'sus': {'tx': 'eng_lxx'}, - '1ma': {'tx': 'eng_lxx'}, - '2ma': {'tx': 'eng_lxx'}, - '3ma': {'tx': 'eng_lxx'}, - '4ma': {'tx': 'eng_lxx'}, - '1es': {'tx': 'eng_lxx'}, + 'tob': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'jdt': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'wis': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'sir': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'bar': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'bel': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'sus': {'tx': 'eng_lxx', 'ts': 'APO'}, + '1ma': {'tx': 'eng_lxx', 'ts': 'APO'}, + '2ma': {'tx': 'eng_lxx', 'ts': 'APO'}, + '3ma': {'tx': 'eng_lxx', 'ts': 'APO'}, + '4ma': {'tx': 'eng_lxx', 'ts': 'APO'}, + '1es': {'tx': 'eng_lxx', 'ts': 'APO'}, # Not present in all LXX. - 'lje': {'tx': 'eng_lxx'}, - 's3y': {'tx': 'eng_lxx'}, - 'man': {'tx': 'eng_lxx'}, + 'lje': {'tx': 'eng_lxx', 'ts': 'APO'}, + 's3y': {'tx': 'eng_lxx', 'ts': 'APO'}, + 'man': {'tx': 'eng_lxx', 'ts': 'APO'}, } for k, v in bookmeta.items(): if k in alias_map: @@ -623,7 +636,8 @@ def write_meta(file="meta.js"): fp.write(b"// Translation meta\n\n") fp.write(f"export const aliases = {json.dumps(aliases)};\n\n".encode("utf8")) fp.write(f"export const translations = {json.dumps(use_translations)};\n\n".encode("utf8")) - fp.write(f"export const meta = {json.dumps(bookmeta)};\n".encode("utf8")) + fp.write(f"export const meta = {json.dumps(bookmeta)};\n\n".encode("utf8")) + fp.write(f"export const defaulttx = {json.dumps(shorthand_defaults)};\n\n".encode("utf8")) if __name__ == "__main__": pass