Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UI & UX #155

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Improve UI & UX #155

wants to merge 4 commits into from

Conversation

NovA-80
Copy link

@NovA-80 NovA-80 commented Feb 3, 2023

fixes #

  • Rendering of index generated by Apache-2.2. This ancient Apache version is still can be found on NASes (e.g. WD My Book Live), where it can't be updated easily.
  • Rendering on small mobile screens (too wide icons column, overflow of breadcrumbs line)
  • Showing of HEIC files in LightGallery.

proposed changes

  • Use CSS selectors without referencing Apache generated CSS classes, that became available in Apache-2.4.
  • Allow wrapping of breadcrumbs line.
  • Maximize filenames column width on small screen.
  • Add HEIC to image selector for lightGallery. Also, allow for uppercase image filenames that may come from smartphones.
  • Remove JS code for fixing hrefs. It seems to be needed to bypass an Apache bug and now became useless.

@NovA-80 NovA-80 force-pushed the patches branch 2 times, most recently from 32a67f1 to 97112dd Compare February 3, 2023 08:35
@oupala
Copy link
Owner

oupala commented Feb 6, 2023

Thank you for this interesting merge request. I'll have a look at it and will test it soon.

Meanwhile, can you please update your commit messages in order to fulfil the commit message convention "conventional changelog" as stated the CONTRIBUTING.md guide.

@NovA-80
Copy link
Author

NovA-80 commented Feb 6, 2023

Meanwhile, can you please update your commit messages in order to fulfil the commit message convention "conventional changelog" as stated the CONTRIBUTING.md guide.

I've force pushed the commits with corrected messages.

@oupala oupala changed the title Imporove UI & UX Improve UI & UX Apr 24, 2023
@oupala
Copy link
Owner

oupala commented May 9, 2023

I've tested your merge request with an apache 2.4 and an apache 2.2 (thanks to Docker), and it seems to work.

I plan to make some more tests before merging.

@oupala
Copy link
Owner

oupala commented May 10, 2023

I talked with some friends and it appear that apache 2.2 is no longer supported:

Apache httpd 2.2 End-of-Life 2018-01-01

As previously announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases.

The Apache HTTP Server Project had long committed to provide maintenance releases of the 2.2.x flavor through June of 2017. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases.

I can understand that some people do not have the choice of the version of apache they are running. On the other side, I think that it is not a wise choice to offer a version of apaxy that is adapted for a version of apache that is no longer supported and has multiple vulnerabilities that won't ever be fixed.

Apache httpd 2.2 is End-of-Life since December 2017 and should not be used. This page only lists security issues that occurred before the End-of-Life. Subsequent issues may have affected 2.2 but will not be investigated or listed here. Users are advised to upgrade to the currently supported released version to address known issues.

Hence I propose you to remove the changes in this merge request that are related to apache 2.2 so that this merge request contains only changes related to the following items:

  • Rendering on small mobile screens (too wide icons column, overflow of breadcrumbs line)
  • Showing of HEIC files in LightGallery.

And the changes related to apache 2.2 could be posted as a git patch in an issue for those who are hardly obliged to use an unsupported version of apache.

- Allow wrapping of long breadcrumbs line that leads to horizontal scrolling and breaks lightGallery zooming
- Maximize filenames column width and shrink icons column
That fix seems to be needed to bypass an Apache bug and now became useless.
Module autoindex in Apache-2.2 generates table not specifying any CSS classes (they were appeared in Apache-2.4), but Apaxy CSS selectors requires those.
@NovA-80
Copy link
Author

NovA-80 commented May 12, 2023

I can understand that some people do not have the choice of the version of apache they are running. On the other side, I think that it is not a wise choice to offer a version of apaxy that is adapted for a version of apache that is no longer supported and has multiple vulnerabilities that won't ever be fixed.

Actually, most of the Apaxy CSS selectors still work with Apache-2.2. The Apache-2.4 dependency have been introduced in a couple of places via recent commits. If there is a wish to drop apache-2.2 requirement completely, other places in Apaxy should be possibly cleaned up to take advantage of named CSS-classes... This PR doesn't address this.

Hence I propose you to remove the changes in this merge request that are related to apache 2.2 so that this merge request contains only changes related to the following items:

  • Rendering on small mobile screens (too wide icons column, overflow of breadcrumbs line)
  • Showing of HEIC files in LightGallery.

I've removed the commits concerning Apache-2.2 from this PR, and also changed the README accordingly (it was referencing apache-2.2 as requirement).

And the changes related to apache 2.2 could be posted as a git patch in an issue for those who are hardly obliged to use an unsupported version of apache.

I've made the patch against the HEAD of this branch. The contents is bellow. But it can also be posted in a new issue after this PR will be merged.

Fix: support for Apache 2.2

Module autoindex in Apache-2.2 generates table not specifying any CSS classes (they were appeared in Apache-2.4). Rewrite Apaxy CSS selectors to not reference that.
---
 apaxy/theme/apaxy-lightgallery.js | 16 ++++++++--------
 apaxy/theme/style.css             |  8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/apaxy/theme/apaxy-lightgallery.js b/apaxy/theme/apaxy-lightgallery.js
index 4e5ba24..61c4446 100644
--- a/apaxy/theme/apaxy-lightgallery.js
+++ b/apaxy/theme/apaxy-lightgallery.js
@@ -1,14 +1,14 @@
 var imageSelector = [
-    'tr:not(.parent) td.indexcolname a[href$=".jpg"]',
-    'tr:not(.parent) td.indexcolname a[href$=".JPG"]',
-    'tr:not(.parent) td.indexcolname a[href$=".heic"]',
-    'tr:not(.parent) td.indexcolname a[href$=".HEIC"]',
-    'tr:not(.parent) td.indexcolname a[href$=".png"]',
-    'tr:not(.parent) td.indexcolname a[href$=".PNG"]',
-    'tr:not(.parent) td.indexcolname a[href$=".gif"]'
+    'tr:not(.parent) td+td a[href$=".jpg"]',
+    'tr:not(.parent) td+td a[href$=".JPG"]',
+    'tr:not(.parent) td+td a[href$=".heic"]',
+    'tr:not(.parent) td+td a[href$=".HEIC"]',
+    'tr:not(.parent) td+td a[href$=".png"]',
+    'tr:not(.parent) td+td a[href$=".PNG"]',
+    'tr:not(.parent) td+td a[href$=".gif"]'
 ].join(', ');
 
-lightGallery(document.getElementById('indexlist'), {
+lightGallery(document.getElementsByTagName('table')[0], {
     selector: imageSelector,
     mode: 'lg-slide',
     hideBarsDelay: 2000,
diff --git a/apaxy/theme/style.css b/apaxy/theme/style.css
index d597313..0c5b681 100644
--- a/apaxy/theme/style.css
+++ b/apaxy/theme/style.css
@@ -133,11 +133,11 @@ table {
   }
 }
 
-.odd {
+tr:nth-child(odd) {
   background-color: rgb(244, 244, 244);
 }
 @media (prefers-color-scheme: dark) {
-  .odd {
+  tr:nth-child(odd) {
     background-color: rgb(50, 50, 50);
   }
 }
@@ -230,9 +230,9 @@ tr.parent a[href^="/"] {
     padding: 10px;
   }
   /* 2nd Column: Filename */
-  .indexcolname { width: 95%; }
+  th + th { width: 95%; }
   /* 3rd Column: Last Modified */
-  .indexcollastmod { display: none; }
+  td:nth-child(3), th:nth-child(3) { display: none; }
   .wrapper { max-width: 100%; }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants