@farberg/reveal-template 1.0.50 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farberg/reveal-template",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "homepage": "https://github.com/pfisterer/reveal-template",
5
5
  "description": "Reveal.js template for Dennis' lectures",
6
6
  "main": "index.js",
@@ -17,10 +17,11 @@
17
17
  "dependencies": {
18
18
  "connect": "^3.7.0",
19
19
  "file-saver": "^2.0.5",
20
- "jszip": "^3.7.1",
21
- "qrcode": "^1.5.0",
22
- "reveal.js": "^4.3.1",
20
+ "jszip": "^3.10.1",
21
+ "qrcode": "^1.5.1",
22
+ "reveal.js": "^4.4.0",
23
23
  "reveal.js-plugins": "^4.1.5",
24
- "serve-static": "^1.15.0"
24
+ "serve-static": "^1.15.0",
25
+ "asciinema-player": "^3.0.1"
25
26
  }
26
27
  }
@@ -0,0 +1,30 @@
1
+
2
+ export default () => {
3
+
4
+ return {
5
+ id: 'asciinema',
6
+ init: (deck) => {
7
+
8
+ deck.on('ready', () => {
9
+ // Workaround to get elements into an array before they are replaced
10
+ const els = []
11
+ for (let el of deck.getRevealElement().getElementsByTagName("asciinema")) {
12
+ els.push(el)
13
+ }
14
+
15
+ for (let el of els) {
16
+ console.log("Looking @", el)
17
+ const source = el.getAttribute('src')
18
+ const conf = el.getAttribute('data-conf')
19
+ const div = document.createElement('div')
20
+
21
+ el.parentElement.replaceChild(div, el)
22
+
23
+ console.log("Playing", source, "with options", conf)
24
+ console.log(AsciinemaPlayer.create(source, div, JSON.parse(conf)));
25
+ }
26
+ })
27
+
28
+ }
29
+ }
30
+ }