/
telnov.ob
/
cerberus
Обзор
Документация
Войти
/
telnov.ob
/
cerberus
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
javascript/applicationcache.js
7 строк
1 KB
Daniel J Wilcox
removed executable bit
02 май 2013, 06:17
02 май 2013, 06:17
5030b71
Код
Авторство
О чём код?
$(function(){var webappCache=window.applicationCache,loader,simulateDownload,pollingCacheStatus;loader=document.getElementById("loader").style;switch(webappCache.status){case 0:console.log("Cache status: Uncached");break;case 1:console.log("Cache status: Idle");break;case 2:console.log("Cache status: Checking");break;case 3:console.log("Cache status: Downloading");break;case 4:console.log("Cache status: Updateready");break;case 5:console.log("Cache status: Obsolete");break;default:console.log("Cache status: unknown");} function noupdateCache(){loader.display="none";console.log("No update to cache found");} function doneCache(){loader.display="none";console.log("Cache has finished downloading");} function progressCache(){loader.display="table";console.log("Downloading cache...");} function updateCache(){webappCache.swapCache();console.log("Cache has been updated due to a change found in the manifest");loader.display="none";} function errorCache(){console.log("You're either offline or something has gone horribly wrong.");} webappCache.addEventListener("noupdate",noupdateCache,false);webappCache.addEventListener("cached",doneCache,false);webappCache.addEventListener("progress",progressCache,false);webappCache.addEventListener("updateready",updateCache,false);webappCache.addEventListener("error",errorCache,false);})();