Skip to content

Commit 0773adb

Browse files
committed
Move initialization script into rough.js
1 parent 5ae029a commit 0773adb

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

_extensions/roughnotation/assets/roughnotation.html renamed to _extensions/roughnotation/rough.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
<script src="_extensions/emilhvitfeldt/roughnotation/assets/rough-notation.iife.js"></script>
2-
<script>
3-
var rn_counter = 0;
1+
document.addEventListener("DOMContentLoaded", function () {
2+
var rn_counter = 0;
43

5-
document.addEventListener("DOMContentLoaded", function() {
64
Reveal.on("slidechanged", (event) => {
75
rn_counter = 0;
86
});
@@ -17,7 +15,7 @@
1715

1816
Reveal.addKeyBinding(
1917
{ keyCode: 82, key: "R", description: "Trigger RoughNotation" },
20-
() => {
18+
function () {
2119
rn_counter = rn_counter + 1;
2220

2321
const slide = Reveal.getCurrentSlide();
@@ -57,4 +55,3 @@
5755
}
5856
);
5957
})
60-
</script>

_extensions/roughnotation/rough.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ function Meta(m)
22
quarto.doc.addHtmlDependency({
33
name = "roughnotation",
44
version = "1.0.0",
5-
scripts = {"assets/rough-notation.iife.js"}
5+
scripts = {"assets/rough-notation.iife.js", "rough.js"}
66
})
7-
quarto.doc.includeFile("after-body", "assets/roughnotation.html")
87
end

0 commit comments

Comments
 (0)