Skip to content

Commit 6a7cbac

Browse files
committed
Immediate: Legal stuff
1 parent 8cb040a commit 6a7cbac

6 files changed

Lines changed: 278 additions & 2 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Jason Glen Evans (Gvbvdxx) & Im_CatmanYT
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
"html-webpack-plugin": "^5.6.3",
2222
"http": "^0.0.1-security",
2323
"jszip": "^3.10.1",
24+
"license-webpack-plugin": "^4.0.2",
2425
"nodemon": "^3.1.10",
2526
"process": "^0.11.10",
2627
"raw-loader": "^4.0.2",
2728
"url-loader": "^4.1.1",
2829
"webpack": "^5.97.1",
2930
"webpack-cli": "^6.0.1",
31+
"webpack-license-plugin": "^4.5.1",
3032
"ws": "^8.18.3"
3133
},
3234
"license": "MIT",

src/pages/about.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,22 @@ var randomRantsAbout = [
551551
},
552552
],
553553
},
554+
{
555+
element: "p",
556+
style: { fontSize: "1em", marginBottom: "1em" },
557+
children: [
558+
{
559+
element: "span",
560+
textContent:
561+
"Credits can be found ",
562+
},
563+
{
564+
element: "a",
565+
href: "./credits",
566+
textContent: "here.",
567+
},
568+
],
569+
},
554570
];
555571

