Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Plan2Go
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheDutchProgrammers
Plan2Go
Commits
5daceb87
Commit
5daceb87
authored
2 years ago
by
Miniontoby
Browse files
Options
Downloads
Patches
Plain Diff
Fixed links for pages and added compatibility for tauri
parent
6ec0e4df
No related branches found
No related tags found
No related merge requests found
Pipeline
#114043
passed
2 years ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
public/demo/index.html
+3
-3
3 additions, 3 deletions
public/demo/index.html
public/index.html
+4
-4
4 additions, 4 deletions
public/index.html
public/pwa.js
+20
-7
20 additions, 7 deletions
public/pwa.js
with
27 additions
and
14 deletions
public/demo/index.html
+
3
−
3
View file @
5daceb87
...
...
@@ -4,11 +4,11 @@
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Plan2Go Calandar
</title>
<link
rel=
"stylesheet"
href=
"style.css"
>
<link
rel=
"stylesheet"
href=
"
./
style.css"
>
<script
src=
"https://kit.fontawesome.com/a0d8d27dcc.js"
crossorigin=
"anonymous"
></script>
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
rel=
"manifest"
href=
"
..
/manifest.json"
>
<meta
name=
"theme-color"
content=
"#264a8a"
/>
<meta
name=
"apple-touch-icon"
content=
"/images/icon.png"
>
<meta
name=
"apple-touch-icon"
content=
"
..
/images/icon.png"
>
</head>
<body>
<!--
...
...
This diff is collapsed.
Click to expand it.
public/index.html
+
4
−
4
View file @
5daceb87
...
...
@@ -4,15 +4,15 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Index of Plan2Go
</title>
<!--<meta http-equiv="refresh" content="2;url=demo/" />-->
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
rel=
"manifest"
href=
"
.
/manifest.json"
>
<meta
name=
"theme-color"
content=
"#264a8a"
/>
<meta
name=
"apple-touch-icon"
content=
"/images/icon.png"
>
<meta
name=
"apple-touch-icon"
content=
"
.
/images/icon.png"
>
</head>
<body>
<h1>
Under construction
</h1>
<a
href=
"/demo/"
>
See the demo
</a>
<a
href=
"
.
/demo/"
>
See the demo
</a>
<button
id=
"notification-button"
>
Notify
</button>
<button
id=
"notification-cancel"
>
Cancel
</button>
<script
src=
"pwa.js"
></script>
<script
src=
"
./
pwa.js"
></script>
</body>
</html>
This diff is collapsed.
Click to expand it.
public/pwa.js
+
20
−
7
View file @
5daceb87
...
...
@@ -3,10 +3,21 @@ window.addEventListener("load", () => {
navigator
.
serviceWorker
.
register
(
"
service-worker.js
"
);
navigator
.
serviceWorker
.
addEventListener
(
'
message
'
,
event
=>
console
.
log
(
event
.
data
));
}
if
(
"
__TAURI__
"
in
window
)
{
Notification
.
showNotification
=
(
title
,
option
=
{})
=>
{
if
(
typeof
(
title
)
==
'
object
'
)
option
=
title
;
if
(
!
(
"
title
"
in
option
))
option
.
title
=
title
;
new
Notification
(
option
.
title
,
option
);
}
class
TimestampTrigger
{
constructor
(
timestamp
)
{}
}
}
});
document
.
querySelector
(
'
#notification-button
'
).
onclick
=
async
()
=>
{
const
reg
=
await
navigator
.
serviceWorker
.
getRegistration
();
let
reg
=
await
navigator
.
serviceWorker
.
getRegistration
();
if
(
"
__TAURI__
"
in
window
)
reg
=
Notification
;
Notification
.
requestPermission
().
then
(
permission
=>
{
if
(
permission
!==
'
granted
'
)
{
alert
(
'
you need to allow push notifications
'
);
...
...
@@ -39,11 +50,13 @@ document.querySelector('#notification-button').onclick = async () => {
});
};
document
.
querySelector
(
'
#notification-cancel
'
).
onclick
=
async
()
=>
{
const
reg
=
await
navigator
.
serviceWorker
.
getRegistration
();
const
notifications
=
await
reg
.
getNotifications
({
includeTriggered
:
true
});
notifications
.
forEach
(
notification
=>
notification
.
close
());
alert
(
`
${
notifications
.
length
}
notification(s) cancelled`
);
if
(
!
(
"
__TAURI__
"
in
window
))
{
const
reg
=
await
navigator
.
serviceWorker
.
getRegistration
();
const
notifications
=
await
reg
.
getNotifications
({
includeTriggered
:
true
});
notifications
.
forEach
(
notification
=>
notification
.
close
());
alert
(
`
${
notifications
.
length
}
notification(s) cancelled`
);
}
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment