Skip to content

Commit

Permalink
feat: update Web IDE with TON branding
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 committed Sep 20, 2024
1 parent 6827ff3 commit aaac226
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 191 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![](https://res.cloudinary.com/don6qaqms/image/upload/v1696056044/k8w16co4k2nsjsrn7sup.jpg)

# What is Nujan?
# What is TON Web IDE?

Web IDE, powered by Nujan, is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.
It is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.

# What we offer 🤝

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "nujan-ton-ide",
"name": "ton-web-ide",
"version": "0.1.0",
"private": true,
"author": {
"name": "Rahul Yadav",
"url": "https://github.com/rahulyadav-57/"
},
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion public/assets/ton/tonconnect-manifest.json
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"
}
194 changes: 97 additions & 97 deletions public/html/testcases.html
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>
Loading

0 comments on commit aaac226

Please sign in to comment.