Initial commit to branch upgrade-js
Start incrementally adding to sites javascript. Starting with, handling application cache events, then considering additional features like using local storage to allow offline reading of posts, as well as an interface to view and manage them. Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
This commit is contained in:
parent
c2aefc647f
commit
e7decd4349
|
@ -218,6 +218,11 @@ _paq.push(['enableLinkTracking']);
|
|||
});
|
||||
}
|
||||
|
||||
function appCacheUpdateReady () {
|
||||
window.applicationCache.swapCache();
|
||||
// TODO: find what resource is loaded currently and reload it if it has changed
|
||||
}
|
||||
|
||||
function init(router) {
|
||||
router.setCallback(loadPageContent);
|
||||
|
||||
|
@ -225,6 +230,11 @@ _paq.push(['enableLinkTracking']);
|
|||
router.runRouter(location.pathname);
|
||||
});
|
||||
|
||||
window.addEventListener("updateready", appCacheUpdateReady);
|
||||
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
||||
appCacheUpdateReady();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#nav-menu a.menuitem').click(function () {
|
||||
$(this).closest('ul').find('li.active').removeClass('active');
|
||||
|
|
Loading…
Reference in New Issue