diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-09 17:00:26 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-09 17:00:26 -0400 |
| commit | d414f4c0aeb535df89e52139f10ec85cac1312e6 (patch) | |
| tree | 4b44287db348dd278a7495b74e3b9c934858f759 | |
| parent | d96e081e9ee7f96a268c3beaf2f8d11d6146927b (diff) | |
preloading images from projects/pages
| -rw-r--r-- | site/index.js | 1 | ||||
| -rw-r--r-- | site/public/assets/javascripts/_env.js | 3 | ||||
| -rw-r--r-- | site/templates/index.liquid | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/site/index.js b/site/index.js index 6e5aed0..a59e74e 100644 --- a/site/index.js +++ b/site/index.js @@ -45,6 +45,7 @@ var app = okcms.createApp({ '/': { data: [ {type: 'project', query: '*'}, + {type: 'page', query: '*'} ] }, '/about': { diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index 3badf41..ca94ee2 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -16,9 +16,10 @@ environment.init = function(){ var loader = new Loader(function(){ environment.ready() }) + var preloadImages = $("#preload-image-list").html().split("\n").filter(function(s){ return !!s }) loader.preloadImages(box_images.map(function(url){ return base_href + url - })) + }).concat(preloadImages)) loader.ready() } environment.ready = function(){ diff --git a/site/templates/index.liquid b/site/templates/index.liquid index 3d31f91..e459d7b 100644 --- a/site/templates/index.liquid +++ b/site/templates/index.liquid @@ -132,6 +132,10 @@ WEBSITE BY OKFOCUS, http://okfoc.us, Internet Legends. </div> </div> +<script type="text/plain" id="preload-image-list"> +{% for project in projects %}{{ project.images[0].uri }} +{% endfor %}{% for page in pages %}{{ page.image }} +{% endfor %}</script> <a class="burgWrapper" href="##"> <div class="burg"></div> |
