This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(PLOS): Update theme with new semantic selectors
- Loading branch information
1 parent
d552f57
commit ca36008
Showing
2 changed files
with
153 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,3 @@ | ||
import { load } from '../../shared/js' | ||
|
||
load() | ||
|
||
/* | ||
This is old code, currently commented out with the view to | ||
consolidating in shared. | ||
export const init = (): void => { | ||
const referenceListItemSel = '[itemprop="references"] > li' | ||
const datePublishedSel = '[itemprop="datePublished"]' | ||
const publicationIssueTitleSel = | ||
'[itemtype="https://schema.org/PublicationIssue"] [itemprop="title"]' | ||
document.querySelectorAll(referenceListItemSel).forEach(node => { | ||
// If PublicationIssue title node exists, | ||
const publicationIssueTitle = node.querySelector(publicationIssueTitleSel) | ||
// Move last datePublished after PublicationIssue title. | ||
const datePublished = document.querySelectorAll(datePublishedSel) | ||
const lastDatePublished = datePublished[datePublished.length - 1] | ||
if (publicationIssueTitle && publicationIssueTitle.parentNode) { | ||
publicationIssueTitle.parentNode.insertBefore( | ||
lastDatePublished, | ||
publicationIssueTitle.nextSibling | ||
) | ||
} | ||
}) | ||
} | ||
document.addEventListener('DOMContentLoaded', init) | ||
*/ |
Oops, something went wrong.