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 ('/').
|
|
|
|
return navigator.serviceWorker.register('/serviceWorker.js', {
|
|
|
|
scope: '/'
|
|
|
|
}).then(function (registration) {
|
|
|
|
return console.log('Service worker registration succeeded: ', registration);
|
|
|
|
}).catch(function (error) {
|
|
|
|
return console.log('Service worker registration failed: ', error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
console.log('Service workers are not supported.');
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: Set Bootstrap materialdesign
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
$('body').bootstrapMaterialDesign();
|
|
|
|
}, false);
|
|
|
|
/*
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('body').bootstrapMaterialDesign();
|
|
|
|
});
|
|
|
|
*/
|
|
|
|
|
2018-11-21 15:54:09 +01:00
|
|
|
/*
|
2018-11-14 11:48:32 +01:00
|
|
|
// NOTE: Define routes
|
|
|
|
const routes = [{
|
|
|
|
path: "/home",
|
|
|
|
component: RouterHome
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/folder",
|
|
|
|
component: RouterFolder
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/bookmark",
|
|
|
|
component: RouterBookmark
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/profil",
|
|
|
|
component: RouterProfil
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/entry/:what/:id",
|
|
|
|
component: RouterEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/entry/:what",
|
|
|
|
component: RouterEntry
|
|
|
|
},
|
|
|
|
];
|
2018-11-21 15:54:09 +01:00
|
|
|
const router = new VueRouter({
|
|
|
|
routes
|
|
|
|
});
|
|
|
|
*/
|
2018-11-14 11:48:32 +01:00
|
|
|
|