/******************************************************
 * Main JavaScript file - Entry point of all JS files *
 ******************************************************/

// Wait until page loaded
window.addEventListener('load', () => {
	if ('serviceWorker' in navigator) {
		// NOTE: ServiceWorker Registration
		return navigator.serviceWorker.register('serviceWorker.js', {
			scope: '/'
		}).then(function (registration) {
			return console.log('[ServiceWorker] Registration succeeded: ', registration);
		}).catch(function (error) {
			return console.log('[Service worker] Registration failed: ', error);
		});
	} else {
		console.log('[ServiceWorker] are not supported.');
		return;
	}
});

// NOTE: Set Bootstrap materialdesign
document.addEventListener("DOMContentLoaded", function () {
	$('body').bootstrapMaterialDesign();
}, false);
