Skip to content

Commit

Permalink
Update scite plugin
Browse files Browse the repository at this point in the history
merges #415
  • Loading branch information
vincerubinetti authored Feb 12, 2021
1 parent 87c1195 commit 52ab9dc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build/plugins/scite.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
See https://scite.ai/.
-->

<link
rel="stylesheet"
type="text/css"
href="https://cdn.scite.ai/badge/scite-badge-latest.min.css"
/>
<script
async
type="application/javascript"
Expand All @@ -19,13 +14,13 @@
<script>
// start script
function start() {
// if printing, exit and don't run badges
if (window.matchMedia("print").matches) return;

// get citation elements
const query = ".references div[id*='ref-']";
const elements = document.querySelectorAll(query);
for (const element of elements) addBadge(element);

// attach scroll listener to window
window.addEventListener("scroll", onScroll);
}

// add badge in citation element
Expand Down Expand Up @@ -58,4 +53,10 @@
text-indent: 0;
margin-top: 10px;
}

@media print {
.scite-badge {
display: none;
}
}
</style>

0 comments on commit 52ab9dc

Please sign in to comment.