diff --git a/js/appinfo.js b/js/appinfo.js index ad2611d19..54cc1b7af 100644 --- a/js/appinfo.js +++ b/js/appinfo.js @@ -1,5 +1,9 @@ -if (typeof btoa==="undefined") - function btoa(d) { return Buffer.from(d).toString('base64'); } +if (typeof btoa==="undefined") { + // Don't define btoa as a function here because Apple's + // iOS browser defines the function even though it's in + // an IF statement that is never executed! + btoa = function(d) { return BufferA.from(d).toString('base64'); } +} // Converts a string into most efficient way to send to Espruino (either json, base64, or compressed base64) function toJS(txt) { diff --git a/js/index.js b/js/index.js index 031391f52..9bb4c2d9d 100644 --- a/js/index.js +++ b/js/index.js @@ -24,8 +24,8 @@ httpGet("appdates.csv").then(csv=>{ document.querySelector(".sort-nav").classList.remove("hidden"); csv.split("\n").forEach(line=>{ var l = line.split(","); - appSortInfo[l[0]] = { - created : Date.parse(l[1]), + appSortInfo[l[0]] = { + created : Date.parse(l[1]), modified : Date.parse(l[2]) }; }); @@ -196,7 +196,8 @@ function showTab(tabname) { // =========================================== Library -var chips = Array.from(document.querySelectorAll('.filter-nav .chip')).map(chip => chip.attributes.filterid.value); +// Can't use chip.attributes.filterid.value here because Safari/Apple's WebView doesn't handle it +var chips = Array.from(document.querySelectorAll('.filter-nav .chip')).map(chip => chip.getAttribute("filterid")); var hash = window.location.hash ? window.location.hash.slice(1) : ''; var activeFilter = !!~chips.indexOf(hash) ? hash : '';