Add the unfetch polyfill, so that we can function on ancient iPads.
[quanweb.git] / js / Main.js
index 5f253bcc1e9fe486362d1106232d40030dee82a5..46c77b00547c0ed1af86758b967f5511f9d7ca72 100644 (file)
@@ -14,20 +14,20 @@ var g_state = {
 // ==============
 // Initialization
 
-document.onmousemove = onMouseMove;
+Browser.setOnMouseMove(onMouseMove);
 
 BooksView.init(BooksModel);
 PagingController.init(BooksModel);
 SearchController.init(BooksModel);
 
-if (Modernizr.fetch) {
+if (Modernizr.promises) {
     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.');
+    // shim here to implement promises.  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, Firefox or Safari instead.');
 }
 
 // ================
@@ -36,7 +36,7 @@ else {
 // TODO:  refactor this to compartmentalize more functionality.
 
 function report(message) {
-    document.getElementById('books').innerHTML = message;
+    Browser.getElementById('books').innerHTML = message;
 }
 
 function onMouseMove(event) {