-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a6116d0
Showing
18 changed files
with
16,409 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>PWA - Intellimeet</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" type="text/css" href="css/material.min.css"> | ||
<link rel="stylesheet" type="text/css" href="css/material.css"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
</head> | ||
<body> | ||
<!-- Always shows a header, even in smaller screens. --> | ||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header"> | ||
<header class="mdl-layout__header"> | ||
<div class="mdl-layout__header-row"> | ||
<!-- Title --> | ||
<span class="mdl-layout-title">Title</span> | ||
<!-- Add spacer, to align navigation to the right --> | ||
<div class="mdl-layout-spacer"></div> | ||
<!-- Navigation. We hide it in small screens. --> | ||
<nav class="mdl-navigation mdl-layout--large-screen-only"> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
</nav> | ||
</div> | ||
</header> | ||
<div class="mdl-layout__drawer"> | ||
<span class="mdl-layout-title">Title</span> | ||
<nav class="mdl-navigation"> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
<a class="mdl-navigation__link" href="">Link</a> | ||
</nav> | ||
</div> | ||
<main class="mdl-layout__content"> | ||
<div class="page-content"><!-- Your content goes here --></div> | ||
</main> | ||
</div> | ||
</body> | ||
<script type="text/javascript" src="js/material.min.js"></script> | ||
<script> | ||
var success = function (msg) { | ||
console.log('Service Worker Registered Successfully', msg); | ||
}; | ||
var error = function (err) { | ||
console.log('Service worker registeration failed', err); | ||
}; | ||
if('serviceWorker' in navigator){ | ||
navigator.serviceWorker.register('/my-sw.js') | ||
.then(success) | ||
.catch(error); | ||
} | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
var CACHE_NAME = 'bharat-v1'; | ||
|
||
var CACHE_BLACKLIST = ['/my-sw.js','/sw.js']; | ||
|
||
var CACHE_LIST = [ | ||
'/index.html', | ||
'/css/material.min.css', | ||
'/css/material.min.js' | ||
]; | ||
|
||
self.addEventListener('install', function (event) { | ||
event.waitUntil( | ||
caches.open(CACHE_NAME).then(function (cache) { | ||
console.log('cache opened'); | ||
return cache.addAll(CACHE_LIST); | ||
}) | ||
); | ||
}); | ||
|
||
/*self.addEventListener('fetch', function (event) { | ||
event.respondWith( | ||
caches.match(event.request) | ||
.then(function (response) { | ||
return response || fetch(event.request); | ||
}) | ||
); | ||
});*/ | ||
|
||
self.addEventListener('fetch', function (event) { | ||
event.respondWith( | ||
caches.match(event.request) | ||
.then(function (response) { | ||
if(response) | ||
return response; | ||
|
||
var fetchRequest = event.request.clone(); | ||
return fetch(fetchRequest) | ||
.then(function (response) { | ||
if(!response || response.status !== 200 || response.type != 'basic') | ||
return response; | ||
|
||
var responseClone = response.clone(); | ||
console.log('fetch Request Runtime: ', fetchRequest); | ||
if(CACHE_BLACKLIST.indexOf(fetchRequest) === -1){ | ||
console.log('not in black list '); | ||
caches.open(CACHE_NAME) | ||
.then(function (cache) { | ||
console.log('cache opened on run time') | ||
cache.put(fetchRequest, responseClone) | ||
}); | ||
} | ||
|
||
return response; | ||
}) | ||
}) | ||
.catch(function () { | ||
return caches.match(''); | ||
}) | ||
); | ||
}); | ||
|
||
|
||
self.addEventListener('activate', function(event) { | ||
var cacheWhitelist = [CACHE_NAME]; | ||
console.log('Activate Event Fired'); | ||
event.waitUntil( | ||
caches.keys().then(function(keyList) { | ||
return Promise.all(keyList.map(function(key) { | ||
if (cacheWhitelist.indexOf(key) === -1) { | ||
return caches.delete(key); | ||
} | ||
})); | ||
}) | ||
); | ||
}); |
Oops, something went wrong.