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

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

Open
martindholmes opened this issue May 23, 2023 · 5 comments
Open

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

martindholmes opened this issue May 23, 2023 · 5 comments
Assignees
Labels
status: pending The original proposer or someone else has been asked to provide an example or further explanation.

Comments

@martindholmes
Copy link
Contributor

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
Copy link
Contributor

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

<xsl:template name="javascriptHook">
<script type="text/javascript" src="jquery-1.2.6.min.js">
<xsl:comment>JQuery</xsl:comment>
</script>
<script type="text/javascript" src="columnlist.js">
<xsl:comment>JQuery columnlist</xsl:comment>
</script>
<script type="text/javascript">
$(function() {
$('ul.attrefs-class').columnizeList({cols:3,width:30,unit:'%'});
$('ul.attrefs-element').columnizeList({cols:3,width:30,unit:'%'});
$(".displayRelaxButton").click(function() {
$(this).parent().find('.RNG_XML').toggle();
$(this).parent().find('.RNG_Compact').toggle();
});
$(".tocTree .showhide").click(function() {
$(this).find(".tocShow,.tocHide").toggle();
$(this).parent().find("ul.continuedtoc").toggle();
});
})
</script>

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
Copy link
Contributor Author

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

@trishaoconnor trishaoconnor added this to the Release 7.56.0 milestone Aug 25, 2023
@sydb
Copy link
Member

sydb commented Aug 25, 2023

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 :-).

@sydb sydb added status: needsDiscussion Council has not yet been able to agree on how to proceed. status: Go Council has decided the ticket should proceed. labels Aug 25, 2023
@HelenaSabel HelenaSabel modified the milestones: Release 7.56.0, Release 7.57.0 Nov 13, 2023
@HelenaSabel HelenaSabel added status: pending The original proposer or someone else has been asked to provide an example or further explanation. and removed status: needsDiscussion Council has not yet been able to agree on how to proceed. status: Go Council has decided the ticket should proceed. labels Jan 2, 2024
@joeytakeda
Copy link
Contributor

Not sure if this is resolved with the recent release and @raffazizzi 's fix (c.f. TEIC/TEI#2657)

@raffazizzi
Copy link
Contributor

@joeytakeda I removed the dependency for the TEI Guidelines, but that was injected by an XSLT in the TEI repo. I think the Stylesheets still include JQuery deps in other conversions. I can see it in epub, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending The original proposer or someone else has been asked to provide an example or further explanation.
Projects
None yet
Development

No branches or pull requests

7 participants