Skip to content

Commit c582681

Browse files
authored
Merge pull request #1 from cssnr/feedback
Feedback
2 parents 0a668f9 + 525dddc commit c582681

File tree

6 files changed

+281
-278
lines changed

6 files changed

+281
-278
lines changed

_layouts/default.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
Home</a></li>
5454
<li class="nav-item"><a class="nav-link {% if page.title == 'About' %}active{% endif %}" href="/about/">
5555
About</a></li>
56+
<li class="nav-item"><a class="nav-link {% if page.title == 'Feedback' %}active{% endif %}" href="/feedback/">
57+
Feedback</a></li>
5658
<li class="nav-item"><a class="nav-link" href="{{ site.github_url }}" target="_blank" rel="noopener">
5759
GitHub <i class="fa-solid fa-arrow-up-right-from-square"></i></a></li>
5860
</ul>
@@ -62,7 +64,7 @@
6264
</header>
6365

6466
<main class="flex-grow-1">
65-
<div class="container-fluid px-3">
67+
<div class="container-fluid px-3 h-100">
6668
{{ content }}
6769
</div>
6870
</main>
@@ -79,6 +81,8 @@
7981
<li class="list-inline-item"><a class="link-body-emphasis text-decoration-none {% if page.title == 'Home' %}fw-bold{% endif %}" href="/">Home</a></li>
8082
<li class="list-inline-item">|</li>
8183
<li class="list-inline-item"><a class="link-body-emphasis text-decoration-none {% if page.title == 'About' %}fw-bold{% endif %}" href="/about/">About</a></li>
84+
<li class="list-inline-item">|</li>
85+
<li class="list-inline-item"><a class="link-body-emphasis text-decoration-none {% if page.title == 'Feedback' %}fw-bold{% endif %}" href="/feedback/">Feedback</a></li>
8286
</ul>
8387
</div>
8488
</div>

feedback.html

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,26 @@
1414
<div class="d-flex flex-column h-100 align-items-center">
1515
<div class="d-flex flex-grow-1 justify-content-center align-items-center w-100">
1616
<div class="row flex-grow-1">
17-
<div class="col-sm-12 col-md-8 col-lg-6 m-auto">
17+
<div class="col-sm-12 col-md-10 col-lg-8 m-auto">
1818
<div id="login-outer" class="m-auto p-3">
1919
<div class="justify-content-center align-items-center mb-2 d-flex">
2020
<img src="/media/logo.png" class="img-fluid float-start me-2" alt="PlayDrift Extension" height="42" width="42">
2121
<h1 class="align-middle mb-0">{{ site.site_name }}</h1>
2222
</div>
23-
<p class="text-center">
24-
Feedback Form Under Construction!
23+
<p class="text-center lead">
24+
Provide General Feedback, Ask Questions, or Select an Application.
2525
</p>
2626
<form id="uninstall-form">
2727
<input type="hidden" value="{{ site.discord_webhook }}" id="discord-webhook" hidden="hidden">
28-
<div class="form-check form-switch fs-5">
29-
<input class="form-check-input" type="checkbox" role="switch" id="not-used">
30-
<label class="form-check-label text-success-emphasis" for="not-used">Do Not Need or Not Used</label>
31-
</div>
32-
<div class="form-check form-switch fs-5">
33-
<input class="form-check-input" type="checkbox" role="switch" id="not-expected">
34-
<label class="form-check-label text-warning-emphasis" for="not-expected">Does Not Work as Expected</label>
35-
</div>
36-
<div class="form-check form-switch fs-5">
37-
<input class="form-check-input" type="checkbox" role="switch" id="not-working">
38-
<label class="form-check-label text-danger-emphasis" for="not-working">Not Working or Broken</label>
39-
</div>
28+
29+
<select id="feedback" class="form-select form-select-lg mb-3" aria-label="Select Feedback Reason">
30+
<option value="General Feedback" selected>Select an Application (Optional)</option>
31+
</select>
32+
4033
<div class="my-2">
4134
<label for="uninstall-response" class="form-label visually-hidden">Uninstall Feedback</label>
42-
<textarea class="form-control" id="uninstall-response" rows="4" maxlength="500"
43-
placeholder="Optional Feedback. Bugs, Missing Features, etc..." autofocus></textarea>
35+
<textarea class="form-control" id="uninstall-response" rows="5" maxlength="500"
36+
placeholder="Questions, Comments, Concerns, etc..." autofocus></textarea>
4437
<span id="inputCounter" class="float-end label label-default"><span id="input-count">0</span> / 500</span>
4538
</div>
4639
<button id="submit-btn" class="btn btn-success w-100" type="submit">
@@ -53,4 +46,5 @@ <h1 class="align-middle mb-0">{{ site.site_name }}</h1>
5346
</div>
5447
</div>
5548

