Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /******************************************************
  2. * Main JavaScript file - Entry point of all JS files *
  3. ******************************************************/
  4. // NOTE: ServiceWorker Registration
  5. if ('serviceWorker' in navigator) {
  6. window.addEventListener('load', function () {
  7. // Register a service worker hosted at the root of the
  8. // site using the default scope ('/').
  9. return navigator.serviceWorker.register('/serviceWorker.js', {
  10. scope: '/'
  11. }).then(function (registration) {
  12. return console.log('Service worker registration succeeded: ', registration);
  13. }).catch(function (error) {
  14. return console.log('Service worker registration failed: ', error);
  15. });
  16. });
  17. } else {
  18. console.log('Service workers are not supported.');
  19. }
  20. // NOTE: Set Bootstrap materialdesign
  21. document.addEventListener("DOMContentLoaded", function () {
  22. $('body').bootstrapMaterialDesign();
  23. }, false);
  24. /*
  25. $(document).ready(function() {
  26. $('body').bootstrapMaterialDesign();
  27. });
  28. */
  29. // NOTE: Define routes
  30. const routes = [{
  31. path: "/home",
  32. component: RouterHome
  33. },
  34. {
  35. path: "/folder",
  36. component: RouterFolder
  37. },
  38. {
  39. path: "/bookmark",
  40. component: RouterBookmark
  41. },
  42. {
  43. path: "/profil",
  44. component: RouterProfil
  45. },
  46. {
  47. path: "/entry/:what/:id",
  48. component: RouterEntry
  49. },
  50. {
  51. path: "/entry/:what",
  52. component: RouterEntry
  53. },
  54. ];
  55. /*
  56. const router = new VueRouter({
  57. routes
  58. });
  59. */