-
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.
- Loading branch information
Admin-Host
committed
Dec 23, 2024
0 parents
commit e5932aa
Showing
3 changed files
with
31 additions
and
0 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,3 @@ | ||
/.vs | ||
/.vscode | ||
.env |
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,13 @@ | ||
const url = 'https://lens.admin-host.com'; // LENS server URL | ||
const host = 'my-app'; // Registered app slug | ||
const width = 600; // Popup window width | ||
const height = 850; // Popup window height | ||
document.querySelector('#domain').innerHTML += document.domain; // Display current domain on screen. This domain must be registered with LENS. Register 'localhost' for testing | ||
function receiveMessage(event) { | ||
if (event.origin === url) { | ||
console.log(event.data); // Log response in console | ||
document.querySelector('#response').innerHTML += JSON.stringify(event.data); // Display response on screen | ||
}; | ||
}; | ||
window.addEventListener('message', receiveMessage, false); | ||
const popupWindow = window.open(`${url}?host=${host}&return=${document.domain}`, 'popup', `width=${width},height=${height},left=${(screen.width / 2) - (width / 2)},top=${(screen.height / 2) - (height / 2)}`); |
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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>LENS App</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Hello World!</h1> | ||
<p id="domain">Domain: </p> | ||
<p id="response">Response: </p> | ||
</body> | ||
<script src="assets/script.js"></script> | ||
|
||
</html> |