Remove non-TLS support
This commit is contained in:
1 parent
84c07a912b
commit
b59ef914da
9 files changed
+88
-171
No files matched your search
+14
-24
@@ -9,8 +9,7 @@
|
||||
//
|
||||
// GET / the book list
|
||||
// GET /:page one book -- /GEN, /EXO
|
||||
// GET /api/bookmark the navbar slot
|
||||
// POST /api/bookmark set the bookmark, and return the slot
|
||||
// POST /api/bookmark set the bookmark, and return the navbar slot
|
||||
// GET /api/reference the navbar's chapter and verse picker
|
||||
// GET /api/verse the dialog for one verse
|
||||
// GET /api/toast one confirmation, by name
|
||||
@@ -28,11 +27,9 @@
|
||||
// navigation -- one route, both callers, which is the whole reason the request
|
||||
// object carries `navigate`.
|
||||
//
|
||||
// The composing is in js/render.js, which boot.html can load too. Normally it
|
||||
// does not: boot.html registers this worker and reloads into it. It composes in
|
||||
// the page when no worker is possible at all -- no secure context, or a browser
|
||||
// without them -- and then it does so from these same templates rather than
|
||||
// leaving a spinner up forever.
|
||||
// The composing is in js/render.js. Every page in the app comes through it:
|
||||
// boot.html registers this worker and reloads into it, and from there nothing
|
||||
// else ever builds one.
|
||||
//
|
||||
// Every same-origin GET is network-first: ask the network, fall back to the
|
||||
// cache when it fails. Offline, fetch rejects immediately, so the fallback is
|
||||
@@ -461,16 +458,12 @@ router.get('/', (call) => servePage('./', '', call));
|
||||
router.get('/:page', (call) =>
|
||||
servePage('./' + call.params.page, call.params.page, call));
|
||||
|
||||
router.get('/api/bookmark', () => bookmarkFragment(''));
|
||||
|
||||
// The picker, and the two moves it makes.
|
||||
//
|
||||
// no parameters the whole picker, standing where the anchor in the address
|
||||
// bar puts it. Asked for by the picker itself: on load,
|
||||
// bar puts it. Asked for by the picker itself: on load, and
|
||||
// after a history restore -- which swaps the history element
|
||||
// straight in and processes no out-of-band elements -- and
|
||||
// when a worker first appears under a page boot.html
|
||||
// composed.
|
||||
// straight in and processes no out-of-band elements.
|
||||
// at=ch3 the verses of that chapter, and land on the chapter.
|
||||
// at=v3_16 the same verses, that one selected, and land on the verse.
|
||||
//
|
||||
@@ -490,9 +483,8 @@ router.get('/api/bookmark', () => bookmarkFragment(''));
|
||||
// is rendered at 1:1 like any other. The page then asks this route for itself,
|
||||
// and that request is the one carrying the anchor.
|
||||
//
|
||||
// Which also puts the picker where it belongs after a back or forward, and
|
||||
// under a page boot.html composed once a worker turns up, for nothing extra:
|
||||
// those requests carry the address bar too.
|
||||
// Which also puts the picker where it belongs after a back or forward, for
|
||||
// nothing extra: those requests carry the address bar too.
|
||||
//
|
||||
// Two response headers carry what a change means beyond the options:
|
||||
//
|
||||
@@ -734,13 +726,11 @@ function getBookmark() {
|
||||
.then((mark) => mark || DEFAULT_BOOKMARK);
|
||||
}
|
||||
|
||||
// The navbar slot, and the toast that says what just happened to it. The
|
||||
// toast rides out of band, so one response updates the slot and raises it
|
||||
// without the page having to ask for the second one -- same template and same
|
||||
// table api/toast answers from, so the two cannot drift apart.
|
||||
async function bookmarkFragment(say) {
|
||||
let html = await view.render('bookmark.njk', { mark: await getBookmark() });
|
||||
if (say) {
|
||||
// Out of band, so one response updates the navbar slot and raises the
|
||||
// toast without the page having to ask for the second one. Same template
|
||||
// and same table api/toast answers from, so the two cannot drift apart.
|
||||
html += '\n' + await toastFragment(say, true);
|
||||
}
|
||||
return html;
|
||||
return await view.render('bookmark.njk', { mark: await getBookmark() })
|
||||
+ '\n' + await toastFragment(say, true);
|
||||
}
|
||||
Reference in new issue
Block a user