49+
<script type="text/javascript" src="/js/config.js"></script>
5650
<script type="text/javascript" src="/js/feedback.js"></script>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ <h4 class="card-title">
5151
<i class="fa-solid fa-terminal" title="Shell Script"></i>
5252
</div> <!-- d-none clone -->
5353

54+
<script type="text/javascript" src="/js/config.js"></script>
5455
<script type="text/javascript" src="/js/index.js"></script>

js/config.js

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
const webExtensions = [
2+
{
3+
name: 'Link Extractor',
4+
url: 'https://link-extractor.cssnr.com/',
5+
icon: 'https://link-extractor.cssnr.com/media/logo.png',
6+
description:
7+
'Web Extension to easily extract, parse, or open all links/domains from a site or text with optional filters.',
8+
links: {
9+
Google: 'https://chromewebstore.google.com/detail/link-extractor/ifefifghpkllfibejafbakmflidjcjfp',
10+
Mozilla: 'https://addons.mozilla.org/addon/link-extractor',
11+
Website: 'https://link-extractor.cssnr.com/',
12+
GitHub: 'https://github.com/cssnr/link-extractor',
13+
},
14+
fa: 'faJs',
15+
},
16+
{
17+
name: 'Open Links in New Tab',
18+
url: 'https://open-links-in-new-tab.cssnr.com/',
19+
icon: 'https://raw.githubusercontent.com/cssnr/open-links-in-new-tab/master/src/images/logo128.png',
20+
description:
21+
'Web Extension to Open Links in New Tabs for Specified Domains or Temporarily on Any Tab.',
22+
links: {
23+
Google: 'https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc',
24+
Mozilla: 'https://addons.mozilla.org/addon/open-links-in-new-tab',
25+
Website: 'https://open-links-in-new-tab.cssnr.com/',
26+
GitHub: 'https://github.com/cssnr/open-links-in-new-tab',
27+
},
28+
fa: 'faJs',
29+
},
30+
{
31+
name: 'PlayDrift Extension',
32+
url: 'https://playdrift-extension.cssnr.com/',
33+
icon: 'https://playdrift-extension.cssnr.com/media/logo.png',
34+
description:
35+
'PlayDrift Web Extension to view Rankings and Win/Loss Records on Player Profiles plus much more.',
36+
links: {
37+
Google: 'https://chromewebstore.google.com/detail/playdrift-extension/anlkpnbhiiojmedlkchcdmigkdccnmcn',
38+
Mozilla: 'https://addons.mozilla.org/addon/playdrift-extension',
39+
Website: 'https://playdrift-extension.cssnr.com/',
40+
GitHub: 'https://github.com/cssnr/playdrift-extension',
41+
},
42+
fa: 'faJs',
43+
},
44+
{
45+
name: 'Django Files Extension',
46+
url: 'https://django-files.github.io/extension/',
47+
icon: 'https://raw.githubusercontent.com/django-files/web-extension/master/src/media/logo128.png',
48+
description:
49+
'Web Extension for Django Files to view recent uploads, shorten URLs, and upload any Image, Video or Audio.',
50+
links: {
51+
Google: 'https://chromewebstore.google.com/detail/django-files/abpbiefojfkekhkjnpakpekkpeibnjej',
52+
Mozilla: 'https://addons.mozilla.org/addon/django-files',
53+
Website: 'https://django-files.github.io/extension/',
54+
GitHub: 'https://github.com/django-files/web-extension',
55+
},
56+
fa: 'faJs',
57+
},
58+
{
59+
name: 'SMWC Web Extension',
60+
url: 'https://smwc.world/',
61+
icon: 'https://raw.githubusercontent.com/cssnr/smwc-web-extension/master/src/images/logo128.png',
62+
description:
63+
'Web Extension to to easily Patch and Play ROMs Online via the smwc.world site.',
64+
links: {
65+
Google: 'https://chromewebstore.google.com/detail/smwc-web-extension/foalfafgmnglcgpgkhhmcfhjgmdcjide',
66+
Mozilla: 'https://addons.mozilla.org/addon/smwc-web-extension',
67+
Website: 'https://smwc.world/',
68+
GitHub: 'https://github.com/cssnr/smwc-web-extension',
69+
},
70+
fa: 'faJs',
71+
},
72+
{
73+
name: 'ASN Plus',
74+
url: 'https://asn-plus.cssnr.com/',
75+
icon: 'https://asn-plus.cssnr.com/media/logo.png',
76+
description:
77+
'Aviation Safety Network Web Extension to enable dark mode plus add additional features.',
78+
links: {
79+
Google: 'https://chromewebstore.google.com/detail/asn-plus/phcbcnpmcbkcnijkpfohkdmcofcofibh',
80+
Mozilla: 'https://addons.mozilla.org/addon/asn-plus',
81+
Website: 'https://asn-plus.cssnr.com/',
82+
GitHub: 'https://github.com/cssnr/asn-plus',
83+
},
84+
fa: 'faJs',
85+
},
86+
{
87+
name: 'Text Formatter',
88+
url: 'https://github.com/cssnr/text-formatter',
89+
icon: 'https://raw.githubusercontent.com/cssnr/text-formatter/master/src/images/logo128.png',
90+
description: 'Web Extension for Splitting and Formatting Text.',
91+
links: {
92+
Google: 'https://chromewebstore.google.com/detail/text-formatter/medimbembaeldnglneiipkenpagjfcdj',
93+
Mozilla: 'https://github.com/cssnr/text-formatter/releases/latest',
94+
GitHub: 'https://github.com/cssnr/text-formatter',
95+
},
96+
fa: 'faJs',
97+
},
98+
{
99+
name: 'Aviation Tools',
100+
url: 'https://github.com/cssnr/aviation-tools',
101+
icon: 'https://raw.githubusercontent.com/cssnr/aviation-tools/master/src/images/logo128.png',
102+
description:
103+
'Aviation Tools Web Extension. Currently a Work in Progress.',
104+
links: {
105+
Google: 'https://chromewebstore.google.com/detail/aviation-tools/cjjhackeogffajjndfhemgniokonimin',
106+
Mozilla: 'https://github.com/cssnr/aviation-tools/releases/latest',
107+
GitHub: 'https://github.com/cssnr/aviation-tools',
108+
},
109+
fa: 'faJs',
110+
},
111+
{
112+
name: 'Simple Extension',
113+
url: 'https://github.com/smashedr/simple-extension',
114+
icon: 'https://raw.githubusercontent.com/smashedr/simple-extension/master/src/images/logo128.png',
115+
description:
116+
'Example Web Extension for copying and creating new web extensions based on Manifest V3.',
117+
links: {
118+
GitHub: 'https://github.com/smashedr/simple-extension',
119+
},
120+
fa: 'faJs',
121+
},
122+
]
123+
124+
const webApps = [
125+
{
126+
name: 'Django Files',
127+
url: 'https://django-files.github.io/',
128+
icon: 'https://raw.githubusercontent.com/django-files/web-extension/master/src/media/logo128.png',
129+
description:
130+
'A Feature Packed Self-Hosted Django/Docker File Manager for Sharing Files with ShareX, Flameshot and Much more.',
131+
links: {
132+
Website: 'https://smwc.world/',
133+
GitHub: 'https://github.com/django-files/django-files',
134+
},
135+
fa: 'faPython',
136+
},
137+
{
138+
name: 'SMWC ROM Archive',
139+
url: 'https://smwc.world/',
140+
icon: 'https://smwc.world/static/images/logo.png',
141+
description:
142+
'SMWCentral ROM Archive to archive, download, send notifications, plus patch and play SMW ROMs online.',
143+
links: {
144+
Website: 'https://smwc.world/',
145+
GitHub: 'https://github.com/cssnr/smwc-web',
146+
},
147+
fa: 'faPython',
148+
},
149+
{
150+
name: 'SlashGIF',
151+
url: 'https://slashgif.com/',
152+
icon: 'https://slashgif.com/static/images/slashgif.png',
153+
description:
154+
'Slack App to search for a random GIF and preview it, before posting publicly.',
155+
links: {
156+
Website: 'https://slashgif.com/',
157+
GitHub: 'https://github.com/cssnr/slashgif-site',
158+
},
159+
fa: 'faPython',
160+
},
161+
]
162+
163+
const githubActions = [
164+
{
165+
name: 'Stack Deploy',
166+
url: 'https://github.com/cssnr/stack-deploy-action',
167+
description:
168+
'Deploy Docker Stack to Remote Host using SSH Authentication.',
169+
links: {
170+
GitHub: 'https://github.com/cssnr/stack-deploy-action',
171+
},
172+
fa: 'faShell',
173+
},
174+
{
175+
name: 'Mozilla Addon Update File',
176+
url: 'https://github.com/cssnr/mozilla-addon-update-action',
177+
description:
178+
'Update the Mozilla Firefox Update JSON File after a Release.',
179+
links: {
180+
GitHub: 'https://github.com/cssnr/mozilla-addon-update-action',
181+
},
182+
fa: 'faPython',
183+
},
184+
{
185+
name: 'Push Artifacts',
186+
url: 'https://github.com/cssnr/push-artifacts-action',
187+
description: 'Pushes Build Artifacts to a Remote Host using rsync.',
188+
links: {
189+
GitHub: 'https://github.com/cssnr/push-artifacts-action',
190+
},
191+
fa: 'faShell',
192+
},
193+
{
194+
name: 'Cloudflare Purge Cache',
195+
url: 'https://github.com/cssnr/cf-purge-cache-action',
196+
description: 'Easily Purge Cloudflare Cache.',
197+
links: {
198+
GitHub: 'https://github.com/cssnr/cf-purge-cache-action',
199+
},
200+
fa: 'faPython',
201+
},
202+
]
203+
const otherSoftware = [
204+
{
205+
name: "Carl's Cogs",
206+
url: 'https://github.com/smashedr/carl-cogs',
207+
description:
208+
'Red Discord Bot Cogs. Commands and Packages for the Red Discord Bot.',
209+
links: {
210+
'Red Discord Bot': 'https://github.com/Cog-Creators/Red-DiscordBot',
211+
GitHub: 'https://github.com/cssnr/vultr-python',
212+
},
213+
fa: 'faPython',
214+
},
215+
{
216+
name: 'Vultr Python',
217+
url: 'https://github.com/cssnr/vultr-python',
218+
description: 'Vultr Cloud Hosting Python 3 Library.',
219+
links: {
220+
Vultr: 'https://www.vultr.com/?ref=6905748',
221+
GitHub: 'https://github.com/cssnr/vultr-python',
222+
},
223+
fa: 'faPython',
224+
},
225+
{
226+
name: 'Zipline CLI',
227+
url: 'https://github.com/cssnr/zipline-cli',
228+
description: 'Command Line Interface for Zipline and Django Files.',
229+
links: {
230+
Zipline: 'https://github.com/diced/zipline',
231+
'Django Files': 'https://github.com/django-files/django-files',
232+
GitHub: 'https://github.com/cssnr/zipline-cli',
233+
},
234+
fa: 'faPython',
235+
},
236+
]

