-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from BalassaMarton/multiwindow-close
Shell - Handle window close events correctly
- Loading branch information
Showing
5 changed files
with
76 additions
and
8 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 @@ | ||
Properties/launchsettings.json |
38 changes: 38 additions & 0 deletions
38
Tryouts/Prototypes/Shell/Node-launcher/MultiWindowDemo/index.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,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Navigation demo</title> | ||
</head> | ||
|
||
<body> | ||
<script> | ||
|
||
let popup; | ||
|
||
function getPopupUrl(content) { | ||
return "popup.html?" + encodeURIComponent(content); | ||
} | ||
|
||
function showPopup() { | ||
const content = document.getElementById("popupContent").value; | ||
console.log(`Opening new window with content '${content}'`); | ||
|
||
if (popup && !popup.closed) { | ||
popup.location = getPopupUrl(content); | ||
} | ||
else { | ||
popup = window.open(getPopupUrl(content)); | ||
} | ||
} | ||
</script> | ||
<div> | ||
<form onsubmit="showPopup(); return false;"> | ||
<input type="text" id="popupContent"></input> | ||
<button>Open</button> | ||
</form> | ||
</div> | ||
</body> | ||
|
||
</html> |
24 changes: 24 additions & 0 deletions
24
Tryouts/Prototypes/Shell/Node-launcher/MultiWindowDemo/popup.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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>title</title> | ||
</head> | ||
<body> | ||
<script> | ||
|
||
window.onload = ev => { | ||
const content = window.location.search.substring(1); | ||
console.log(`Setting content to ${content}`); | ||
document.getElementById("content").textContent = content; | ||
} | ||
|
||
</script> | ||
<div> | ||
<span id="content"></span> | ||
</div> | ||
<div> | ||
<button onclick="window.close()">Close window</button> | ||
</div> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
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