Introduce JS for improved back button behaviour #121

Merged
glyph merged 3 commits from js_back_button into main 2022-06-28 08:14:43 +00:00
Owner

As discussed in #120, this PR adds JavaScript to override the default, hardcoded back button URL for every page of the UI.

If JavaScript is disabled in the browser, the underlying back button functionality continues to work in its usual slightly-quirky fashion :)

I wanted to encapsulate the JS in a separate file (/static/back.js) but I ran into a strange issue where the HTML beyond the <script src="/static/back.js"></script> tag would not render (even though it was present in the source). Since the JS is simple and brief, I went with the fallback option of rendering it in a <script> tag with Maud.

As discussed in https://git.coopcloud.tech/PeachCloud/peach-workspace/pulls/120, this PR adds JavaScript to override the default, hardcoded back button URL for every page of the UI. If JavaScript is disabled in the browser, the underlying back button functionality continues to work in its usual slightly-quirky fashion :) I wanted to encapsulate the JS in a separate file (`/static/back.js`) but I ran into a strange issue where the HTML beyond the `<script src="/static/back.js"></script>` tag would not render (even though it was present in the source). Since the JS is simple and brief, I went with the fallback option of rendering it in a `<script>` tag with Maud.
glyph added 2 commits 2022-06-23 11:07:42 +00:00
glyph requested review from notplants 2022-06-23 11:08:11 +00:00
glyph added the
enhancement
peach-web
labels 2022-06-23 11:08:18 +00:00
Owner

hmm strange about the html bug. something about html syntax?

would also prefer separate js files to js within script tags in general, but also doesn't matter much since its a small amount of code

hmm strange about the html bug. something about html syntax? would also prefer separate js files to js within script tags in general, but also doesn't matter much since its a small amount of code
Author
Owner

hmm strange about the html bug. something about html syntax?

I tried tinkering with it for an hour and couldn't figure it out. Very weird.

> hmm strange about the html bug. something about html syntax? I tried tinkering with it for an hour and couldn't figure it out. Very weird.
glyph added 1 commit 2022-06-28 08:14:05 +00:00
continuous-integration/drone/pr Build is passing Details
9ce27d17c5
merge main
glyph merged commit 123ebc06cc into main 2022-06-28 08:14:43 +00:00
glyph deleted branch js_back_button 2022-06-28 08:14:45 +00:00
Sign in to join this conversation.
No description provided.