Skip to content

Commit

Permalink
Updates (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr authored Jul 6, 2024
1 parent 6155a3c commit 605596f
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: 'Pages'
on:
push:
branches: ['master']
paths:
- src/**
repository_dispatch:
types:
- webhook
Expand Down
3 changes: 2 additions & 1 deletion src/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ chrome_url: https://chromewebstore.google.com/detail/open-links-in-new-tab/efahm
firefox_id: open-links-in-new-tab
firefox_url: https://addons.mozilla.org/addon/open-links-in-new-tab

discord_webhook: https://discord.com/api/webhooks/242137648028712961/4xM7SXClH_i8we_epG6AXMaqhueg5L5oAVf1dnLw1_el05OxZ-JVfph-QrcQwPkOMJem
discord_invite: https://discord.gg/wXy6m2X8wY
discord_webhook: https://discord.com/api/webhooks/1258944618389569566/gqge0T5UZcJHLxfAFLPNjlzsuqikQJtTlCRvVWbw2ufDv_WrJ8yzVRWenb__s1PxyawH
23 changes: 15 additions & 8 deletions src/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
Screen Shots <i class="fa-solid fa-arrow-up-right-from-square"></i></a></li>
<li class="nav-item"><a class="nav-link" href="{{ site.github_url }}" target="_blank" rel="noopener">
GitHub <i class="fa-solid fa-arrow-up-right-from-square"></i></a></li>
<li class="nav-item"><a class="nav-link" href="{{ site.discord_invite }}" target="_blank" rel="noopener">
Discord <i class="fa-solid fa-arrow-up-right-from-square"></i></a></li>
</ul>
</div>
</div>
Expand All @@ -72,25 +74,30 @@

<footer class="footer mt-auto px-1 flex-shrink-0">
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-5 py-2">
<div class="d-flex flex-column flex-md-row py-2">
<div class="me-md-auto">
<a class="link-body-emphasis text-decoration-none" href="{{ site.github_url }}" target="_blank" rel="noopener">
<i class="fab fa-github"></i> {{ site.site_name }}</a>
</div>
<div class="col-12 col-sm-7 py-2 text-sm-end">
<div class="ms-md-auto">
<nav aria-label="Secondary Navigation">
<ol class="list-inline mb-1">
<li class="list-inline-item">
<a class="link-body-emphasis text-decoration-none {% if page.title == 'Home' %}fw-bold{% endif %}" href="{{ "/" | relative_url }}">
Home</a></li>
{% comment %}<li class="list-inline-item">|</li>{% endcomment %}
Home</a>
</li>
<li class="list-inline-item">
<a class="link-body-emphasis text-decoration-none {% if page.title == 'Docs' %}fw-bold{% endif %}" href="{{ "/docs/" | relative_url }}">
Docs</a></li>
{% comment %}<li class="list-inline-item">|</li>{% endcomment %}
Docs</a>
</li>
<li class="list-inline-item">
<a class="link-body-emphasis text-decoration-none" href="{{ "/screenshots/" | relative_url }}" target="_blank">
Screen Shots <i class="fa-solid fa-arrow-up-right-from-square"></i></a></li>
Screen Shots <i class="fa-solid fa-arrow-up-right-from-square"></i></a>
</li>
<li class="list-inline-item">
<a class="link-body-emphasis text-decoration-none" href="{{ site.discord_invite }}" target="_blank">
Discord <i class="fa-solid fa-arrow-up-right-from-square"></i></a>
</li>
</ol>
</nav>
</div>
Expand Down
13 changes: 13 additions & 0 deletions src/html/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ <h1><i class="fa-regular fa-file-lines"></i> {{ page.title }}</h1>

<p class="lead"><a href="#configure">Configure</a> | <a href="#usage">Usage</a> | <a href="#options">Options</a></p>

<div id="feedback" class="alert alert-success d-none" role="alert">
<p>Thank you for providing feedback. If you provided details we will look into them.</p>
<p>
If you would like feedback from the developer you can open an
<a href="{{ site.github_url }}/issues" class="alert-link" target="_blank" rel="noopener">Issue</a> on GitHub.
</p>
<p class="mb-0">
You may also request support and get help on the <a href="{{ site.discord_invite }}" class="alert-link" target="_blank" rel="noopener">Discord Server</a>.
</p>
</div>

{% comment %}{% include alerts.html %}{% endcomment %}

<h2 id="configure">Configure</h2>
Expand Down Expand Up @@ -115,3 +126,5 @@ <h5><i class="fa-regular fa-keyboard"></i> Keyboard Shortcuts</h5>
</ul>

<p>Please view the <a href="{{ site.github_url }}?tab=readme-ov-file#readme" target="_blank">README.md</a> for more information.</p>

<script type="text/javascript" src="{{ "/js/docs.js" | relative_url }}"></script>
28 changes: 14 additions & 14 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ <h1><i class="fa-solid fa-up-right-from-square"></i> {{ site.site_name }}</h1>
<img src="https://img.shields.io/amo/v/{{ site.firefox_id }}?label=firefox&logo=firefox" alt="Mozilla Add-on Version" style="max-width: 100%;"></a>
<a href="{{ site.github_url }}/releases/latest" rel="nofollow" target="_blank">
<img src="https://img.shields.io/github/v/release/{{ site.github_name }}?logo=github" alt="GitHub Release Version" style="max-width: 100%;"></a>
<a href="{{ site.discord_invite }}" title="GitHub" target="_blank" rel="noopener">
<img src="https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da" alt="Join Discord" style="max-width: 100%;"></a>
</div>

<p class="lead">
Modern Chrome Web Extension and Firefox Browser Addon for The Aviation Safety Network to enable dark mode plus add additional features.
</p>

<div class="ms-1 mb-3">
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Chrome" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png" width="42" height="42" /></a>
<a href="{{ site.firefox_url }}" target="_blank">
<img alt="Firefox" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Edge" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Chromium" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chromium/chromium_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Opera" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Brave" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/brave/brave_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" target="_blank">
<img alt="Vivaldi" src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/vivaldi/vivaldi_48x48.png" width="42" height="42" /></a>
<a href="{{ site.chrome_url }}" title="Chrome" target="_blank" rel="noopener">
<img alt="Chrome" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/chrome_48.png" width="48" height="48" /></a>
<a href="{{ site.firefox_url }}" title="Firefox" target="_blank" rel="noopener">
<img alt="Firefox" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/firefox_48.png" width="48" height="48" /></a>
<a href="{{ site.chrome_url }}" title="Edge" target="_blank" rel="noopener">
<img alt="Edge" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/edge_48.png" width="48" height="48" /></a>
<a href="{{ site.chrome_url }}" title="Opera" target="_blank" rel="noopener">
<img alt="Opera" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/opera_48.png" width="48" height="48" /></a>
<a href="{{ site.chrome_url }}" title="Brave" target="_blank" rel="noopener">
<img alt="Brave" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/brave_48.png" width="48" height="48" /></a>
<a href="{{ site.chrome_url }}" title="Chromium" target="_blank" rel="noopener">
<img alt="Chromium" src="https://raw.githubusercontent.com/smashedr/logo-icons/master/browsers/chromium_48.png" width="48" height="48" /></a>
</div>

<h2>Features</h2>
Expand Down
9 changes: 7 additions & 2 deletions src/html/uninstall.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ <h1 class="align-middle mb-0">{{ site.site_name }}</h1>
</div>
<p class="text-center">
Please let us know why you uninstalled {{ site.site_name }}.
All <a href="{{ site.github_url }}/issues" target="_blank" rel="noopener">bugs that get reported</a> will be fixed!
<a href="{{ site.github_url }}/discussions/categories/feature-requests" target="_blank" rel="noopener">Feature Requests</a> are also greatly appreciated...
<br>
<span class="fs-4">
All <a href="{{ site.github_url }}/issues" target="_blank" rel="noopener">bugs that get reported</a> <b>will be fixed!</b>
</span>
<br>
Any <a href="{{ site.github_url }}/discussions/categories/feature-requests" target="_blank" rel="noopener">Feature Requests</a> are appreciated.
Support is also available on <a href="{{ site.discord_invite }}" target="_blank" rel="noopener">Discord</a>.
</p>
{% include alerts.html %}
<form id="uninstall-form">
Expand Down
12 changes: 12 additions & 0 deletions src/js/docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// JS for docs.html

document.addEventListener('DOMContentLoaded', function () {
// console.debug('DOMContentLoaded')
const searchParams = new URLSearchParams(window.location.search)
const feedback = searchParams.get('feedback')
// console.debug('feedback:', feedback)
if (feedback) {
document.getElementById('feedback').classList.remove('d-none')
history.pushState(null, '', location.href.split('?')[0])
}
})
24 changes: 13 additions & 11 deletions src/js/uninstall.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// JS uninstall.html

const searchParams = new URLSearchParams(window.location.search)
const version = searchParams.get('version') || 'unknown'
const url = new URL(window.location)
const redirect = new URL(url.origin)
redirect.searchParams.append('feedback', 'yes')
redirect.pathname = '/docs/'

const version = url.searchParams.get('version') || 'unknown'

const noAlertVersion = '0.2.0'
const discordUsername = 'Open Links in New Tab'
const uninstallMessage = `${discordUsername} Uninstall, Version: **${version}**`
const discordAvatar = 'https://open-links-in-new-tab.cssnr.com/media/logo.png'
const discordAvatar = 'https://link-extractor.cssnr.com/media/logo.png'

const uninstallForm = document.getElementById('uninstall-form')
const uninstallResponse = document.getElementById('uninstall-response')
Expand All @@ -22,10 +26,9 @@ uninstallResponse.addEventListener('input', function () {
inputCount.textContent = this.value.length
})

document.addEventListener('DOMContentLoaded', function (event) {
const ver = searchParams.get('version')
if (ver) {
const res = ver.localeCompare(noAlertVersion, undefined, {
document.addEventListener('DOMContentLoaded', function () {
if (version) {
const res = version.localeCompare(noAlertVersion, undefined, {
numeric: true,
sensitivity: 'base',
})
Expand All @@ -37,7 +40,7 @@ document.addEventListener('DOMContentLoaded', function (event) {
})

function formChange(event) {
console.debug('formChange:', event)
// console.debug('formChange:', event)
if (event.target.id === 'not-working') {
if (event.target.checked) {
notWorkingExtra.classList.remove('d-none')
Expand Down Expand Up @@ -78,11 +81,10 @@ async function formSubmit(event) {
// console.debug('lines:', lines)

const response = await sendDiscord(url, lines.join('\n'))
console.debug('response:', response)
// console.debug('response:', response)
submitBtn.classList.remove('disabled')
if (response.status >= 200 && response.status <= 299) {
console.debug('Success')
window.location = '/docs/'
window.location = redirect
} else {
console.warn(`Error ${response.status}`, response)
errorAlert.textContent = `Error ${response.status}: ${response.statusText}`
Expand Down

0 comments on commit 605596f

Please sign in to comment.