-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update Web IDE with TON branding
- Loading branch information
1 parent
6827ff3
commit aaac226
Showing
16 changed files
with
199 additions
and
191 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"url": "https://ide.nujan.io/", | ||
"name": "Nujan", | ||
"name": "TON Web IDE", | ||
"iconUrl": "https://ide.nujan.io/images/logo.png" | ||
} |
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 |
---|---|---|
@@ -1,113 +1,113 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Test Cases</title> | ||
<link | ||
href="https://unpkg.com/[email protected]/dist/prettify.css" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.jest-lite-report { | ||
--spacing: 0; | ||
margin-top: 0.8rem; | ||
padding: 0.2rem 0; | ||
font-family: Poppins; | ||
font-size: 0.9rem; | ||
background: transparent; | ||
} | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Test Cases</title> | ||
<link | ||
href="https://unpkg.com/[email protected]/dist/prettify.css" | ||
rel="stylesheet" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" | ||
rel="stylesheet" /> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.jest-lite-report__status { | ||
padding: 0.05rem 0.2rem; | ||
} | ||
.jest-lite-report { | ||
--spacing: 0; | ||
margin-top: 0.8rem; | ||
padding: 0.2rem 0; | ||
font-family: Poppins; | ||
font-size: 0.9rem; | ||
background: transparent; | ||
} | ||
|
||
.jest-lite-report__result, | ||
.jest-lite-report__summary-status { | ||
margin-bottom: 0.4rem; | ||
background: #262626; | ||
border-radius: 5px; | ||
padding: 5px; | ||
display: block; | ||
} | ||
.jest-lite-report__status { | ||
padding: 0.05rem 0.2rem; | ||
} | ||
|
||
.jest-lite-report__status--pass, | ||
.jest-lite-report__status--fail { | ||
background: transparent; | ||
border: 1px solid var(--color-pass); | ||
font-size: 0.7rem; | ||
line-height: 1.3; | ||
} | ||
.jest-lite-report__result, | ||
.jest-lite-report__summary-status { | ||
margin-bottom: 0.4rem; | ||
background: #262626; | ||
border-radius: 5px; | ||
padding: 5px; | ||
display: block; | ||
} | ||
|
||
.jest-lite-report__status--pass { | ||
color: var(--color-pass); | ||
} | ||
.jest-lite-report__status--pass, | ||
.jest-lite-report__status--fail { | ||
background: transparent; | ||
border: 1px solid var(--color-pass); | ||
font-size: 0.7rem; | ||
line-height: 1.3; | ||
} | ||
|
||
.jest-lite-report__status--fail { | ||
border-color: var(--color-fail); | ||
color: var(--color-fail); | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id="result"></div> | ||
|
||
<script src="https://unpkg.com/[email protected]/dist/core.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/prettify.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/rahulyadav-57/ton-standalone-libraries@master/dist/ton-core.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/rahulyadav-57/ton-standalone-libraries@master/dist/sandbox.js"></script> | ||
|
||
<script> | ||
let { Cell } = window.TonCore; | ||
let contractCode = ""; | ||
const { | ||
core: { describe, it, expect, run, beforeAll, beforeEach }, | ||
prettify, | ||
} = window.jestLite; | ||
|
||
function bocToCell(codeBoc) { | ||
return Cell.fromBoc(Buffer.from(codeBoc, "base64"))[0]; | ||
} | ||
.jest-lite-report__status--pass { | ||
color: var(--color-pass); | ||
} | ||
|
||
.jest-lite-report__status--fail { | ||
border-color: var(--color-fail); | ||
color: var(--color-fail); | ||
} | ||
</style> | ||
</head> | ||
|
||
window.addEventListener("message", async function (event) { | ||
if ( | ||
!event.data || | ||
typeof event.data !== "object" || | ||
!event.data?.type || | ||
event.data?.name !== "nujan-ton-ide" || | ||
event.data?.type !== "test-cases" | ||
) { | ||
return; | ||
} | ||
contractCode = `async function main() { | ||
<body> | ||
<div id="result"></div> | ||
|
||
<script src="https://unpkg.com/[email protected]/dist/core.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/prettify.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/rahulyadav-57/ton-standalone-libraries@master/dist/ton-core.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/rahulyadav-57/ton-standalone-libraries@master/dist/sandbox.js"></script> | ||
|
||
<script> | ||
let { Cell } = window.TonCore; | ||
let contractCode = ""; | ||
const { | ||
core: { describe, it, expect, run, beforeAll, beforeEach }, | ||
prettify, | ||
} = window.jestLite; | ||
|
||
function bocToCell(codeBoc) { | ||
return Cell.fromBoc(Buffer.from(codeBoc, "base64"))[0]; | ||
} | ||
|
||
window.addEventListener("message", async function (event) { | ||
if ( | ||
!event.data || | ||
typeof event.data !== "object" || | ||
!event.data?.type || | ||
event.data?.name !== "ton-web-ide" || | ||
event.data?.type !== "test-cases" | ||
) { | ||
return; | ||
} | ||
contractCode = `async function main() { | ||
${event.data.code} | ||
prettify.toHTML(run(), document.getElementById('result')) | ||
} main()`; | ||
executeCodeInIframe(contractCode); | ||
}); | ||
|
||
function executeCodeInIframe(codeInput) { | ||
let script = document.getElementById("dynamicScript"); | ||
executeCodeInIframe(contractCode); | ||
}); | ||
|
||
if (!script) { | ||
script = document.createElement("script"); | ||
script.id = "dynamicScript"; | ||
document.body.appendChild(script); | ||
} | ||
function executeCodeInIframe(codeInput) { | ||
let script = document.getElementById("dynamicScript"); | ||
|
||
script.textContent = codeInput; | ||
if (!script) { | ||
script = document.createElement("script"); | ||
script.id = "dynamicScript"; | ||
document.body.appendChild(script); | ||
} | ||
</script> | ||
</body> | ||
|
||
script.textContent = codeInput; | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.