diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8c2f2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Node modules +node_modules/ + +# Vite build outputs +dist/* +!dist/.gitkeep + +# Editor files +.vscode/ +.idea/ +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# ESLint and Prettier configs (created by precommit script) +.eslintrc.json +.prettierrc.json diff --git a/.mentat/precommit.sh b/.mentat/precommit.sh new file mode 100755 index 0000000..e3a87c4 --- /dev/null +++ b/.mentat/precommit.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "Running formatters..." + +# Install Prettier if not already installed +if ! command -v prettier &> /dev/null; then + echo "Installing Prettier..." + npm install --no-save prettier +fi + +# Create Prettier config if it doesn't exist +if [ ! -f ".prettierrc.json" ]; then + echo '{ + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100 +}' > .prettierrc.json +fi + +# Run Prettier only on JavaScript and JSON files +# Skipping HTML files due to existing HTML syntax errors that Prettier can't fix +echo "Running Prettier on JavaScript and JSON files..." +npx prettier --write "**/*.js" "**/*.json" --ignore-path .gitignore + +# Note about ESLint +echo "Skipping ESLint due to configuration detection issues." +echo "To run ESLint manually, please use: npx eslint --fix **/*.js" + +echo "Precommit checks completed!" diff --git a/.mentat/setup.sh b/.mentat/setup.sh new file mode 100755 index 0000000..9b8a4b0 --- /dev/null +++ b/.mentat/setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +echo "Installing dependencies for the main project..." +npm install + +echo "Installing dependencies for the src project..." +cd src +npm install + +echo "Installing dependencies for the npm server components..." +cd npm +# Create package.json if it doesn't exist +if [ ! -f "package.json" ]; then + echo '{ + "name": "scratch-shop-server", + "version": "1.0.0", + "description": "Server components for Scratch Shop", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.18.2", + "axios": "^1.6.2", + "dotenv": "^16.3.1", + "body-parser": "^1.20.2", + "cors": "^2.8.5" + } +}' > package.json +fi +npm install + +# Return to root directory +cd ../.. + +echo "Setup completed successfully!" diff --git a/Partners/list.html b/Partners/list.html index f7d8577..382701b 100644 --- a/Partners/list.html +++ b/Partners/list.html @@ -1,19 +1,20 @@ - + Partners | Coding Hut - + - - - - -
-

Error:

-

404

-

Not Found

-

We are sorry, but the page you opened was not found.

-
- But here's what you could do! - -
- + diff --git a/src/Strikes/my-strikes.html b/src/Strikes/my-strikes.html index 4ee8722..d1484d6 100644 --- a/src/Strikes/my-strikes.html +++ b/src/Strikes/my-strikes.html @@ -1,8 +1,8 @@ - + Strike Info | Coding Hut Website - + - + - + - +

My Strikes

No Strike ID

- Make sure you got a valid link and come back. You may also not have any strikes at this time. If that's true, keep up the good work! + Make sure you got a valid link and come back. You may also not have any strikes at this time. + If that's true, keep up the good work!

Username 1

1 Strike

-
+
Oops! You currently have 1 Strike at Coding Hut. Look below to see your strikes.

Staff2

-
+
DESCRIPTION HERE

Staff3

-
+
DESCRIPTION HERE
- + - + diff --git a/src/Wiki/edit.html b/src/Wiki/edit.html index 50f8673..9cdf983 100644 --- a/src/Wiki/edit.html +++ b/src/Wiki/edit.html @@ -1,203 +1,207 @@ - + - - - - Edit Scratch Coding Hut Wiki - - - -

Edit Scratch Coding Hut Wiki

- -
-

Edit Wiki Post

