X-Git-Url: http://jaekl.net/gitweb/?p=quanweb.git;a=blobdiff_plain;f=js%2FMain.js;h=22e7dd6b734212fc54fc79f9a8807318e2f7be5f;hp=6ceac8256665e4fbd49b5aaaf3661ccf918d1d5f;hb=13efcb823cde095d5562ac061ef5a859d91c0f70;hpb=32c817b6cf7484487c1160cec8a4b9e770b8404a diff --git a/js/Main.js b/js/Main.js index 6ceac82..22e7dd6 100644 --- a/js/Main.js +++ b/js/Main.js @@ -1,5 +1,5 @@ -//QuanLib: eBook Library -//(C) 2017 by Christian Jaekl (cejaekl@yahoo.com) +// QuanLib: eBook Library +// Copyright (C) 2017 by Christian Jaekl (cejaekl@yahoo.com) 'use strict'; @@ -14,19 +14,29 @@ var g_state = { // ============== // Initialization -document.onmousemove = onMouseMove; +Browser.setOnMouseMove(onMouseMove); BooksView.init(BooksModel); PagingController.init(BooksModel); SearchController.init(BooksModel); +if (Modernizr.fetch) { + console.log('quanweb: browser feature check: OK'); +} +else { + // If we cared about supporting older browsers (at this point, IE11 and Adroid 4.x's built-in browser, + // neither of which is due to receive security patch support for much longer), then we would insert a + // shim here to implement the fetch API. But, in this case, we don't and won't. + alert('Sorry, this page will not work in your browser.\nPlease use a recent version of Chrome, Edge or Firefox instead.'); +} + // ================ // Global functions // // TODO: refactor this to compartmentalize more functionality. function report(message) { - document.getElementById('books').innerHTML = message; + Browser.getElementById('books').innerHTML = message; } function onMouseMove(event) {