This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getCachedJSON = function (url) { | |
var deferred = new $.Deferred(); | |
var cachedData = window.localStorage[url]; | |
if (cachedData) { | |
log('Data already cached, returning from cache:', url); | |
deferred.resolve(JSON.parse(cachedData)); | |
} else { | |
$.getJSON(url, function(data) { | |
log('Fetched data, saving to cache:', url); | |
window.localStorage[url] = JSON.stringify(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Dithering Test</title> | |
</head> | |
<body> | |
<canvas></canvas> | |
<script> | |
var canvas = document.getElementsByTagName("canvas")[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, | |
body, | |
#doc { | |
height: 100%; // Passes through the height of the parent iframe element | |
} | |
#doc { | |
// Magic to prevent iOS growing the iFrame to fit the content. | |
// This container will mimic the behavior of the iframe on a desktop browser | |
-webkit-overflow-scrolling:touch; | |
overflow-y: scroll; |