Skip to content

Commit

Permalink
initial store development
Browse files Browse the repository at this point in the history
  • Loading branch information
ruochenjia committed Oct 22, 2024
1 parent f1081c7 commit 67a9b82
Show file tree
Hide file tree
Showing 16 changed files with 3,356 additions and 0 deletions.
Binary file added d/Dr Mario.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d/Dr Rudy 2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added d/Dr Rudy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,184 changes: 3,184 additions & 0 deletions ext/calc/calculator.js

Large diffs are not rendered by default.

Binary file added ext/calc/favicon.ico
Binary file not shown.
9 changes: 9 additions & 0 deletions ext/calc/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import url("/common.css");

body>div {
position: absolute;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
}
16 changes: 16 additions & 0 deletions ext/calc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8" />
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="index.css" />
<title>Graphing Calculator</title>
</head>
<body>
<div>Loading...</div>
<script type="text/javascript" src="main.js"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions ext/calc/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict"; (async ({ window: win, document: doc }) => {
if (doc.readyState !== "complete") {
await new Promise((resolve) => {
const callback = () => {
if (doc.readyState === "complete") {
doc.removeEventListener("readystatechange", callback);
setTimeout(resolve, 1000, null);
}
};
doc.addEventListener("readystatechange", callback, { passive: true });
});
}

const body = doc.body;

win.stop();
win.focus();
body.innerHTML = "Loading... (1)";

const e = doc.createElement("script");
e.type = "text/javascript";
e.src = "calculator.js";
e.async = true;
e.defer = true;

e.onload = () => {
const e = doc.createElement("div");
body.innerHTML = "";
body.appendChild(e);
win.Desmos.GraphingCalculator(e);
};

body.appendChild(e);
})(window);
1 change: 1 addition & 0 deletions index.xht
1 change: 1 addition & 0 deletions index.xml
10 changes: 10 additions & 0 deletions res/apps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions res/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions res/games.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions res/store.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8" />
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<base href="/" target="_blank" />
<title>NettleWeb Search</title>
</head>
<body>
<div>Loading...</div>
<script type="text/javascript" src="search.js"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"use strict"; (async ({ window: win, document: doc }) => {
if (doc.readyState !== "complete") {
await new Promise((resolve) => {
const callback = () => {
if (doc.readyState === "complete") {
doc.removeEventListener("readystatechange", callback);
setTimeout(resolve, 500, null);
}
};
doc.addEventListener("readystatechange", callback, { passive: true });
});
}

const loc = win.location;
const body = doc.body;

const q = (new URLSearchParams(loc.search).get("q") || "").trim();
if (q.length === 0) {
loc.replace("/");
return;
}

win.stop();
win.focus();
doc.title = q + " - NettleWeb Search";
body.innerHTML = "<div class=\"gcse-search\"></div>";

Object.defineProperty(win, "history", {
value: Object.freeze(Object.setPrototypeOf({
get state() {
return null;
},
get length() {
return 0;
},
get scrollRestoration() {
return "auto";
},
go: () => void 0,
back: () => void 0,
forward: () => void 0,
pushState: () => void 0,
replaceState: () => void 0
}, null)),
writable: false,
enumerable: true,
configurable: false
});

const e = doc.createElement("script");
e.type = "text/javascript";
e.src = "https://cse.google.com/cse.js?cx=6505c81d738124627";
e.async = true;
e.defer = true;
body.appendChild(e);
})(window);

0 comments on commit 67a9b82

Please sign in to comment.