remove js template

This commit is contained in:
Fay Arnold 2021-04-08 14:20:14 +01:00
parent 5c13b626a8
commit 2760e70c8e
2 changed files with 0 additions and 24 deletions

View File

@ -1,18 +0,0 @@
// Register event listener for the 'push' event.
self.addEventListener("push", function (event) {
// Retrieve the textual payload from event.data (a PushMessageData object).
// Other formats are supported (ArrayBuffer, Blob, JSON), check out the documentation
// on https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData.
const eventInfo = event.data.text();
const data = JSON.parse(eventInfo);
const head = data.head || "New Notification 🕺🕺";
const body = data.body || "This is default content. Your notification didn't have one 🙄🙄";
// Keep the service worker alive until the notification is created.
event.waitUntil(
self.registration.showNotification(head, {
body: body,
icon: "https://i.imgur.com/MZM3K5w.png",
})
);
});

View File

@ -6,10 +6,4 @@ from .views import home, send_push
urlpatterns = [
path("send_push", send_push),
path("webpush/", include("webpush.urls")),
path(
"sw.js",
TemplateView.as_view(
template_name="sw.js", content_type="application/x-javascript"
),
),
]