js/feedback.js

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// JS uninstall.html
22

3+
document.addEventListener('DOMContentLoaded', domContentLoaded)
4+
35
const uninstallMessage = 'CSSNR GitHub Feedback.'
46
const discordUsername = 'CSSNR'
57
const discordAvatar = 'https://cssnr.github.io/media/logo.png'
@@ -11,33 +13,45 @@ const submitBtn = document.getElementById('submit-btn')
1113
const errorAlert = document.getElementById('error-alert')
1214

1315
uninstallForm.addEventListener('submit', formSubmit)
16+
1417
uninstallResponse.addEventListener('input', function (e) {
1518
inputCount.textContent = this.value.length
1619
})
1720

21+
/**
22+
* DOMContentLoaded Callback
23+
* @function domContentLoaded
24+
*/
25+
async function domContentLoaded() {
26+
console.debug('DOMContentLoaded')
27+
const parent = document.getElementById('feedback')
28+
const apps = [webExtensions, webApps, githubActions]
29+
const combined = apps.flat()
30+
for (const app of combined) {
31+
const option = document.createElement('option')
32+
option.value = app.name
33+
option.textContent = app.name
34+
parent.appendChild(option)
35+
}
36+
}
37+
1838
async function formSubmit(event) {
1939
console.debug('formSubmit:', event, this)
2040
event.preventDefault()
2141
errorAlert.style.display = 'none'
2242
const url = this[0].value
23-
const notUsed = this[1].checked
24-
const notExpected = this[2].checked
25-
const notWorking = this[3].checked
26-
const feedbackText = this[4].value
27-
if (!(notUsed || notExpected || notWorking || feedbackText)) {
28-
return console.warn('No Data to Send.')
43+
const app = this[1].value
44+
const text = this[2].value.trim()
45+
if (!text) {
46+
uninstallResponse.focus()
47+
return console.warn('No Feedback to Send.')
2948
}
3049
submitBtn.classList.add('disabled')
3150
const lines = [
32-
uninstallMessage,
51+
`CSSNR GitHub Feedback for: **${app}**`,
3352
`\`${navigator.userAgent}\``,
34-
`${getBoolIcon(notUsed)} Not Used`,
35-
`${getBoolIcon(notExpected)} Not as Expected`,
36-
`${getBoolIcon(notWorking)} Not Working`,
53+
`\`\`\`\n${text}\n\`\`\``,
3754
]
38-
if (feedbackText) {
39-
lines.push(`\`\`\`\n${feedbackText}\n\`\`\``)
40-
}
4155
// console.debug('lines:', lines)
4256
const response = await sendDiscord(url, lines.join('\n'))
4357
console.debug('response:', response)
@@ -68,11 +82,3 @@ async function sendDiscord(url, content) {
6882
}
6983
return await fetch(url, opts)
7084
}
71-
72-
function getBoolIcon(value) {
73-
if (value) {
74-
return '✅'
75-
} else {
76-
return '🔳'
77-
}
78-
}

0 commit comments

Comments
 (0)