Skip to content

Commit f9d3029

Browse files
authored
Updates (#58)
* Update Options Layout * Update Copy Selectors * Update Options Page * Add Uninstall URL and Issue Template
1 parent bd08aa2 commit f9d3029

File tree

6 files changed

+119
-51
lines changed

6 files changed

+119
-51
lines changed

.github/ISSUE_TEMPLATE/0-bug.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "⚠️ Report an Issue"
2+
description: "Something Not Working Right? Please let us know..."
3+
labels: ["bug"]
4+
assignees:
5+
- smashedr
6+
7+
body:
8+
- type: textarea
9+
id: description
10+
validations:
11+
required: true
12+
attributes:
13+
label: Details
14+
description: Please describe the issue you are experiencing and how to reproduce.
15+
placeholder: Provide as many details as you can...
16+
17+
- type: textarea
18+
id: logs
19+
validations:
20+
required: true
21+
attributes:
22+
label: Support Information
23+
description: Open the extension options, scroll to the bottom, click Copy Support Information and paste below.
24+
render: shell
25+
26+
- type: markdown
27+
attributes:
28+
value: |
29+
All issues/bugs that we can verify will be fixed. Thank you for taking the time to make this report!

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: "💡 Request a Feature"
4+
about: Request a New Feature or Enhancement in the Discussions.
5+
url: https://github.com/django-files/web-extension/discussions/new?category=feature-requests
6+
7+
- name: "❔ Ask a Question"
8+
about: Ask a General Question or start a Discussions.
9+
url: https://github.com/django-files/web-extension/discussions/new?category=q-a
10+
11+
- name: "💬 Join Discord"
12+
about: Chat with us about Issues, Features, Questions and More.
13+
url: https://discord.gg/wXy6m2X8wY
14+
15+
- name: "📝 Submit Feedback"
16+
about: Send General Feedback.
17+
url: https://cssnr.github.io/feedback/?app=Django%20Files%20Extension

src/css/options.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* CSS for options.html */
22

33
body {
4-
min-width: 360px;
4+
min-width: 340px;
55
}
66

77
video {
@@ -14,17 +14,32 @@ video {
1414
z-index: -1;
1515
}
1616

17-
.options-wrapper {
17+
#options-wrapper {
1818
background: rgba(0 0 0 / 50%);
1919
filter: drop-shadow(15px 15px 12px #000000);
2020
backdrop-filter: blur(6px);
21+
max-width: 800px;
2122
}
2223

23-
.input-group-text,
2424
.form-control {
2525
background: rgba(0 0 0 / 50%);
2626
}
2727

2828
#table-wrapper {
2929
background: rgba(0 0 0 / 50%);
3030
}
31+
32+
.hvr-grow {
33+
display: inline-block;
34+
vertical-align: middle;
35+
transform: translateZ(0);
36+
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
37+
backface-visibility: hidden;
38+
-moz-osx-font-smoothing: grayscale;
39+
transition-duration: 0.3s;
40+
transition-property: transform;
41+
}
42+
43+
.hvr-grow:hover {
44+
transform: scale(1.1);
45+
}

src/html/options.html

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,53 @@
1616
<!-- <source src="/media/loop.mp4" type="video/mp4">-->
1717
</video> <!-- video -->
1818

19-
<div class="container-fluid g-0 h-100">
20-
<div class="d-flex align-items-center h-100">
21-
<div class="col-xl-8 col-lg-10 col-12 m-auto">
22-
<div class="options-wrapper p-3 ms-2 mt-2 mb-3 me-3 rounded rounded-4">
19+
<div class="d-flex align-items-center justify-content-center pt-3 px-1 px-sm-3 h-100">
20+
<div class="m-auto">
21+
<div id="options-wrapper" class="rounded rounded-4 p-3 mb-3 w-100">
22+
2323
<div class="d-flex justify-content-center align-items-center">
2424
<img src="../media/logo48.png" class="me-2" height="48" width="48"
2525
alt="Django Files Extension" title="Django Files Extension">
26-
<h1>Django Files Options</h1>
26+
<h2>Django Files Options</h2>
2727
</div>
2828
<div class="clearfix"></div>
2929
<p class="text-center lead">v<span id="version"></span></p>
3030
<div id="table-wrapper" class="rounded rounded-3 p-2 mb-3 d-none">
31-
<table id="keyboard-shortcuts" class="table table-sm table-borderless table-hover mb-0">
32-
<caption class="visually-hidden">Keyboard Shortcuts</caption>
33-
<thead class="visually-hidden"><tr><th>Description</th><th>Shortcut</th></tr></thead>
34-
<tbody>
35-
<tr class="d-none">
36-
<td class="bg-transparent"><i class="fa-regular fa-keyboard me-1"></i> <span class="description"></span></td>
37-
<td class="bg-transparent text-end" title="Keyboard Shortcut"><kbd>Unknown</kbd></td>
38-
</tr>
39-
</tbody>
40-
</table>
31+
<table id="keyboard-shortcuts" class="table table-sm table-borderless table-hover mb-0">
32+
<caption class="visually-hidden">Keyboard Shortcuts</caption>
33+
<thead class="visually-hidden"><tr><th>Description</th><th>Shortcut</th></tr></thead>
34+
<tbody>
35+
<tr class="d-none">
36+
<td class="bg-transparent"><i class="fa-regular fa-keyboard me-1"></i> <span class="description"></span></td>
37+
<td class="bg-transparent text-end" title="Keyboard Shortcut"><kbd>Unknown</kbd></td>
38+
</tr>
39+
</tbody>
40+
</table>
4141
</div>
4242

4343
<form id="options-form" class="options">
4444
<div class="row">
4545
<label for="siteUrl" class="form-label"><i class="fa-solid fa-globe me-2"></i> Django Files URL</label>
46-
<div class="input-group col-12 ">
46+
<div class="input-group col-12">
4747
<input id="siteUrl" aria-describedby="siteUrlHelp" type="text" class="form-control" autocomplete="off">
48-
<button class="btn btn-outline-primary clip" data-clipboard-target="#siteUrl" type="button" data-bs-toggle="tooltip"
49-
data-bs-placement="bottom" data-bs-trigger="hover" data-bs-title="Copy to Clipboard.">
48+
<button class="btn btn-outline-primary" type="button" data-bs-toggle="tooltip"
49+
data-copy-input="#authToken" data-copy-text="Site URL Copied to Clipboard."
50+
data-bs-placement="bottom" data-bs-trigger="hover" data-bs-title="Copy Site URL.">
5051
<i class="fa-solid fa-copy"></i>
5152
</button>
5253
</div>
5354
<div class="form-text mb-3" id="siteUrlHelp" >The Full URL to your Django Files server.</div>
5455

5556
<label for="authToken" class="form-label"><i class="fa-solid fa-key me-2"></i> Auth Token</label>
56-
<div class="input-group col-12 ">
57+
<div class="input-group col-12">
5758
<input id="authToken" aria-describedby="authTokenHelp" type="password" class="form-control" autocomplete="off">
58-
<button class="btn btn-outline-success show-hide" type="button" data-bs-toggle="tooltip" data-selector="#authToken"
59+
<button class="btn btn-outline-success" type="button" data-bs-toggle="tooltip" data-show-hide="#authToken"
5960
data-bs-placement="bottom" data-bs-trigger="hover" data-bs-title="Show/Hide Auth Token.">
6061
<i class="fa-regular fa-eye"></i>
6162
</button>
62-
<button id="authTokenCopy" class="btn btn-outline-primary copy-password" type="button" data-selector="#authToken"
63-
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-trigger="hover" data-bs-title="Copy to Clipboard.">
63+
<button id="authTokenCopy" class="btn btn-outline-primary" type="button"
64+
data-copy-input="#authToken" data-copy-text="Auth Token Copied to Clipboard."
65+
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-trigger="hover" data-bs-title="Copy Auth Token.">
6466
<i class="fa-solid fa-copy"></i>
6567
</button>
6668
</div>
@@ -181,20 +183,19 @@ <h1>Django Files Options</h1>
181183
<div class="form-check form-switch mb-2">
182184
<input class="form-check-input" id="ctxSidePanel" type="checkbox" role="switch">
183185
<label class="form-check-label" for="ctxSidePanel" aria-describedby="ctxSidePanelHelp">
184-
Show Open Side Panel in Menu
186+
Show Open Side Panel
185187
<span data-bs-toggle="tooltip" data-bs-title="Show Side Panel in Menu.">
186-
<i class="fa-solid fa-circle-info ms-1"></i>
187-
</span>
188+
<i class="fa-solid fa-circle-info ms-1"></i>
189+
</span>
188190
</label>
189191
</div>
190192
<div class="d-flex align-items-center">
191193
<button id="reloadAlbums" class="btn btn-sm btn-outline-info" type="button"
192-
data-bs-toggle="tooltip" data-bs-title="Requires Django Files >= 0.15.0. Errors are only show in the console (Ctrl+Shift+I).">
194+
data-bs-trigger="hover" data-bs-toggle="tooltip" data-bs-title="Requires Django Files >=0.15.0 and errors are only shown in the console (Ctrl+Shift+I).">
193195
<i class="fa-solid fa-arrows-rotate"></i> Reload Albums
194196
</button>
195197
<span id="albumsUpdated" class="text-success" style="display: none;">
196-
<i class="fa-regular fa-circle-check fa-xl ms-3"></i>
197-
Updated
198+
<i class="fa-regular fa-circle-check fa-xl fw-bold ms-3"></i>
198199
</span>
199200
</div>
200201
</div> <!-- #reloadMenu -->
@@ -258,25 +259,26 @@ <h5 class="mb-2">
258259
</form> <!-- options-form -->
259260

260261
<p class="fst-italic small mt-3">
261-
<a id="copy-support" href="#0">Copy Support Information</a> for issue reporting.
262+
<a id="copy-support" class="link-offset-2-hover link-underline link-underline-opacity-0 link-underline-opacity-75-hover" href="#0">
263+
Copy Support Information</a> for issue reporting.
262264
</p>
263265

264266
<hr class="mt-0">
265267

266268
<div class="text-center">
267269
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
268-
href="https://github.com/django-files/web-extension?tab=readme-ov-file#readme">Get Help</a>
270+
href="https://django-files.github.io/extension/">Get Help</a>
269271
<span class="mx-2">&bull;</span>
270272
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
271273
href="https://github.com/django-files/web-extension/issues">Open Issue</a>
272274
<span class="mx-2">&bull;</span>
273275
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
274276
href="https://django-files.github.io/">Django Files</a>
275277
</div>
278+
276279
</div> <!-- options-wrapper -->
277-
</div> <!-- col -->
278-
</div> <!-- flex -->
279-
</div> <!-- container -->
280+
</div> <!-- m-auto -->
281+
</div> <!-- d-flex -->
280282

281283
<div aria-live="polite" aria-atomic="true" class="">
282284
<div id="toast-container" class="toast-container position-fixed bottom-0 end-0 p-3"></div>

src/js/options.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ document
1616
.querySelectorAll('[data-bs-toggle="tooltip"]')
1717
.forEach((el) => new bootstrap.Tooltip(el))
1818
document
19-
.querySelectorAll('.show-hide')
19+
.querySelectorAll('[data-show-hide]')
2020
.forEach((el) => el.addEventListener('click', showHidePassword))
2121
document
22-
.querySelectorAll('.copy-password')
23-
.forEach((el) => el.addEventListener('click', copyPassword))
22+
.querySelectorAll('[data-copy-input]')
23+
.forEach((el) => el.addEventListener('click', copyInput))
2424
document
2525
.getElementsByName('radioBackground')
2626
.forEach((el) => el.addEventListener('change', loginBackgroundChange))
@@ -71,10 +71,10 @@ async function reloadAlbums(event) {
7171
const icon = event.target.closest('i') || event.target.querySelector('i')
7272
console.debug('button:', button)
7373
console.debug('icon:', icon)
74-
button.classList.add('disabled')
74+
// button.classList.add('disabled')
7575
icon.classList.add('fa-spin')
7676
await chrome.runtime.sendMessage('createContextMenus')
77-
button.classList.remove('disabled')
77+
// button.classList.remove('disabled')
7878
icon.classList.remove('fa-spin')
7979
const albumsUpdated = $('#albumsUpdated')
8080
albumsUpdated.fadeToggle()
@@ -120,9 +120,6 @@ function setBackground(options) {
120120
if (options.radioBackground === 'bgPicture') {
121121
const url = options.pictureURL || 'https://picsum.photos/1920/1080'
122122
document.body.style.background = `url('${url}') no-repeat center fixed`
123-
document.body.style.webkitBackgroundSize = 'cover'
124-
document.body.style.mozBackgroundSize = 'cover'
125-
document.body.style.oBackgroundSize = 'cover'
126123
document.body.style.backgroundSize = 'cover'
127124
video.classList.add('d-none')
128125
} else if (options.radioBackground === 'bgVideo') {
@@ -292,21 +289,26 @@ async function setShortcuts(selector = '#keyboard-shortcuts') {
292289
function showHidePassword(event) {
293290
console.debug('showHidePassword:', event)
294291
const element = event.target.closest('button')
295-
const input = document.querySelector(element.dataset.selector)
292+
const input = document.querySelector(element.dataset.showHide)
296293
if (input.type === 'password') {
297294
input.type = 'text'
298295
} else {
299296
input.type = 'password'
300297
}
301298
}
302299

303-
async function copyPassword(event) {
304-
console.debug('copyPassword:', event)
300+
async function copyInput(event) {
301+
console.debug('copyInput:', event)
305302
const element = event.target.closest('button')
306-
const input = document.querySelector(element.dataset.selector)
303+
console.debug('element.dataset.copyInput:', element.dataset.copyInput)
304+
const input = document.querySelector(element.dataset.copyInput)
307305
console.debug('input:', input)
308306
await navigator.clipboard.writeText(input.value)
309-
// showToast('Copied to Clipboard.')
307+
if (element.dataset.copyText) {
308+
showToast(element.dataset.copyText)
309+
} else {
310+
showToast('Copied to Clipboard.')
311+
}
310312
}
311313

312314
/**

src/js/service-worker.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async function onInstalled(details) {
3535
console.log('onInstalled:', details)
3636
const githubURL = 'https://github.com/django-files/web-extension'
3737
const installURL = 'https://django-files.github.io/extension/#configure'
38+
const uninstallURL = new URL('https://django-files.github.io/uninstall/')
3839
const options = await Promise.resolve(
3940
setDefaultOptions({
4041
siteUrl: '',
@@ -63,11 +64,11 @@ async function onInstalled(details) {
6364
if (options.contextMenu) {
6465
createContextMenus(options)
6566
}
67+
const manifest = chrome.runtime.getManifest()
6668
if (details.reason === 'install') {
6769
chrome.runtime.openOptionsPage()
6870
await chrome.tabs.create({ active: false, url: installURL })
6971
} else if (details.reason === 'update' && options.showUpdate) {
70-
const manifest = chrome.runtime.getManifest()
7172
if (manifest.version !== details.previousVersion) {
7273
let { internal } = await chrome.storage.sync.get(['internal'])
7374
internal = internal || {}
@@ -81,7 +82,9 @@ async function onInstalled(details) {
8182
}
8283
}
8384
}
84-
chrome.runtime.setUninstallURL(`${githubURL}/issues`)
85+
uninstallURL.searchParams.append('version', manifest.version)
86+
console.log('uninstallURL:', uninstallURL.href)
87+
await chrome.runtime.setUninstallURL(uninstallURL.href)
8588
}
8689

8790
/**

0 commit comments

Comments
 (0)