2018-11-14 11:48:32 +01:00
|
|
|
/******************************************************
|
|
|
|
* Main JavaScript file - Entry point of all JS files *
|
|
|
|
******************************************************/
|
|
|
|
|
|
|
|
// NOTE: ServiceWorker Registration
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
window.addEventListener('load', function () {
|
|
|
|
// Register a service worker hosted at the root of the
|
|
|
|
// site using the default scope ('/').
|
2019-02-08 14:59:19 +01:00
|
|
|
return navigator.serviceWorker.register('serviceWorker.js', {
|
2018-11-14 11:48:32 +01:00
|
|
|
scope: '/'
|
|
|
|
}).then(function (registration) {
|
2018-12-05 19:32:36 +01:00
|
|
|
return console.log('[ServiceWorker] Registration succeeded: ', registration);
|
2018-11-14 11:48:32 +01:00
|
|
|
}).catch(function (error) {
|
2018-12-05 19:32:36 +01:00
|
|
|
return console.log('[Service worker] Registration failed: ', error);
|
2018-11-14 11:48:32 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
2018-12-05 19:32:36 +01:00
|
|
|
console.log('[ServiceWorker] are not supported.');
|
2018-11-14 11:48:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: Set Bootstrap materialdesign
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
$('body').bootstrapMaterialDesign();
|
|
|
|
}, false);
|