-
- - - -
-
- - - + try { + const response = await fetch(`${backendUrl}/wikis/${wikiId}`, { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + title: updatedTitle, + content: updatedContent, + owner: username, + }), + }); + + if (response.ok) { + alert('Wiki updated successfully!'); + window.location.href = 'sitemaplinks.html'; // Redirect to Wiki list page after saving + } else { + const errorDetails = await response.json(); + console.error('Failed to update wiki:', errorDetails); + alert('Failed to update wiki. Please try again.'); + } + } catch (error) { + console.error('Error updating wiki:', error); + alert('Error updating wiki. Please check your connection or try again later.', error); + } + }); + + // Initialize the page with the wiki data + fetchWiki(); + }); + + diff --git a/src/Wiki/post.html b/src/Wiki/post.html index 2ccb3e8..abc730b 100644 --- a/src/Wiki/post.html +++ b/src/Wiki/post.html @@ -1,37 +1,37 @@ - + - - - + + + Create New Topic - - + +

Create a New Topic

- - - + + +
- + diff --git a/src/Wiki/sitemaplinks.html b/src/Wiki/sitemaplinks.html index a0c8eba..7b6f533 100644 --- a/src/Wiki/sitemaplinks.html +++ b/src/Wiki/sitemaplinks.html @@ -1,76 +1,76 @@ - + - - - - Scratch Coding Hut Forum - - - -

Scratch Coding Hut Forum

- Wait on tight whioe we redirect you to the real wiki and coding hut forums. Trust Coding Hut, it won't take long at all. + + + + Scratch Coding Hut Forum + + + +

Scratch Coding Hut Forum

+ Wait on tight whioe we redirect you to the real wiki and coding hut forums. Trust Coding Hut, it + won't take long at all. - -
- +
+ - - + loadTopics(currentPage); + + diff --git a/src/Wiki/topic_template.html b/src/Wiki/topic_template.html index 4ff2450..c4905e8 100644 --- a/src/Wiki/topic_template.html +++ b/src/Wiki/topic_template.html @@ -1,64 +1,67 @@ - + - - - + + + Topic - Topic Name - - + +

Topic Title

- +

Add a Comment

- - - + + +
- + diff --git a/src/Wiki/wiki-guidelines.html b/src/Wiki/wiki-guidelines.html index ebea0af..121fcdc 100644 --- a/src/Wiki/wiki-guidelines.html +++ b/src/Wiki/wiki-guidelines.html @@ -1,12 +1,14 @@ - -Wiki Guidelines Coding Hut - -

Coding Hut

-

Wiki Guidelines

-1. Don't delete wiki posts for no reason, and don't abuse the deletion function. Abusing the deletion system can get you banned. -
-2. Don't put innappropite content on the Wiki, and make sure the content follows the Wiki Guidelines, the Coding Hut Rules and the Scratch Commuinity Guidelines. -
-3. Don't vandlise the wiki. + + Wiki Guidelines Coding Hut + +

Coding Hut

+

Wiki Guidelines

+ 1. Don't delete wiki posts for no reason, and don't abuse the deletion function. Abusing the + deletion system can get you banned. +
+ 2. Don't put innappropite content on the Wiki, and make sure the content follows the Wiki + Guidelines, the Coding Hut Rules and the Scratch Commuinity Guidelines. +
+ 3. Don't vandlise the wiki. diff --git a/src/about.html b/src/about.html index 1b109ed..8ac171a 100644 --- a/src/about.html +++ b/src/about.html @@ -1,258 +1,263 @@ - + - - + Scratch Login | Login & Dashboard | Coding Hut - + - +
-

Scratch Authentication

+

Scratch Authentication

-
-

-
- -
- -
-

For You

- -
- - -
-

Developer Tokens

-

Used for linking Scratch account to forums account

-

- - Coming Soon! Stay tuned -
+
+

+
+ +
+ +
+

For You

+ +
+ + +
+

Developer Tokens

+

Used for linking Scratch account to forums account

+

+ + Coming Soon! Stay tuned +
-
-

Welcome! Please log in to continue.

- -

-

Please note: You will be redirected to an external site (ScratchAuth) for authentication.

-
- -
- - - -
+
+

Welcome! Please log in to continue.

+ +

+

+ Please note: You will be redirected to an external site (ScratchAuth) for authentication. +

+
+ +
+ + + +
- - + diff --git a/src/account.html b/src/account.html index 13b5398..cf4e7d0 100644 --- a/src/account.html +++ b/src/account.html @@ -1,279 +1,295 @@ - + - - + Scratch Login | Login & Dashboard | Coding Hut - + - +
-

Scratch Authentication

+

Scratch Authentication

-
-

-
- -
- -
-

For You

- -
- - -
-

Developer Tokens

-

Used for linking Scratch account to forums account

-

- -
- - +
+

+
+ +
+ +
+

For You

+ +
+ + +
+

Developer Tokens

+

Used for linking Scratch account to forums account

+

+ +
+
+ + +
+

Developer Key Status

+
+ You can see the status of your account's key, upgrade your account's key, and disable your + account's developer key here +
+ -PUT STATUS HERE- + + -
-

Developer Key Status

-
You can see the status of your account's key, upgrade your account's key, and disable your account's developer key here
- -PUT STATUS HERE- - - - -
+
-
-

Welcome! Please log in to continue.

- -

-

Please note: You will be redirected to an external site (ScratchAuth) for authentication.

-
- -
-

Are you logging in via the API or via a bot?

- Instead of logging in with Scratch Auth, make sure to use your API Key! You can get one by logging in with Scratch Auth and clicking Generate Developer Token. - - - +
+

Welcome! Please log in to continue.

+ +

+

+ Please note: You will be redirected to an external site (ScratchAuth) for authentication. +

+
+ +
- - -
- +
+
+ + + + Don't have access to Github? Or do you perfer the Coding Hut Forums? +
+ + diff --git a/src/api/orders.html b/src/api/orders.html index f376548..e094631 100644 --- a/src/api/orders.html +++ b/src/api/orders.html @@ -1,88 +1,90 @@ - + Coding Hut Orders API - + -.dynamic-content { - display:none; -} - - - + - -
-{"status": 400, "error": "Invaild Request - Username does not exist in orders database"} -
- -
-{"status": 500, "completed-orders": 6, "pending-orders": 0} -
-
- -
-

Staff2

-
-DESCRIPTION HERE -
- -
-

Staff3

-
-DESCRIPTION HERE -
+ +
+ {"status": 400, "error": "Invaild Request - Username does not exist in orders database"} +
+ +
+ {"status": 500, "completed-orders": 6, "pending-orders": 0} +
+
+ +
+

Staff2

+
+ DESCRIPTION HERE +
+ +
+

Staff3

+
+ DESCRIPTION HERE +
- + + + + - + $(document).ready(function () { + // Check if the URL parameter is apples + if (dynamicContent == 'MyScratchedAccount') { + $('#MyScratchedAccount').show(); + } + // Check if the URL parameter is oranges + else if (dynamicContent == 'staff2') { + $('#staff2').show(); + } + // Check if the URL parameter is bananas + else if (dynamicContent == 'staff3') { + $('#staff3').show(); + } + // Check if the URL parmeter is empty or not defined, display default content + else { + $('#default-content').show(); + } + }); + + + diff --git a/src/auth.html b/src/auth.html index fcfe663..9531a47 100644 --- a/src/auth.html +++ b/src/auth.html @@ -1,13 +1,19 @@ - + - + Scratch Authentication Hold on tight for a second while we make the scratch authentication magic come true. -

Scratch Auth - Wern't you aready logged in?

-

You're AREADY authenticated as {{ username }}

+

+ Scratch Auth - Wern't you aready logged in? +

+

You're AREADY authenticated as {{ username }}

diff --git a/src/deploy/canuseDeploy.json b/src/deploy/canuseDeploy.json index c022bb6..7b5650d 100644 --- a/src/deploy/canuseDeploy.json +++ b/src/deploy/canuseDeploy.json @@ -1,8 +1,8 @@ { -// For the Deploy Role, you can use Admin, Manage or Deploy. -"can-use-deploy":[ - {"username":"MyScratchedAccount", "deployRole":"Admin"}, - {"username":"ALLOWEDUSER2", "deployRole":"Manage"}, - {"username":"ALOWEDUSER3", "deployRole":"Deploy"} -] + // For the Deploy Role, you can use Admin, Manage or Deploy. + "can-use-deploy": [ + { "username": "MyScratchedAccount", "deployRole": "Admin" }, + { "username": "ALLOWEDUSER2", "deployRole": "Manage" }, + { "username": "ALOWEDUSER3", "deployRole": "Deploy" } + ] } diff --git a/src/deploy/home.html b/src/deploy/home.html index 0204564..a9a7873 100644 --- a/src/deploy/home.html +++ b/src/deploy/home.html @@ -1,90 +1,127 @@ - + - - - + + + About Deploy | Scratch Coding Hut - - - + + + - - -
- - + + +
+ +
-
-

Welcome to ScratchURL

-

Deploy By Coding Hut Is An Application To Manage Website Hosting & Deployment Related Requests (for coding hut)

- -
+
+

Welcome to ScratchURL

+

+ Deploy By Coding Hut Is An Application To Manage Website Hosting & Deployment Related + Requests (for coding hut) +

+ +
-
-

About Us

-

This is the about section. Tell us about your company or yourself.

-
- About Us -
-
+
+

About Us

+

+ This is the about section. Tell us about your company or yourself. +

+
+ About Us +
+
-
-

Our Services

-
-
-

Service 1

-

Description of service 1.

-
-
-

Service 2

-

Description of service 2.

-
-
-

Service 3

-

Description of service 3.

-
-
-
+
+

Our Services

+
+
+

Service 1

+

Description of service 1.

+
+
+

Service 2

+

Description of service 2.

+
+
+

Service 3

+

Description of service 3.

+
+
+
-
-

Contact Us

-

Get in touch with us using the form below.

-
-
- -
-
- -
-
- -
- -
-
+
+

Contact Us

+

Get in touch with us using the form below.

+
+
+ +
+
+ +
+
+ +
+ +
+
- - + + diff --git a/src/google0bd18e79f285dd20.html b/src/google0bd18e79f285dd20.html index fd8ed58..13e3b50 100644 --- a/src/google0bd18e79f285dd20.html +++ b/src/google0bd18e79f285dd20.html @@ -1 +1 @@ -google-site-verification: google0bd18e79f285dd20.html \ No newline at end of file +google-site-verification: google0bd18e79f285dd20.html diff --git a/src/google152e72ba02049324.html b/src/google152e72ba02049324.html index a49cf5c..003a3fe 100644 --- a/src/google152e72ba02049324.html +++ b/src/google152e72ba02049324.html @@ -1 +1 @@ -google-site-verification: google152e72ba02049324.html \ No newline at end of file +google-site-verification: google152e72ba02049324.html diff --git a/src/gulpfile.js b/src/gulpfile.js index ec9fb4b..188272a 100644 --- a/src/gulpfile.js +++ b/src/gulpfile.js @@ -8,51 +8,46 @@ const browserSync = require('browser-sync').create(); // Paths for files const paths = { - html: './src/*.html', - css: './src/*.css', - js: './src/*.js', + html: './src/*.html', + css: './src/*.css', + js: './src/*.js', }; // Copy HTML to dist function copyHtml() { - return src(paths.html) - .pipe(dest(paths.dist)) - .pipe(browserSync.stream()); + return src(paths.html).pipe(dest(paths.dist)).pipe(browserSync.stream()); } // Minify CSS function minifyCss() { - return src(paths.css) - .pipe(concat('style.min.css')) - .pipe(cleanCSS()) - .pipe(dest(`${paths.dist}/css`)) - .pipe(browserSync.stream()); + return src(paths.css) + .pipe(concat('style.min.css')) + .pipe(cleanCSS()) + .pipe(dest(`${paths.dist}/css`)) + .pipe(browserSync.stream()); } // Minify and bundle JS function minifyJs() { - return src(paths.js) - .pipe(concat('script.min.js')) - .pipe(uglify()) - .pipe(dest(`${paths.dist}/js`)) - .pipe(browserSync.stream()); + return src(paths.js) + .pipe(concat('script.min.js')) + .pipe(uglify()) + .pipe(dest(`${paths.dist}/js`)) + .pipe(browserSync.stream()); } // Live server function serve() { - browserSync.init({ - server: { - baseDir: paths.dist, - }, - }); + browserSync.init({ + server: { + baseDir: paths.dist, + }, + }); - watch(paths.html, copyHtml); - watch(paths.css, minifyCss); - watch(paths.js, minifyJs); + watch(paths.html, copyHtml); + watch(paths.css, minifyCss); + watch(paths.js, minifyJs); } // Default task -exports.default = series( - parallel(copyHtml, minifyCss, minifyJs), - serve -); +exports.default = series(parallel(copyHtml, minifyCss, minifyJs), serve); diff --git a/src/message_person.html b/src/message_person.html index 0e8122d..3f801b6 100644 --- a/src/message_person.html +++ b/src/message_person.html @@ -1,136 +1,150 @@ - + - + Send Messages | Coding Hut Website - + - - + +
Send Messages
- +
-
- - + + + - - + + - -
+ +
Message sent!
- + diff --git a/src/messages.html b/src/messages.html index 257ad77..f0b90fc 100644 --- a/src/messages.html +++ b/src/messages.html @@ -1,8 +1,8 @@ - + - - + + Messages | Coding Hut @@ -104,21 +108,21 @@ -