V1.1 #72
2
.gitignore
vendored
|
@ -1 +1 @@
|
|||
/node_modules
|
||||
/target
|
||||
|
|
1831
Cargo.lock
generated
Normal file
8
Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "CrowdedGames"
|
||||
version = "1.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
rouille = "3.6.2"
|
||||
postgres = "0.19.10"
|
17
Dockerfile
|
@ -1,17 +0,0 @@
|
|||
# get a base
|
||||
FROM node:22-bookworm
|
||||
|
||||
# place the files into the image
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
# Dependencies
|
||||
RUN apt update
|
||||
RUN apt install npm -y
|
||||
RUN npm install http-server
|
||||
|
||||
# Expose the port from docker-compose.yml
|
||||
EXPOSE 4000
|
||||
|
||||
# Run the thing
|
||||
CMD npx http-server /app --port 4000 --cors
|
|
@ -1,48 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="../CSS/expanded.css">
|
||||
<script type="module" src="../JS/expanded.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Grandparent is a reply post above the reply post above the regular, clicked post. -->
|
||||
<header>
|
||||
<h1 class="Handle GrandParent"></h1>
|
||||
<h2 class="Origin GrandParent"></h2>
|
||||
</header>
|
||||
<p class="PostText GrandParent"></p>
|
||||
<div class="Images GrandParent"></div>
|
||||
<hr/>
|
||||
<!-- Parent is a reply post above the regular, clicked post. -->
|
||||
<header>
|
||||
<h1 class="Handle Parent"></h1>
|
||||
<h2 class="Origin Parent"></h2>
|
||||
</header>
|
||||
<p class="PostText Parent"></p>
|
||||
<div class="Images Parent"></div>
|
||||
<hr/>
|
||||
<!-- The regular, clicked post. -->
|
||||
<header>
|
||||
<h1 class="Handle Regular"></h1>
|
||||
<h2 class="Origin Regular"></h2>
|
||||
</header>
|
||||
<p class="PostText Regular"></p>
|
||||
<div class="Images Regular"></div>
|
||||
<!-- Interactables. -->
|
||||
<div style="display: flex;">
|
||||
<p class="Favorite">Favorite!</p>
|
||||
<p class="Boost">Boost!</p>
|
||||
<p class="Reply">Reply!</p>
|
||||
</div>
|
||||
<footer>
|
||||
<p class="Button" onclick="history.back()"><b>Back</b></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
services:
|
||||
channelviewer:
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: channelviewer:latest
|
||||
ports:
|
||||
- 4000:4000
|
|
@ -1,3 +0,0 @@
|
|||
# Bluesky stuff.
|
||||
|
||||
Yeah.
|
544
package-lock.json
generated
|
@ -1,544 +0,0 @@
|
|||
{
|
||||
"name": "Fedi.CrowdedGames.Group",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"http-server": "^14.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/async": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
|
||||
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA=="
|
||||
},
|
||||
"node_modules/basic-auth": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
|
||||
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"node_modules/corser": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
|
||||
"integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"bin": {
|
||||
"he": "bin/he"
|
||||
}
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
"integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==",
|
||||
"dependencies": {
|
||||
"whatwg-encoding": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy": {
|
||||
"version": "1.18.1",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||
"dependencies": {
|
||||
"eventemitter3": "^4.0.0",
|
||||
"follow-redirects": "^1.0.0",
|
||||
"requires-port": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/http-server": {
|
||||
"version": "14.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz",
|
||||
"integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==",
|
||||
"dependencies": {
|
||||
"basic-auth": "^2.0.1",
|
||||
"chalk": "^4.1.2",
|
||||
"corser": "^2.0.1",
|
||||
"he": "^1.2.0",
|
||||
"html-encoding-sniffer": "^3.0.0",
|
||||
"http-proxy": "^1.18.1",
|
||||
"mime": "^1.6.0",
|
||||
"minimist": "^1.2.6",
|
||||
"opener": "^1.5.1",
|
||||
"portfinder": "^1.0.28",
|
||||
"secure-compare": "3.0.1",
|
||||
"union": "~0.5.0",
|
||||
"url-join": "^4.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"http-server": "bin/http-server"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/opener": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
|
||||
"bin": {
|
||||
"opener": "bin/opener-bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/portfinder": {
|
||||
"version": "1.0.36",
|
||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.36.tgz",
|
||||
"integrity": "sha512-gMKUzCoP+feA7t45moaSx7UniU7PgGN3hA8acAB+3Qn7/js0/lJ07fYZlxt9riE9S3myyxDCyAFzSrLlta0c9g==",
|
||||
"dependencies": {
|
||||
"async": "^3.2.6",
|
||||
"debug": "^4.3.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.12"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"node_modules/secure-compare": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
|
||||
"integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw=="
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/union": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
|
||||
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
|
||||
"dependencies": {
|
||||
"qs": "^6.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/url-join": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
|
||||
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA=="
|
||||
},
|
||||
"node_modules/whatwg-encoding": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",
|
||||
"integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==",
|
||||
"dependencies": {
|
||||
"iconv-lite": "0.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"http-server": "^14.1.1"
|
||||
}
|
||||
}
|
|
@ -60,5 +60,5 @@ footer {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
height: 5vh;
|
||||
height: 130px;
|
||||
}
|
14
src/HTTP/HTML/404.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>No.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -4,9 +4,9 @@
|
|||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="../CSS/account.css">
|
||||
<script type="module" src="../JS/account.js"></script>
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/account.css">
|
||||
<script type="module" src="/JS/account.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
32
src/HTTP/HTML/expanded.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/expanded.css">
|
||||
<script type="module" src="/JS/expanded.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- The regular, clicked post. -->
|
||||
<header>
|
||||
<h1 class="Handle"></h1>
|
||||
<h2 class="Origin"></h2>
|
||||
</header>
|
||||
<p class="PostText"></p>
|
||||
<div class="Images"></div>
|
||||
<!-- Interactables. -->
|
||||
<div style="display: flex;">
|
||||
<p class="Favorite">Favorite!</p>
|
||||
<p class="Boost">Boost!</p>
|
||||
<p class="Reply">Reply!</p>
|
||||
</div>
|
||||
<footer>
|
||||
<p class="Button" onclick="history.back()"><b>Back</b></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -4,12 +4,12 @@
|
|||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="./Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="./CSS/index.css">
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/index.css">
|
||||
<!-- I am terribly sorry.
|
||||
This is the only way I knew how to make a "non-module" inherit a module.
|
||||
I think this is why people use typescript or other frameworks. -->
|
||||
<script type="module" src="./JS/index.js"></script>
|
||||
<script type="module" src="/JS/index.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
||||
|
@ -296,8 +296,8 @@
|
|||
</div>
|
||||
|
||||
<!-- Arrows to put the stuff going forward and backward (scrolling posts). -->
|
||||
<img class="Arrow" src="Icons/ArrowLeft.png" onclick="Back()"/>
|
||||
<img class="Arrow" src="Icons/ArrowRight.png" onclick="Next()"/>
|
||||
<img class="Arrow" src="/Icons/ArrowLeft.png" onclick="Back()"/>
|
||||
<img class="Arrow" src="/Icons/ArrowRight.png" onclick="Next()"/>
|
||||
|
||||
<footer class="MainFooter">
|
||||
<p class="Setting">Setting</p>
|
||||
|
@ -308,6 +308,6 @@
|
|||
</footer>
|
||||
</section>
|
||||
|
||||
<audio controls src="Audio/soft-piano-music-312509.mp3" loop=true preload=auto>Lmao you can't hear music XD</audio>
|
||||
<audio controls src="/Audio/soft-piano-music-312509.mp3" loop=true preload=auto>Lmao you can't hear music XD</audio>
|
||||
</body>
|
||||
</html>
|
|
@ -4,9 +4,9 @@
|
|||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="../CSS/mail.css">
|
||||
<script type="module" src="../JS/mail.js"></script>
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/mail.css">
|
||||
<script type="module" src="/JS/mail.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
|
@ -4,9 +4,9 @@
|
|||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="../CSS/post.css">
|
||||
<script type="module" src="../JS/post.js"></script>
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/post.css">
|
||||
<script type="module" src="/JS/post.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
|
@ -4,9 +4,9 @@
|
|||
<title>The Fediverse</title>
|
||||
<meta name="description" content="Change the fucking channel already!">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<link rel="icon" href="../Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="../CSS/setting.css">
|
||||
<script type="module" src="../JS/setting.js"></script>
|
||||
<link rel="icon" href="/Icons/favicon.ico" />
|
||||
<link rel="stylesheet" href="/CSS/setting.css">
|
||||
<script type="module" src="/JS/setting.js"></script>
|
||||
<!-- Dependenci -->
|
||||
<script language="JavaScript" type="text/javascript" src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js"></script>
|
||||
</head>
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -100,6 +100,23 @@ export async function GetPosts(URIs) {
|
|||
return body;
|
||||
}
|
||||
|
||||
export async function GetPostThread(URI) {
|
||||
if (Token == null) {
|
||||
return "";
|
||||
}
|
||||
let FetchThing = localStorage.getItem(Variables.BlueskyPDS) + "/xrpc/app.bsky.feed.getPostThread?uri=" + URI;
|
||||
let DPoP = await ClientDPoPPDS("GET", FetchThing);
|
||||
let request = fetch(FetchThing, { method: "GET", headers: {"Authorization": "DPoP " + Token, "DPoP": DPoP}});
|
||||
let body = await request.then((response) => response.json());
|
||||
let status = await request.then((response) => response.status);
|
||||
let header = await request.then((response) => response.headers.get("dpop-nonce"));
|
||||
if (status == 401) {
|
||||
await HandleError(body, header);
|
||||
body = await GetPostThread(URI);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
// Get a blob (like an image or video). Authentication need not apply.
|
||||
export async function GetBlob(DID, CID) {
|
||||
let request = fetch("https://bsky.social/xrpc/com.atproto.sync.getBlob?did=" + DID + "&cid=" + CID, {method: "GET"});
|
||||
|
@ -358,21 +375,30 @@ export function ApplyFacets(record, text) {
|
|||
}
|
||||
// Last minute append.
|
||||
SplitAreas.push(text.length);
|
||||
// Remove emoji regex
|
||||
let EmojiObjects = text.match(/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu);
|
||||
|
||||
let SubtractNumber = 0;
|
||||
if (EmojiObjects != null) {
|
||||
SubtractNumber = EmojiObjects.length * 2;
|
||||
}
|
||||
let TextThing = "";
|
||||
// Now we split the string
|
||||
for (let i = 1; i < SplitAreas.length; i++) {
|
||||
StringArray.push(text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber));
|
||||
// Remove emoji regex
|
||||
TextThing = text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber);
|
||||
let EmojiObjects = TextThing.match(/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu);
|
||||
if (EmojiObjects != null) {
|
||||
SubtractNumber = SubtractNumber + (EmojiObjects.length * 2);
|
||||
if (SplitAreas[i - 1] == 0) {
|
||||
TextThing = text.slice(SplitAreas[i - 1], SplitAreas[i] - SubtractNumber);
|
||||
} else {
|
||||
TextThing = text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber);
|
||||
}
|
||||
}
|
||||
StringArray.push(TextThing);
|
||||
}
|
||||
// Finally, we append the string with <a>
|
||||
for (let i = 0; i < StringArray.length; i += 2) {
|
||||
if (Hrefs[(i / 2)] != undefined && Hrefs[(i / 2)].split("https://").length != 1) {
|
||||
TempText += StringArray[i] + "<a href=\"" + Hrefs[(i / 2)] + "\">" + StringArray[i + 1] + "</a>";
|
||||
} else {
|
||||
// The "last string"
|
||||
TempText += StringArray[i];
|
||||
}
|
||||
}
|
||||
|
@ -438,11 +464,11 @@ export async function CreatePKCECodeChallenge(CodeVerifier) {
|
|||
|
||||
// Component 3/4
|
||||
export async function PARrequest(PAREndpoint, State, Challenge) {
|
||||
return fetch(PAREndpoint, {method: "POST", body: new URLSearchParams({ response_type: "code", code_challenge_method: "S256", scope: "atproto transition:generic", client_id: "https://fedi.crowdedgames.group/oauth/client-metadata.json", redirect_uri: "https://fedi.crowdedgames.group/HTML/setting.html", code_challenge: Challenge, state: State, login_hint: "crowdedgames.group" }), headers: {"Content-Type": "application/x-www-form-urlencoded"}});
|
||||
return fetch(PAREndpoint, {method: "POST", body: new URLSearchParams({ response_type: "code", code_challenge_method: "S256", scope: "atproto transition:generic", client_id: "https://fedi.crowdedgames.group/oauth/client-metadata.json", redirect_uri: "https://fedi.crowdedgames.group/setting", code_challenge: Challenge, state: State, login_hint: "crowdedgames.group" }), headers: {"Content-Type": "application/x-www-form-urlencoded"}});
|
||||
}
|
||||
|
||||
async function AuthRequest(TokenEndpoint, code, DPoP, Verify) {
|
||||
return fetch(TokenEndpoint, {method: "POST", body: new URLSearchParams({ grant_type: "authorization_code", code: code, client_id: "https://fedi.crowdedgames.group/oauth/client-metadata.json", redirect_uri: "https://fedi.crowdedgames.group/HTML/setting.html", code_verifier: Verify}), headers: { "DPoP": DPoP, "Content-Type": "application/x-www-form-urlencoded"}})
|
||||
return fetch(TokenEndpoint, {method: "POST", body: new URLSearchParams({ grant_type: "authorization_code", code: code, client_id: "https://fedi.crowdedgames.group/oauth/client-metadata.json", redirect_uri: "https://fedi.crowdedgames.group/setting", code_verifier: Verify}), headers: { "DPoP": DPoP, "Content-Type": "application/x-www-form-urlencoded"}})
|
||||
.then((response) => response.json());
|
||||
}
|
||||
|
|
@ -93,6 +93,14 @@ export async function GetStatus(ID) {
|
|||
.then((response) => response.json());
|
||||
}
|
||||
|
||||
export async function GetContexts(ID) {
|
||||
if (Token == null || TokenType == null) {
|
||||
return "";
|
||||
}
|
||||
return await fetch(localStorage.getItem(Variables.MastodonWebsite) + "/api/v1/statuses/" + ID + "/context", {method: "GET", headers: {"Authorization": TokenType + " " + Token}})
|
||||
.then((response) => response.json());
|
||||
}
|
||||
|
||||
// Get your own account by verifying your credentials.
|
||||
export async function GetOwnAccount() {
|
||||
if (Token == null || TokenType == null) {
|
|
@ -1,7 +1,7 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
let website = document.location.href.split("website=")[1];
|
||||
let post = JSON.parse(localStorage.getItem("post"));
|
|
@ -1,7 +1,7 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
// Buttons
|
||||
let Favorite = document.getElementsByClassName("Favorite")[0];
|
||||
|
@ -16,10 +16,9 @@ let Boostable = false;
|
|||
// Variables
|
||||
let website = document.location.href.split("website=")[1];
|
||||
let post = JSON.parse(localStorage.getItem("post"));
|
||||
let Parentpost;
|
||||
let GrandParentpost;
|
||||
let ThreadedPost = [];
|
||||
|
||||
document.getElementsByClassName("Origin Regular")[0].innerHTML = website;
|
||||
document.getElementsByClassName("Origin")[0].innerHTML = website;
|
||||
GetPost();
|
||||
|
||||
// Fixes a bug where the interpreter sucks ass.
|
||||
|
@ -61,31 +60,19 @@ async function Boostee() {
|
|||
}
|
||||
|
||||
Reply.onclick = (event) => {
|
||||
window.location.href = "../../HTML/post.html?website=" + website;
|
||||
window.location.href = "/post?website=" + website;
|
||||
}
|
||||
|
||||
// Other post stuff.
|
||||
for (let i of document.getElementsByClassName("Regular")) {
|
||||
i.onclick = (event) => {
|
||||
if (i.classList.contains("Handle")) {
|
||||
window.location.href = "../../HTML/account.html?website=" + website;
|
||||
window.location.href = "/account?website=" + website;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Selecting other posts.
|
||||
for (let i of document.getElementsByClassName("Parent")) {
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(Parentpost, i);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i of document.getElementsByClassName("GrandParent")) {
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(GrandParentpost, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Threads are the thing above the post you clicked.
|
||||
async function SetThreadPost(element, i) {
|
||||
if (website == "Mastodon") {
|
||||
localStorage.setItem("post", JSON.stringify(element));
|
||||
|
@ -94,22 +81,23 @@ async function SetThreadPost(element, i) {
|
|||
element.post = Temp.posts[0];
|
||||
localStorage.setItem("post", JSON.stringify(element));
|
||||
}
|
||||
localStorage.setItem("post", JSON.stringify(element));
|
||||
if (i.classList.contains("Handle")) {
|
||||
window.location.href = "../../HTML/account.html?website=" + website;
|
||||
window.location.href = "/account?website=" + website;
|
||||
} else {
|
||||
window.location.href = "../../HTML/expanded.html?website=" + website;
|
||||
window.location.href = "/expanded?website=" + website;
|
||||
}
|
||||
}
|
||||
|
||||
// Functions and things.
|
||||
async function GetPost() {
|
||||
if (website == "Mastodon") {
|
||||
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.acct;
|
||||
document.getElementsByClassName("Handle")[0].innerHTML = post.account.acct;
|
||||
// Check for a reblog.
|
||||
if (post.reblog != null) {
|
||||
document.getElementsByClassName("Handle Regular")[0].innerHTML += " ( R: " + post.reblog + " )";
|
||||
document.getElementsByClassName("Handle")[0].innerHTML += " ( R: " + post.reblog + " )";
|
||||
}
|
||||
document.getElementsByClassName("PostText Regular")[0].innerHTML = post.content;
|
||||
document.getElementsByClassName("PostText")[0].innerHTML = post.content;
|
||||
// Set the texts. It's opposite because "setting" causes it to switch.
|
||||
post = await MastodonAPI.GetStatus(post.id);
|
||||
FavoriteFlipper = !(post.favourited);
|
||||
|
@ -119,32 +107,53 @@ async function GetPost() {
|
|||
// Show the image if it exists.
|
||||
if (post.media_attachments.length != 0) {
|
||||
for (let i of post.media_attachments) {
|
||||
ApplyMedia(i, document.getElementsByClassName("Images Regular")[0]);
|
||||
ApplyMedia(i, document.getElementsByClassName("Images")[0]);
|
||||
}
|
||||
}
|
||||
// Now time to see if there are any parents
|
||||
if (post.in_reply_to_id != null) {
|
||||
Parentpost = await MastodonReplylFunction("Parent", post.in_reply_to_id);
|
||||
// Now time to see if there are any grandparents
|
||||
if (Parentpost != undefined && Parentpost.in_reply_to_id != null) {
|
||||
GrandParentpost = await MastodonReplylFunction("GrandParent", Parentpost.in_reply_to_id);
|
||||
// Now time to see if there are any parents.
|
||||
let NumberOfThreads = 0;
|
||||
let TemporaryPost = post;
|
||||
while (TemporaryPost.in_reply_to_id != null) {
|
||||
TemporaryPost = await MastodonThreadFunction(NumberOfThreads, TemporaryPost.in_reply_to_id);
|
||||
ThreadedPost.push(TemporaryPost);
|
||||
// Any posts? Give them the thing :3
|
||||
for (let i of document.getElementsByClassName(NumberOfThreads)) {
|
||||
let TempID = NumberOfThreads;
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(ThreadedPost[TempID], i);
|
||||
}
|
||||
}
|
||||
NumberOfThreads += 1;
|
||||
}
|
||||
// Replies, anyone?
|
||||
let Context = await MastodonAPI.GetContexts(post.id);
|
||||
for (let i of Context.descendants) {
|
||||
TemporaryPost = await MastodonReplyFunction(NumberOfThreads, i);
|
||||
ThreadedPost.push(TemporaryPost);
|
||||
// Any posts? Give them the thing :3
|
||||
for (let j of document.getElementsByClassName(NumberOfThreads)) {
|
||||
let TempID = NumberOfThreads;
|
||||
j.onclick = (event) => {
|
||||
SetThreadPost(ThreadedPost[TempID], j);
|
||||
}
|
||||
}
|
||||
NumberOfThreads += 1;
|
||||
}
|
||||
} else if (website == "Bluesky") {
|
||||
// Check for a reblog.
|
||||
if (post.hasOwnProperty("reason") && post.reason.$type == "app.bsky.feed.defs#reasonRepost") {
|
||||
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.post.author.handle + " ( R: " + post.reason.by.handle + " )";
|
||||
document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle + " ( R: " + post.reason.by.handle + " )";
|
||||
} else {
|
||||
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.post.author.handle;
|
||||
document.getElementsByClassName("Handle")[0].innerHTML = post.post.author.handle;
|
||||
}
|
||||
// Text. This will be modified later.
|
||||
var Text = await BlueskyAPI.ApplyFacets(post.post.record, post.post.record.text);
|
||||
// Place the text.
|
||||
Text = Text.replace(/\r?\n|\r/g, "<br/>");
|
||||
document.getElementsByClassName("PostText Regular")[0].innerHTML = Text;
|
||||
document.getElementsByClassName("PostText")[0].innerHTML = Text;
|
||||
// Show the image if it exists.
|
||||
if (post.post.record.hasOwnProperty("embed")) {
|
||||
ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images Regular")[0], post.post.author.did);
|
||||
ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images")[0], post.post.author.did);
|
||||
}
|
||||
// We don't need to update the post with new information. The repos are seperate.
|
||||
// Set the texts. It's opposite because "setting" causes it to switch.
|
||||
|
@ -159,56 +168,121 @@ async function GetPost() {
|
|||
SetFavorite();
|
||||
SetBoost();
|
||||
// Now time to see if there are any parents.
|
||||
if (post.hasOwnProperty("reply")) {
|
||||
Parentpost = await BlueskyReplyFunction("Parent", post.reply.parent, post.reply.parent.author);
|
||||
// Now time to see if there are any grandparents.
|
||||
if (Parentpost.value.hasOwnProperty("reply")) {
|
||||
GrandParentpost = await BlueskyReplyFunction("GrandParent", Parentpost.value.reply.parent, post.reply.grandparentAuthor);
|
||||
let NumberOfThreads = 0;
|
||||
let TemporaryPost = post;
|
||||
while (TemporaryPost.hasOwnProperty("reply")) {
|
||||
TemporaryPost = await BlueskyThreadFunction(NumberOfThreads, TemporaryPost.reply.parent);
|
||||
ThreadedPost.push(TemporaryPost);
|
||||
// Any posts? Give them the thing :3
|
||||
for (let i of document.getElementsByClassName(NumberOfThreads)) {
|
||||
let TempID = NumberOfThreads;
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(ThreadedPost[TempID], i);
|
||||
}
|
||||
}
|
||||
NumberOfThreads += 1;
|
||||
}
|
||||
// Replies, anyone?
|
||||
let Context = await BlueskyAPI.GetPostThread(post.post.uri);
|
||||
console.log(Context);
|
||||
for (let i of Context.thread.replies) {
|
||||
TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i);
|
||||
ThreadedPost.push(TemporaryPost);
|
||||
// Any posts? Give them the thing :3
|
||||
for (let j of document.getElementsByClassName(NumberOfThreads)) {
|
||||
let TempID = NumberOfThreads;
|
||||
j.onclick = (event) => {
|
||||
SetThreadPost(ThreadedPost[TempID], j);
|
||||
}
|
||||
}
|
||||
NumberOfThreads += 1;
|
||||
}
|
||||
} else {
|
||||
document.getElementsByClassName("PostText")[0].innerHTML = "Nothing to load.";
|
||||
}
|
||||
}
|
||||
|
||||
// Because of repeat code, we can put it into it's own function. Hell, more of a thread can be added later.
|
||||
async function MastodonReplylFunction(ClassName, post) {
|
||||
// Because of repeat code, we can put it into it's own function. It grabs posts "above" it.
|
||||
async function MastodonThreadFunction(Id, post) {
|
||||
let OtherPost = await MastodonAPI.GetStatus(post);
|
||||
document.getElementsByClassName("Origin " + ClassName)[0].innerHTML = website;
|
||||
document.getElementsByClassName("Handle " + ClassName)[0].innerHTML = post.account.acct;
|
||||
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + OtherPost.account.acct + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
|
||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin", ShitHTML);
|
||||
if (OtherPost.spoiler_text != "") {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = "WARNING: " + OtherPost.spoiler_text;
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = "WARNING: " + OtherPost.spoiler_text;
|
||||
} else {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = OtherPost.content;
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = OtherPost.content;
|
||||
if (OtherPost.media_attachments.length != 0) {
|
||||
for (let i of OtherPost.media_attachments) {
|
||||
ApplyMedia(i, document.getElementsByClassName("Images " + ClassName)[0]);
|
||||
ApplyMedia(i, document.getElementsByClassName("Images " + Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
return OtherPost;
|
||||
}
|
||||
|
||||
async function BlueskyReplyFunction(ClassName, post, OtherAuthor) {
|
||||
let OtherPost = await BlueskyAPI.GetRecord(post.uri.split("/")[2], post.uri.split("/")[3], post.uri.split("/")[4]);
|
||||
document.getElementsByClassName("Origin " + ClassName)[0].innerHTML = website;
|
||||
document.getElementsByClassName("Handle " + ClassName)[0].innerHTML = OtherAuthor.handle;
|
||||
Text = BlueskyAPI.ApplyFacets(OtherPost.value, OtherPost.value.text);
|
||||
async function MastodonReplyFunction(Id, post) {
|
||||
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + post.account.acct + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
|
||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend", ShitHTML);
|
||||
if (post.spoiler_text != "") {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = "WARNING: " + post.spoiler_text;
|
||||
} else {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = post.content;
|
||||
if (post.media_attachments.length != 0) {
|
||||
for (let i of post.media_attachments) {
|
||||
ApplyMedia(i, document.getElementsByClassName("Images " + Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
return post;
|
||||
}
|
||||
|
||||
// Because of repeat code, we can put it into it's own function. It grabs posts "above" it.
|
||||
async function BlueskyThreadFunction(Id, post) {
|
||||
let OtherPost = await BlueskyAPI.GetPosts([post.uri]);
|
||||
OtherPost = OtherPost.posts[0];
|
||||
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + OtherPost.author.handle + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
|
||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin", ShitHTML);
|
||||
Text = BlueskyAPI.ApplyFacets(OtherPost.record, OtherPost.record.text);
|
||||
Text = Text.replace(/\r?\n|\r/g, "<br/>");
|
||||
// Sensitive topic :3
|
||||
if (OtherPost.value.hasOwnProperty("labels") && OtherPost.value.labels.length != 0) {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = "LABELS APPLIED: ";
|
||||
if (OtherPost.record.hasOwnProperty("labels") && OtherPost.record.labels.length != 0) {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = "LABELS APPLIED: ";
|
||||
for (let lab of OtherPost.value.labels.values) {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML += lab.val + " ";
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " ";
|
||||
}
|
||||
} else {
|
||||
document.getElementsByClassName("PostText " + ClassName)[0].innerHTML = Text;
|
||||
if (OtherPost.value.hasOwnProperty("embed")) {
|
||||
ApplyMedia(OtherPost.value.embed, document.getElementsByClassName("Images " + ClassName)[0], OtherAuthor.did);
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text;
|
||||
if (OtherPost.record.hasOwnProperty("embed")) {
|
||||
ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], OtherPost.author.did);
|
||||
}
|
||||
}
|
||||
// Get the reply and make it make sense.
|
||||
if (OtherPost.record.hasOwnProperty("reply")) {
|
||||
OtherPost.reply = OtherPost.record.reply;
|
||||
}
|
||||
return OtherPost;
|
||||
}
|
||||
|
||||
async function BlueskyReplyFunction(Id, post) {
|
||||
let ShitHTML = "<header> <h1 class=\"Handle " + Id + "\"> " + post.post.author.handle + "</h1> <h2 class=\"Origin " + Id + "\"> " + website + "</h2> </header> <p class=\"PostText " + Id + "\"></p> <div class=\"Images " + Id + "\"></div> <hr/>";
|
||||
document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend", ShitHTML);
|
||||
Text = BlueskyAPI.ApplyFacets(post.post.record, post.post.record.text);
|
||||
Text = Text.replace(/\r?\n|\r/g, "<br/>");
|
||||
// Sensitive topic :3
|
||||
if (post.post.record.hasOwnProperty("labels") && post.post.record.labels.length != 0) {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = "LABELS APPLIED: ";
|
||||
for (let lab of post.post.value.labels.values) {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " ";
|
||||
}
|
||||
} else {
|
||||
document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text;
|
||||
if (post.post.record.hasOwnProperty("embed")) {
|
||||
ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images " + Id)[0], post.post.author.did);
|
||||
}
|
||||
}
|
||||
return post;
|
||||
}
|
||||
|
||||
// Applyers. Essentially applies a thing to an operation.
|
||||
// Finds any associated media and applies it to the post.
|
||||
async function ApplyMedia(Media, Element, Author = undefined) {
|
|
@ -1,7 +1,7 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
// GLOBAL VARS
|
||||
// fuck you. I see why website developers use divs so fucking often.
|
||||
|
@ -151,7 +151,7 @@ for (let i of ClickableContainers) {
|
|||
}
|
||||
// Save some info
|
||||
localStorage.setItem("post", JSON.stringify(post));
|
||||
document.location.href = "./HTML/expanded.html?website=" + website;
|
||||
document.location.href = "/expanded?website=" + website;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,18 +228,19 @@ async function PosterContainerUpdate(Direction) {
|
|||
}
|
||||
MastodonLoadedFeed = await MastodonLoadedFeed.concat(TempFeed);
|
||||
}
|
||||
// put the reblog into the regular post; Make changes as necessary.
|
||||
// Put the reblog into the regular post; Make changes as necessary.
|
||||
if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") {
|
||||
// Fix a reblog issue.
|
||||
let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.acct;
|
||||
MastodonLoadedFeed[CurrentThing + counter] = MastodonLoadedFeed[CurrentThing + counter].reblog;
|
||||
MastodonLoadedFeed[CurrentThing + counter].reblog = ReblogFix;
|
||||
i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
|
||||
i.getElementsByClassName("Username")[0].innerHTML = ReblogFix + " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
|
||||
} else if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog == "string") {
|
||||
// this function is if the changes are already made.
|
||||
i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
|
||||
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct + " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
|
||||
} else {
|
||||
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct;
|
||||
}
|
||||
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.acct + i.getElementsByClassName("Username")[0].innerHTML
|
||||
// Check for images.
|
||||
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) {
|
||||
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") {
|
||||
|
@ -255,7 +256,6 @@ async function PosterContainerUpdate(Direction) {
|
|||
// Content warning. Don't show the content unless clicked!!!
|
||||
if (MastodonLoadedFeed[CurrentThing + counter].spoiler_text != "") {
|
||||
i.getElementsByClassName("PostContent")[0].innerHTML += "<b>WARNING: " + MastodonLoadedFeed[CurrentThing + counter].spoiler_text + "</b>";
|
||||
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username;
|
||||
break;
|
||||
}
|
||||
i.getElementsByClassName("PostContent")[0].innerHTML += MastodonLoadedFeed[CurrentThing + counter].content;
|
||||
|
@ -274,6 +274,12 @@ async function PosterContainerUpdate(Direction) {
|
|||
}
|
||||
BlueskyLoadedFeed = await BlueskyLoadedFeed.concat(TempFeed);
|
||||
}
|
||||
// Check for a reblog.
|
||||
if (BlueskyLoadedFeed[CurrentThing + counter].hasOwnProperty("reason") && BlueskyLoadedFeed[CurrentThing + counter].reason.$type == "app.bsky.feed.defs#reasonRepost") {
|
||||
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle + " ( R: " + BlueskyLoadedFeed[CurrentThing + counter].reason.by.handle + " )";
|
||||
} else {
|
||||
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
|
||||
}
|
||||
// check for "already seen" posts, then put it as a seen post.
|
||||
BlueskyLoadedFeed = CheckForDups(BlueskyLoadedFeed, BlueskyPostsDup, counter);
|
||||
BlueskyPostsDup.push(BlueskyLoadedFeed[counter].post.uri);
|
||||
|
@ -296,19 +302,12 @@ async function PosterContainerUpdate(Direction) {
|
|||
// Labels
|
||||
if (BlueskyLoadedFeed[CurrentThing + counter].post.labels.length != 0) {
|
||||
i.getElementsByClassName("PostContent")[0].innerHTML += "<b>LABELS APPLIED: ";
|
||||
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
|
||||
for (let lab of BlueskyLoadedFeed[CurrentThing + counter].post.labels) {
|
||||
i.getElementsByClassName("PostContent")[0].innerHTML += lab.val + " ";
|
||||
}
|
||||
i.getElementsByClassName("PostContent")[0].innerHTML += "</b>";
|
||||
break;
|
||||
}
|
||||
// Check for a reblog.
|
||||
if (BlueskyLoadedFeed[CurrentThing + counter].hasOwnProperty("reason") && BlueskyLoadedFeed[CurrentThing + counter].reason.$type == "app.bsky.feed.defs#reasonRepost") {
|
||||
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle + " ( R: " + BlueskyLoadedFeed[CurrentThing + counter].reason.by.handle + " )";
|
||||
} else {
|
||||
i.getElementsByClassName("Username")[0].innerHTML = BlueskyLoadedFeed[CurrentThing + counter].post.author.handle;
|
||||
}
|
||||
// Apply correct facets.
|
||||
let TempText = await BlueskyAPI.ApplyFacets(BlueskyLoadedFeed[CurrentThing + counter].post.record, BlueskyLoadedFeed[CurrentThing + counter].post.record.text);
|
||||
TempText = TempText.replace(/\r?\n|\r/g, "<br/>");
|
||||
|
@ -341,23 +340,23 @@ function CheckForDups(Timeline, DupeArray, counter) {
|
|||
|
||||
// Open the settings.
|
||||
SettingButton.onclick = (event) => {
|
||||
window.location.href = "./HTML/setting.html";
|
||||
window.location.href = "/setting";
|
||||
}
|
||||
|
||||
// Open the notifs, private message, favorites, ... anything mail related!
|
||||
MailButton.onclick = (event) => {
|
||||
window.location.href = "./HTML/mail.html";
|
||||
window.location.href = "/mail";
|
||||
}
|
||||
|
||||
// A quick way of opening the account.
|
||||
// In theory, this should be in another "channel" or the mail area, but those areas are crowded.
|
||||
TimeAccountButton.onclick = (event) => {
|
||||
window.location.href = "./HTML/account.html";
|
||||
window.location.href = "/account";
|
||||
}
|
||||
|
||||
// Open the posting area.
|
||||
PostingButton.onclick = (event) => {
|
||||
window.location.href = "./HTML/post.html";
|
||||
window.location.href = "/post";
|
||||
}
|
||||
|
||||
// Change the feed to a "public" feed.
|
|
@ -1,7 +1,7 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
// Below is the thing it populates if you login.
|
||||
async function PopulateFavorites() {
|
|
@ -1,7 +1,7 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
// Elements.
|
||||
let PostButton = document.getElementsByClassName("Button")[0];
|
||||
|
@ -36,7 +36,7 @@ async function Post() {
|
|||
// Adding tags
|
||||
let TempText = Text;
|
||||
let Tags = TagsInputArea.value.split(";");
|
||||
if (Tags.length > 1) {
|
||||
if (Tags.length >= 1) {
|
||||
TempText += "<br/><br/>";
|
||||
}
|
||||
for (let i of Tags) {
|
|
@ -1,8 +1,8 @@
|
|||
import * as MastodonAPI from "./MastodonAPI.js";
|
||||
import * as BlueskyAPI from "./BlueskyAPI.js";
|
||||
import * as TumblrAPI from "./TumblrAPI.js";
|
||||
import * as YoutubeAPI from "./YoutubeAPI.js";
|
||||
import * as Variables from "./Variables.js";
|
||||
import * as MastodonAPI from "/JS/MastodonAPI.js";
|
||||
import * as BlueskyAPI from "/JS/BlueskyAPI.js";
|
||||
import * as TumblrAPI from "/JS/TumblrAPI.js";
|
||||
import * as YoutubeAPI from "/JS/YoutubeAPI.js";
|
||||
import * as Variables from "/JS/Variables.js";
|
||||
|
||||
// Settings buttons
|
||||
let RemoteButton = document.getElementsByClassName("Remote")[0];
|
||||
|
@ -22,7 +22,7 @@ let YoutubeHandleInput = document.getElementsByClassName("WebInput Youtube")[1];
|
|||
let YoutubeLogoutButton = document.getElementsByClassName("Logout Youtube")[0];
|
||||
|
||||
// original link
|
||||
let Origin = location.origin + "/HTML/setting.html"
|
||||
let Origin = location.origin + "/setting"
|
||||
|
||||
// Allow the user to change if Remote is a thing or not.
|
||||
RemoteButton.onclick = (event) => {
|
|
@ -9,7 +9,7 @@
|
|||
"refresh_token"
|
||||
],
|
||||
"redirect_uris": [
|
||||
"https://fedi.crowdedgames.group/HTML/setting.html"
|
||||
"https://fedi.crowdedgames.group/setting"
|
||||
],
|
||||
"response_types": [
|
||||
"code"
|
122
src/main.rs
Normal file
|
@ -0,0 +1,122 @@
|
|||
#![allow(non_snake_case)]
|
||||
#![allow(unused_braces)]
|
||||
use rouille::{router, Response};
|
||||
use std::fs::File;
|
||||
|
||||
fn main() {
|
||||
// Never leave the server. CTRL + C if you have issues.
|
||||
rouille::start_server("127.0.0.1:5001", move |Request| {
|
||||
// Router. Go to the correct pages, else hit the sack.
|
||||
router!(Request,
|
||||
// Icons.
|
||||
(GET) ["/Icons/ArrowLeft.png"] => {
|
||||
Response::from_file("image/png", File::open("src/HTTP/Icons/ArrowLeft.png").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Icons/ArrowRight.png"] => {
|
||||
Response::from_file("image/png", File::open("src/HTTP/Icons/ArrowRight.png").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Icons/favicon.ico"] => {
|
||||
Response::from_file("image/vnd.microsoft.icon", File::open("src/HTTP/Icons/favicon.ico").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Icons/IndexBackground.png"] => {
|
||||
Response::from_file("image/png", File::open("src/HTTP/Icons/IndexBackground.png").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Icons/IndexBlackBackground.png"] => {
|
||||
Response::from_file("image/png", File::open("src/HTTP/Icons/IndexBlackBackground.png").unwrap()).with_status_code(200)
|
||||
},
|
||||
// Audio.
|
||||
(GET) ["/Audio/button-305770.mp3"] => {
|
||||
Response::from_file("audio/mpeg", File::open("src/HTTP/Audio/button-305770.mp3").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Audio/button-pressed-38129.mp3"] => {
|
||||
Response::from_file("audio/mpeg", File::open("src/HTTP/Audio/button-pressed-38129.mp3").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/Audio/soft-piano-music-312509.mp3"] => {
|
||||
Response::from_file("audio/mpeg", File::open("src/HTTP/Audio/soft-piano-music-312509.mp3").unwrap()).with_status_code(200)
|
||||
},
|
||||
// JS.
|
||||
(GET) ["/JS/index.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/index.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/account.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/account.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/expanded.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/expanded.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/mail.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/mail.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/post.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/post.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/setting.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/setting.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/BlueskyAPI.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/BlueskyAPI.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/MastodonAPI.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/MastodonAPI.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/TumblrAPI.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/TumblrAPI.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/YoutubeAPI.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/YoutubeAPI.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/JS/Variables.js"] => {
|
||||
Response::from_file("text/javascript", File::open("src/HTTP/JS/Variables.js").unwrap()).with_status_code(200)
|
||||
},
|
||||
// Robots.
|
||||
(GET) ["/robots.txt"] => {
|
||||
Response::from_file("text/plain", File::open("src/HTTP/robots.txt").unwrap()).with_status_code(200)
|
||||
},
|
||||
// Oauth.
|
||||
(GET) ["/oauth/client-metadata.json"] => {
|
||||
Response::from_file("application/json", File::open("src/HTTP/client-metadata.json").unwrap()).with_status_code(200)
|
||||
},
|
||||
// CSS.
|
||||
(GET) ["/CSS/index.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/index.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/CSS/account.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/account.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/CSS/expanded.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/expanded.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/CSS/mail.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/mail.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/CSS/post.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/post.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/CSS/setting.css"] => {
|
||||
Response::from_file("text/css", File::open("src/HTTP/CSS/setting.css").unwrap()).with_status_code(200)
|
||||
},
|
||||
// Actual Web Pages.
|
||||
(GET) ["/"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/index.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/account"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/account.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/expanded"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/expanded.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/mail"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/mail.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/post"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/post.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
(GET) ["/setting"] => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/setting.html").unwrap()).with_status_code(200)
|
||||
},
|
||||
_ => {
|
||||
Response::from_file("text/html", File::open("src/HTTP/HTML/404.html").unwrap()).with_status_code(404)
|
||||
},
|
||||
)
|
||||
});
|
||||
}
|