Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
60b7bae0
Commit
60b7bae0
authored
Jul 21, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confirm dialog on close or refresh page
parent
e3ba96d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
app.component.ts
src/app/app.component.ts
+8
-1
No files found.
src/app/app.component.ts
View file @
60b7bae0
import
{
ChangeDetectorRef
,
Component
,
ElementRef
,
ViewChild
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
ElementRef
,
HostListener
,
ViewChild
}
from
'@angular/core'
;
import
{
Mission
}
from
'./class/mission/mission'
;
import
{
Scenario
}
from
'./class/scenario/scenario'
;
import
{
Step
}
from
'./class/step/step'
;
...
...
@@ -46,6 +46,13 @@ export class AppComponent {
});
}
@
HostListener
(
'window:beforeunload'
,
[
'$event'
])
beforeUnloadHandler
(
event
:
any
)
{
const
message
=
"Êtes vous sûr de vouloir quitter RLG Maker ?
\n
Vous risquez de perdre les données non sauvegardées."
;
event
.
returnValue
=
message
;
return
message
;
}
downloadFile
():
void
{
const
jsonString
=
JSON
.
stringify
(
this
.
scenario
);
const
blob
=
new
Blob
([
jsonString
],
{
type
:
'application/json'
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment