TEIC / Stylesheets

TEI XSL Stylesheets
228 stars 124 forks source link

JQuery in guidelines.xsl (and many other places) #612

Open martindholmes opened 1 year ago

martindholmes commented 1 year ago

For a long time now I've been getting regular warnings by email from the GitHub Dependabot tool warning that teic.github.io has an ancient vulnerable version of JQuery (jquery-1.2.6.min.js) which should be updated to 1.6.3 or higher. Looking through the TEI and Stylesheets repos, I find dozens of references to various versions of JQuery, none of which are up to date. I think it's time to try to purge all dependencies on JQuery and replace them with simple modern vanilla CSS and JS.

joeytakeda commented 1 year ago

Very much agreed. In the Stylesheets repo, JQuery is included in guidelines.xsl (as @martindholmes says):

https://github.com/TEIC/Stylesheets/blob/a394b17a5951f0c24f1fbe547df9ab61d60f1951/odds/guidelines.xsl#L659-L679

Which I believe is generated by TEI/P5/Utilities/guidelines.xsl.model ?

https://github.com/TEIC/TEI/blob/dev/P5/Utilities/guidelines.xsl.model#L638-L672

columnlist.js (which is in TEIC/TEI/P5/webnav/columnlist.js) could be, I think, simply replaced with CSS columns or with grid

ul {
 column-count: 3
}

/* Or */

ul {
display:grid;
grid-template-columns: repeat(1fr, 3)
}
martindholmes commented 1 year ago

I'd be inclined to do something like:

ul{
  columns: 14em auto;
  column-gap: 2rem;
}

which would give flexibility for small-format devices.

Dependabot alerts can be seen here:

https://github.com/TEIC/teic.github.io/security/dependabot

sydb commented 10 months ago

Assigning to @joeytakeda to take a crack in a branch and report back (or submit PR if all went smoothly … but I have my suspicions :-).