556572
var elementJSON = [

src/pages/credits.js

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
require("../cookiewarning");
2+
require("./stylesheet.js");
3+
require("./navigate-loader.js");
4+
5+
document.title = "Random Rants + | Credits";
6+
7+
var menuBar = require("../menu.js");
8+
var elements = require("../gp2/elements.js");
9+
10+
// Refined helper function
11+
function generateLicenseElement(license) {
12+
// 1. Prepare children array safely
13+
var licenseChildren = [
14+
{
15+
element: "strong",
16+
textContent: `${license.name || "Unknown Package"} (v${license.version || "?"})`
17+
},
18+
{ element: "br" }
19+
];
20+
21+
// 2. Only add Author if it exists
22+
if (license.author) {
23+
licenseChildren.push({
24+
element: "span",
25+
textContent: `By ${license.author}`
26+
});
27+
licenseChildren.push({ element: "br" });
28+
}
29+
30+
// 3. Only add Source if it exists
31+
if (license.source) {
32+
var sourceChild;
33+
// Check if it's a URL or just text
34+
if (license.source.startsWith("http")) {
35+
sourceChild = {
36+
element: "a",
37+
href: license.source,
38+
target: "_blank",
39+
textContent: "Source Code Repository",
40+
style: { color: "#4dabf7", textDecoration: "underline" } // Make link distinct
41+
};
42+
} else {
43+
sourceChild = {
44+
element: "span",
45+
textContent: "Source: " + license.source
46+
};
47+
}
48+
licenseChildren.push(sourceChild);
49+
licenseChildren.push({ element: "br" });
50+
}
51+
52+
// 4. Add License Type and Text
53+
licenseChildren.push(
54+
{
55+
element: "span",
56+
textContent: `License: ${license.license || "Unknown"}`
57+
},
58+
{
59+
element: "div", // Use div for text block to separate it
60+
textContent: license.licenseText || "No license text provided.",
61+
style: {
62+
marginTop: "5px",
63+
fontSize: "0.8em",
64+
opacity: "0.8",
65+
borderLeft: "2px solid #555",
66+
paddingLeft: "10px"
67+
}
68+
},
69+
{ element: "hr", style: { opacity: "0.2", margin: "10px 0" } } // Separator line
70+
);
71+
72+
return {
73+
element: "div",
74+
style: { marginBottom: "15px" },
75+
children: licenseChildren
76+
};
77+
}
78+
79+
var contentArray = [
80+
// Title and intro
81+
require("./sitenews-notice.js"),
82+
{
83+
element: "h1",
84+
textContent: "Random Rants + Credits",
85+
style: { fontSize: "2.2em", marginBottom: "0.5em" },
86+
children: [],
87+
},
88+
{
89+
element: "span",
90+
textContent: "Dig into the stuff that was used to make Random Rants +.",
91+
children: [],
92+
},
93+
{
94+
element: "p",
95+
textContent: "Random Rants + wouldn't be possible without these open-source projects:",
96+
style: { marginBottom: "10px" },
97+
children: [],
98+
},
99+
100+
// Tech Stack List
101+
{
102+
element: "div",
103+
style: {
104+
backgroundColor: "rgba(0, 0, 0, 0.3)", // Semi-transparent is safer for themes
105+
border: "1px solid rgba(255, 255, 255, 0.1)",
106+
color: "#ffffff",
107+
padding: "15px",
108+
borderRadius: "8px",
109+
fontSize: "0.9em",
110+
fontFamily: "monospace",
111+
marginBottom: "30px"
112+
},
113+
children: [
114+
{
115+
element: "ul",
116+
style: { margin: "0", paddingLeft: "20px" },
117+
children: [
118+
{
119+
element: "li",
120+
children: [
121+
{ element: "strong", textContent: "Node.js & HTTP Module: " },
122+
{ element: "span", textContent: "Backend server logic." }
123+
]
124+
},
125+
{
126+
element: "li",
127+
children: [
128+
{ element: "strong", textContent: "Webpack: " },
129+
{ element: "span", textContent: "Bundling our chaotic code for the UI." }
130+
]
131+
},
132+
{
133+
element: "li",
134+
children: [
135+
{ element: "strong", textContent: "Socket.io / Websockets: " },
136+
{ element: "span", textContent: "Real-time communication (Chat)." }
137+
]
138+
},
139+
{
140+
element: "li",
141+
children: [
142+
{ element: "strong", textContent: "Simple-Peer / WebRTC: " },
143+
{ element: "span", textContent: "P2P Video and Screen Sharing." }
144+
]
145+
},
146+
{
147+
element: "li",
148+
children: [
149+
{ element: "strong", textContent: "GvbvdxxMod2: " },
150+
{ element: "span", textContent: "My modified version of TurboWarp for the mini-games." }
151+
]
152+
}
153+
]
154+
},
155+
]
156+
},
157+
158+
// Automated License List
159+
{
160+
element: "h2",
161+
textContent: "Open Source Licenses",
162+
style: { fontSize: "1.5em", marginBottom: "10px" },
163+
children: [],
164+
},
165+
{
166+
element: "div",
167+
style: {
168+
backgroundColor: "rgba(0, 0, 0, 0.5)", // Semi-transparent
169+
border: "1px solid rgba(255, 255, 255, 0.1)",
170+
padding: "15px",
171+
borderRadius: "8px",
172+
fontSize: "0.9em",
173+
fontFamily: "monospace",
174+
maxHeight: "500px", // Scrollable so the page isn't 10 miles long
175+
overflowY: "auto",
176+
color: "#ffffff",
177+
},
178+
children: [
179+
{
180+
element: "div",
181+
GPWhenCreated: async function (elm) {
182+
elements.setInnerJSON(elm, [
183+
{
184+
element: "span",
185+
textContent: "Loading license data...",
186+
style: { fontStyle: "italic", opacity: "0.7" }
187+
}
188+
])
189+
190+
try{
191+
var response = await fetch("/licenses.json");
192+
if (!response.ok) {
193+
throw new Error("HTTP " + response.status);
194+
}
195+
var json = await response.json();
196+
197+
// Sort them alphabetically by name because it looks nicer
198+
json.sort((a, b) => (a.name || "").localeCompare(b.name || ""));
199+
200+
var arrayContent = json.map(generateLicenseElement);
201+
elements.setInnerJSON(elm, arrayContent);
202+
} catch(e) {
203+
console.error(e);
204+
elements.setInnerJSON(elm, [
205+
{
206+
element: "div",
207+
style: {
208+
color: "#ff6b6b", // Red error color
209+
fontWeight: "bold"
210+
},
211+
children: [
212+
{ element: "span", textContent: "Error loading licenses file." },
213+
{ element: "br" },
214+
{ element: "span", textContent: "Details: " + e.message }
215+
]
216+
}
217+
]);
218+
}
219+
}
220+
},
221+
]
222+
},
223+
];
224+
225+
var elementJSON = [
226+
{
227+
element: "div",
228+
className: "aboutDivCenter",
229+
children: contentArray,
230+
},
231+
];
232+
233+
var pageElements = elements.createElementsFromJSON(elementJSON);
234+
elements.appendElements(elements.body, pageElements);

webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require("path");
22
const CopyWebpackPlugin = require("copy-webpack-plugin");
33
const HtmlWebpackPlugin = require("html-webpack-plugin");
4+
const LicensePlugin = require('webpack-license-plugin');
45
const VersionUpdatePlugin = require("./versionstampplugin.js");
56
const webpack = require('webpack');
67

@@ -15,7 +16,8 @@ const pages = [
1516
"security",
1617
"sitenews",
1718
"history",
18-
"legal"
19+
"legal",
20+
"credits"
1921
];
2022
try {
2123
require("fs").rmSync("./public", { recursive: true });
@@ -120,5 +122,6 @@ module.exports = {
120122
new webpack.ProvidePlugin({
121123
process: 'process/browser',
122124
}),
125+
new LicensePlugin({ outputFilename: 'licenses.json' })
123126
],
124127
};

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1765376674305"}
1+
{"timestamp":"1765379765786"}

0 commit comments

Comments
 (0)