-
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.
Starting with next version and need to reverse the steps
- Loading branch information
Matt Gaunt
committed
Oct 20, 2016
1 parent
c7d3865
commit b2dff28
Showing
41 changed files
with
250 additions
and
807 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
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,5 @@ | ||
{ | ||
"rules": { | ||
"no-unused-vars": 0 | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>Push Notification codelab</title> | ||
<title>Push codelab</title> | ||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css"> | ||
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script> | ||
<link rel="stylesheet" href="styles/index.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<h1>Push Notification codelab</h1> | ||
<header> | ||
<h1>Push Codelab</h1> | ||
</header> | ||
|
||
<main> | ||
<p>Welcome to the push messaging codelab. The button below needs to be | ||
fixed to support subscribing to push.</p> | ||
<p> | ||
<button disabled class="js-push-btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"> | ||
Enable Push Messaging | ||
</button> | ||
</p> | ||
</main> | ||
|
||
<script src="js/main.js"></script> | ||
|
||
<script src="https://code.getmdl.io/1.2.1/material.min.js"></script> | ||
</body> | ||
</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 |
---|---|---|
@@ -1,3 +1,45 @@ | ||
/* | ||
* | ||
* Push Notifications codelab | ||
* Copyright 2015 Google Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License | ||
* | ||
*/ | ||
|
||
/* eslint-env browser, es6 */ | ||
|
||
'use strict'; | ||
|
||
// TODO | ||
/* eslint-disable max-len */ | ||
const applicationServerPublicKey = ''; | ||
/* eslint-enable max-len */ | ||
|
||
const pushButton = document.querySelector('.js-push-btn'); | ||
let isSubscribed = false; | ||
let swRegistration = null; | ||
|
||
function urlBase64ToUint8Array(base64String) { | ||
const padding = '='.repeat((4 - base64String.length % 4) % 4); | ||
const base64 = (base64String + padding) | ||
.replace(/\-/g, '+') | ||
.replace(/_/g, '/'); | ||
|
||
const rawData = window.atob(base64); | ||
const outputArray = new Uint8Array(rawData.length); | ||
|
||
for (let i = 0; i < rawData.length; ++i) { | ||
outputArray[i] = rawData.charCodeAt(i); | ||
} | ||
return outputArray; | ||
} |
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,30 @@ | ||
html { | ||
height: 100%; | ||
} | ||
|
||
html, body { | ||
width: 100%; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
min-height: auto; | ||
box-sizing: border-box; | ||
} | ||
|
||
header { | ||
padding: 115px 16px 32px 16px; | ||
box-sizing: border-box; | ||
background-color: #00bcd4; | ||
color: white; | ||
} | ||
|
||
main, header > h1 { | ||
width: 760px; | ||
margin: 0 auto; | ||
} | ||
|
||
main { | ||
padding: 24px 0; | ||
} |
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 |
---|---|---|
|
@@ -17,8 +17,6 @@ | |
* | ||
*/ | ||
|
||
// Version 0.1 | ||
|
||
'use strict'; | ||
|
||
// TODO |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.