var CACHE_VERSION = "v1";
var CACHE_NAME = CACHE_VERSION + ":sw-cache-";
var filesToCache = [
'/index.php',
'/templates/new/css/0jquery-ui.css',
'/templates/new/css/1bootstrap.css'
];
self.addEventListener('install', function(e) {
console.log('[ServiceWorker] Install');
e.waitUntil(
caches.open(CACHE_NAME).then(function(cache) {
console.log('[ServiceWorker] Caching app shell');
return cache.addAll(filesToCache);
})
);
});
self.addEventListener('activate', function(e) {
console.log('[ServiceWorker] Activate');
e.waitUntil(
caches.keys().then(function(keyList) {
return Promise.all(keyList.map(function(key) {
if (key !== CACHE_NAME) {
console.log('[ServiceWorker] Removing old cache', key);
return caches.delete(key);
}
}));
})
);
return self.clients.claim();
});
var option = {
scale: 1.2
};
var option = {
transform: ["scale(1.2)", "scale(1)"]
};
.active:hover {
background: none; // свойства отменяющие hover без класса active
}
class SomeClass {
// ...
}
window.__SomeClass = SomeClass;
new window.__SomeClass()
let animateId;
// ...
animateId = requestAnimationFrame(timeBetweenDates);
function timeBetweenDates() {
//...
animateId = requestAnimationFrame(timeBetweenDates);
}
$('.restart').click(function() {
//...
cancelAnimationFrame(animateId)
//...
});
var limit = 24 * 3600 * 1000; // 24 часа
var localStorageInitTime = localStorage.getItem('localStorageInitTime');
if (localStorageInitTime === null) {
localStorage.setItem('localStorageInitTime', +new Date());
} else if(+new Date() - localStorageInitTime > limit)
localStorage.clear();
localStorage.setItem('localStorageInitTime', +new Date());
}