Service worker initialisation is moved to default.

This commit is contained in:
Said Tahsin Dane 2015-03-15 02:08:37 +02:00
parent 0a8fbff321
commit 7b3bba8d2b
2 changed files with 3 additions and 13 deletions

View file

@ -51,17 +51,4 @@
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<script>
window.addEventListener('load', function() {
navigator.serviceWorker.register('{{ site.baseurl }}/service-worker.js', {scope: '{{ site.baseurl }}/'})
.then(function(r) {
console.log('registered service worker');
})
.catch(function(whut) {
console.error('uh oh... ');
console.error(whut);
});
});
</script>
</head> </head>

View file

@ -131,6 +131,9 @@ layout: compress
{% endif %} {% endif %}
</script> </script>
<script src="{{ "/js/scripts.min.js" | prepend: site.baseurl }}"></script> <script src="{{ "/js/scripts.min.js" | prepend: site.baseurl }}"></script>
<script>
navigator.serviceWorker.register('{{ site.baseurl }}/service-worker.js', {scope: '{{ site.baseurl }}/'});
</script>
{% if page.permalink == '/schedule/' %} {% if page.permalink == '/schedule/' %}
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {